mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 11:38:49 +01:00
43 lines
1.7 KiB
Text
43 lines
1.7 KiB
Text
<% context = context_listing
|
|
suppress_drag_handle ||= false
|
|
suppress_edit_button ||= false
|
|
%>
|
|
<div id="<%= dom_id(context, "container") %>" class="list">
|
|
<div id="<%= dom_id(context) %>" class="context sortable_row" style="display:'';">
|
|
<% unless suppress_drag_handle -%>
|
|
<div class="position">
|
|
<span class="handle">DRAG</span>
|
|
</div>
|
|
<% end -%>
|
|
<div class="data">
|
|
<%= link_to_context( context ) %> <%= " (" + count_undone_todos_phrase(context,"actions") + ")" %>
|
|
</div>
|
|
|
|
<div class="buttons">
|
|
<% if context.hide? %>
|
|
<span class="grey">HIDDEN</span>
|
|
<% else %>
|
|
<span class="grey">VISIBLE</span>
|
|
<% end %>
|
|
<%= link_to_remote(
|
|
image_tag( "blank.png", :title => "Delete context", :class=>"delete_item"),
|
|
:url => {:controller => 'contexts', :action => 'destroy', :id => context.id},
|
|
:method => 'delete',
|
|
:with => "'_source_view=#{@source_view}'",
|
|
:before => "$('#{dom_id(context)}').block({message:null});",
|
|
:complete => "$('#{dom_id(context)}').unblock();",
|
|
:confirm => "Are you sure you want to delete the context '#{context.name}'?"
|
|
) %>
|
|
<%= link_to_remote(
|
|
image_tag( "blank.png", :title => "Edit context", :class=>"edit_item"),
|
|
:url => {:controller => 'contexts', :action => 'edit', :id => context.id},
|
|
:method => 'get',
|
|
:with => "'_source_view=#{@source_view}'",
|
|
:before => "$('#{dom_id(context)}').block({message:null});",
|
|
:complete => "$('#{dom_id(context)}').unblock();"
|
|
) %>
|
|
</div>
|
|
</div>
|
|
<div id="<%= dom_id(context, 'edit') %>" class="edit-form" style="display:none;">
|
|
</div>
|
|
</div>
|