Display the position of the current issue in the query results.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8663 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-16 18:24:59 +00:00
parent dfe26befdd
commit 44a898a210
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -330,6 +330,10 @@ private
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