From 2b2fe4459f019a7c154ddc2cb3a70cede829f2b0 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Tue, 17 Mar 2026 21:45:20 +0900 Subject: [PATCH 1/2] Align issue previous/next link styling with pagination buttons --- app/assets/stylesheets/application.css | 4 +- app/views/issues/show.html.erb | 48 +++++++++++++++-------- test/functional/issues_controller_test.rb | 11 ++++-- test/integration/issues_test.rb | 8 ++-- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index b47d5cdd1..1068f5d61 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -775,7 +775,9 @@ div.issue div.subject>div>p { margin-block-start: 0.5em; } div.issue div.subject h3 {margin-block: 0 0.1em; margin-inline: 0;} div.issue p.author {margin-block-start: 0.5em; font-size: 93%} div.issue span.private, div.journal span.private {font-size: 60%;} -div.issue .next-prev-links {color:var(--oc-gray-6);} +div.issue .next-prev-links {color: var(--oc-gray-6); margin-block: 1px 0;} +div.issue .next-prev-links .pagination ul.pages {margin-inline: 0; display: inline-flex;} +div.issue .next-prev-links .pagination ul.pages li {margin-block-end: 0;} div.issue .attributes {margin-block-start: 2em;} div.issue .attributes .attribute {padding-inline-start: 180px; clear: inline-start; min-block-size: 1.8em;} div.issue .attributes .attribute .label {inline-size: 170px; margin-inline-start: -180px; font-weight: bold; float: inline-start; overflow: clip visible; text-overflow: ellipsis;} diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 94ab1162a..bc957b3ce 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -8,23 +8,37 @@
<% if @prev_issue_id || @next_issue_id %> <% end %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 42db408af..3ea54226d 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2627,7 +2627,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'div.next-prev-links' do assert_select 'a[href="/issues/2"]', :text => /Previous/ assert_select 'a[href="/issues/5"]', :text => /Next/ - assert_select 'span.position', :text => "3 of #{count}" + assert_select 'li.page.position', :text => "3 of #{count}" end end @@ -2704,7 +2704,12 @@ class IssuesControllerTest < Redmine::ControllerTest end assert_response :success assert_select 'div.next-prev-links' do - assert_select 'a', :text => /Previous/, :count => 0 + # "Previous" button for the first issue does not have the "page" class and a link + assert_select 'span.pagination ul.pages li.previous', 1 + assert_select 'span.pagination ul.pages li.previous.page', 0 + assert_select 'li.previous span', :text => /Previous/ + assert_select 'li.previous a', :count => 0 + assert_select 'span.pagination ul.pages li.next.page', 1 assert_select 'a[href="/issues/2"]', :text => /Next/ end end @@ -2749,7 +2754,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'div.next-prev-links' do assert_select 'a[href="/issues/7"]', text: /Previous/ assert_select 'a[href="/issues/9"]', text: /Next/ - assert_select 'span.position', text: "7 of 10" + assert_select 'li.page.position', text: "7 of 10" end end diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb index d0763091e..c321f9717 100644 --- a/test/integration/issues_test.rb +++ b/test/integration/issues_test.rb @@ -205,7 +205,7 @@ class IssuesTest < Redmine::IntegrationTest get '/issues/5' assert_response :success - assert_select '.next-prev-links .position', :text => '5 of 6' + assert_select '.next-prev-links .pagination .page.position', :text => '5 of 6' end end @@ -217,8 +217,8 @@ 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?' + assert_select '.next-prev-links .pagination .page.position', :text => '3 of 5' + assert_select '.next-prev-links .pagination .page.position a[href^=?]', '/projects/ecookbook/issues?' end end @@ -236,7 +236,7 @@ class IssuesTest < Redmine::IntegrationTest get '/issues/5' assert_response :success - assert_select '.next-prev-links .position', :text => '6 of 8' + assert_select '.next-prev-links .pagination .page.position', :text => '6 of 8' end end -- 2.50.1