replace small partials with helper to improve performance

This commit is contained in:
Reinier Balt 2011-01-10 17:20:40 +01:00
parent 8cbe077784
commit 05ba6060fc
5 changed files with 25 additions and 27 deletions

View file

@ -32,8 +32,8 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
<%= tag_list %>
<%= deferred_due_date %>
<%= project_and_context_links( parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
<%= render(:partial => "todos/toggle_notes", :object => todo) if todo.notes? %>
<%= render(:partial => "todos/toggle_successors", :object => todo) unless todo.pending_successors.empty? %>
<%= collapsed_notes_image(todo) if todo.notes? %>
<%= collapsed_successors_image(todo) unless todo.pending_successors.empty? %>
</div>
</div>
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">

View file

@ -1,6 +0,0 @@
<% item = toggle_notes -%>
<%= link_to(image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ), "#", {:class => 'show_notes', :title => 'Show notes'}) %>
<div class="todo_notes" id="<%= dom_id(item, 'notes') %>" style="display:none">
<%= format_note(item.notes) %>
</div>

View file

@ -1,12 +0,0 @@
<% item = toggle_successors %>
<%= link_to(image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ), "#", {:class => 'show_successors', :title => 'Show successors'}) %>
<div class="todo_successors" id="<%= dom_id(item, 'successors') %>">
<%= render :partial => "todos/successor",
:collection => item.pending_successors,
:locals => { :parent_container_type => parent_container_type,
:suppress_dependencies => true,
:predecessor => item }
%>
</div>