summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/issues_controller.rb6
-rw-r--r--app/views/issues/show.html.erb6
-rw-r--r--test/integration/issues_test.rb1
3 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 73f2eb404..b6c72a314 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -412,6 +412,7 @@ class IssuesController < ApplicationController
else
retrieve_query_from_session
if @query
+ @per_page = per_page_option
limit = 500
issue_ids = @query.issue_ids(:limit => (limit + 1))
if (idx = issue_ids.index(@issue.id)) && idx < limit
@@ -422,6 +423,11 @@ class IssuesController < ApplicationController
@prev_issue_id = issue_ids[idx - 1] if idx > 0
@next_issue_id = issue_ids[idx + 1] if idx < (issue_ids.size - 1)
end
+ query_params = @query.as_params
+ if @issue_position
+ query_params = query_params.merge(:page => (@issue_position / per_page_option) + 1, :per_page => per_page_option)
+ end
+ @query_path = _project_issues_path(@query.project, query_params)
end
end
end
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index e51124712..08028d270 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -11,7 +11,11 @@
:title => "##{@prev_issue_id}",
:accesskey => accesskey(:previous) %> |
<% if @issue_position && @issue_count %>
- <span class="position"><%= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |
+ <span class="position">
+ <%= link_to_if @query_path,
+ l(:label_item_position, :position => @issue_position, :count => @issue_count),
+ @query_path %>
+ </span> |
<% end %>
<%= link_to_if @next_issue_id,
"#{l(:label_next)} \xc2\xbb",
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index c90469be7..eb402e172 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -130,6 +130,7 @@ class IssuesTest < Redmine::IntegrationTest
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '3 of 5'
+ assert_select '.next-prev-links .position a[href^=?]', '/projects/ecookbook/issues?'
end
end