Commit 7d63f9d4 authored by jplang's avatar jplang

Adds a link back to the issue list that we are coming from.

git-svn-id: https://svn.redmine.org/redmine/trunk@16478 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent e2ac5a91
......@@ -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
......
......@@ -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",
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment