provides story higher in the backlog for the rendering partial to avoid querying for it in the partial

pull/6827/head
Jens Ulferts 12 years ago
parent 4d50574afe
commit 5f28999952
  1. 10
      app/views/rb_master_backlogs/_backlog.html.erb
  2. 2
      app/views/rb_stories/_story.html.erb

@ -6,6 +6,14 @@
</div>
<ul class="stories">
<% reset_cycle 'stories' %>
<%= render :partial => "rb_stories/story", :collection => backlog.stories %>
<% backlog.stories.each_with_index do |story, index| %>
<% higher_item = index == 0 ?
nil :
backlog.stories[index - 1] %>
<%= render :partial => "rb_stories/story",
:locals => { :story => story,
:higher_item => higher_item } %>
<% end %>
</ul>
</div>

@ -14,7 +14,7 @@
</div>
<div class="subject editable" fieldname="subject" fieldorder="2"><%=h story.subject %></div>
<div class="fixed_version_id"><%= story.fixed_version_id %></div>
<div class="higher_item_id"><%= story.higher_item.blank? ? '' : story.higher_item.id %></div>
<div class="higher_item_id"><%= !defined?(higher_item) || higher_item.nil? ? '' : higher_item.id %></div>
<div class="meta">
<%= render :partial => "shared/model_errors", :object => story.errors %>
</div>

Loading…
Cancel
Save