limit = 500
issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version])
if (idx = issue_ids.index(@issue.id)) && idx < limit
+ if issue_ids.size < 500
+ @issue_position = idx + 1
+ @issue_count = issue_ids.size
+ end
@prev_issue_id = issue_ids[idx - 1] if idx > 0
@next_issue_id = issue_ids[idx + 1] if idx < (issue_ids.size - 1)
end
"\xc2\xab #{l(:label_previous)}",
issue_path(@prev_issue_id),
:title => "##{@prev_issue_id}" %> |
+ <% if @issue_position && @issue_count %>
+ <span class="position"><%= "#{@issue_position}/#{@issue_count}" %></span> |
+ <% end %>
<%= link_to_if @next_issue_id,
"#{l(:label_next)} \xc2\xbb",
issue_path(@next_issue_id),
assert_response :success
assert_nil assigns(:prev_issue_id)
assert_nil assigns(:next_issue_id)
+
+ assert_no_tag 'div', :attributes => {:class => /next-prev-links/}
end
def test_show_should_display_prev_next_links_with_query_in_session
assert_equal 2, assigns(:prev_issue_id)
assert_equal 5, assigns(:next_issue_id)
+ assert_tag 'div', :attributes => {:class => /next-prev-links/}
assert_tag 'a', :attributes => {:href => '/issues/2'}, :content => /Previous/
assert_tag 'a', :attributes => {:href => '/issues/5'}, :content => /Next/
+
+ count = Issue.open.visible.count
+ assert_tag 'span', :attributes => {:class => 'position'}, :content => "3/#{count}"
end
def test_show_should_display_prev_next_links_with_saved_query_in_session