2008-12-03 20:25:05 +01:00
|
|
|
<% context = context_listing
|
|
|
|
|
suppress_drag_handle ||= false
|
|
|
|
|
suppress_edit_button ||= false
|
|
|
|
|
%>
|
2007-03-30 04:36:52 +00:00
|
|
|
<div id="<%= dom_id(context, "container") %>" class="list">
|
|
|
|
|
<div id="<%= dom_id(context) %>" class="context sortable_row" style="display:'';">
|
2008-12-03 20:25:05 +01:00
|
|
|
<% unless suppress_drag_handle -%>
|
|
|
|
|
<div class="position">
|
2011-01-16 18:14:07 +01:00
|
|
|
<span class="handle"><%= t('common.drag_handle') %></span>
|
2008-12-03 20:25:05 +01:00
|
|
|
</div>
|
|
|
|
|
<% end -%>
|
2007-03-30 04:36:52 +00:00
|
|
|
<div class="data">
|
|
|
|
|
<%= link_to_context( context ) %> <%= " (" + count_undone_todos_phrase(context,"actions") + ")" %>
|
|
|
|
|
</div>
|
2007-11-17 21:12:34 +00:00
|
|
|
|
2007-03-30 04:36:52 +00:00
|
|
|
<div class="buttons">
|
|
|
|
|
<% if context.hide? %>
|
2011-01-16 18:14:07 +01:00
|
|
|
<span class="grey"><%= t('states.hidden') %></span>
|
2007-03-30 04:36:52 +00:00
|
|
|
<% else %>
|
2011-01-16 18:14:07 +01:00
|
|
|
<span class="grey"><%= t('states.visible') %></span>
|
2007-03-30 04:36:52 +00:00
|
|
|
<% end %>
|
2009-10-07 11:36:43 -04:00
|
|
|
<%= link_to_remote(
|
2011-01-16 18:14:07 +01:00
|
|
|
image_tag( "blank.png", :title => t('contexts.delete_context'), :class=>"delete_item"),
|
2009-10-07 11:36:43 -04:00
|
|
|
: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();",
|
2011-01-16 18:14:07 +01:00
|
|
|
:confirm => t('contexts.delete_context_confirmation', :name => context.name),
|
2010-02-09 23:26:38 +01:00
|
|
|
:html => { :id => dom_id(context, 'delete') }
|
2009-10-07 11:36:43 -04:00
|
|
|
) %>
|
2009-10-02 19:45:49 -04:00
|
|
|
<%= link_to_remote(
|
2011-01-16 18:14:07 +01:00
|
|
|
image_tag( "blank.png", :title => t('contexts.edit_context'), :class=>"edit_item"),
|
2009-10-02 19:45:49 -04:00
|
|
|
:url => {:controller => 'contexts', :action => 'edit', :id => context.id},
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:with => "'_source_view=#{@source_view}'",
|
|
|
|
|
:before => "$('#{dom_id(context)}').block({message:null});",
|
2010-04-10 15:11:59 -04:00
|
|
|
:complete => "$('#{dom_id(context)}').unblock();",
|
|
|
|
|
:html => {:id => "edit_context_#{context.id}_link"}
|
2009-10-02 19:45:49 -04:00
|
|
|
) %>
|
2007-03-30 04:36:52 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2009-10-02 19:45:49 -04:00
|
|
|
<div id="<%= dom_id(context, 'edit') %>" class="edit-form" style="display:none;">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|