Feature #43885 » 0001-Align-issue-previous-next-link-styling-with-paginati.patch
| app/assets/stylesheets/application.css | ||
|---|---|---|
|
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;}
|
||
| app/views/issues/show.html.erb | ||
|---|---|---|
|
<div class="<%= @issue.css_classes %> details">
|
||
|
<% if @prev_issue_id || @next_issue_id %>
|
||
|
<div class="next-prev-links contextual">
|
||
|
<%= link_to_if @prev_issue_id,
|
||
|
"\xc2\xab #{l(:label_previous)}",
|
||
|
(@prev_issue_id ? issue_path(@prev_issue_id) : nil),
|
||
|
:title => "##{@prev_issue_id}",
|
||
|
:accesskey => accesskey(:previous) %> |
|
||
|
<% if @issue_position && @issue_count %>
|
||
|
<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",
|
||
|
(@next_issue_id ? issue_path(@next_issue_id) : nil),
|
||
|
:title => "##{@next_issue_id}",
|
||
|
:accesskey => accesskey(:next) %>
|
||
|
<span class="pagination">
|
||
|
<ul class="pages">
|
||
|
<li class="<%= @prev_issue_id ? 'previous page' : 'previous' %>">
|
||
|
<% if @prev_issue_id %>
|
||
|
<%= link_to "\xc2\xab #{l(:label_previous)}",
|
||
|
issue_path(@prev_issue_id),
|
||
|
:title => "##{@prev_issue_id}",
|
||
|
:accesskey => accesskey(:previous) %>
|
||
|
<% else %>
|
||
|
<%= content_tag(:span, "\xc2\xab #{l(:label_previous)}") %>
|
||
|
<% end %>
|
||
|
</li>
|
||
|
<% if @issue_position && @issue_count %>
|
||
|
<li class="page position">
|
||
|
<%= link_to_if @query_path,
|
||
|
l(:label_item_position, :position => @issue_position, :count => @issue_count),
|
||
|
@query_path %>
|
||
|
</li>
|
||
|
<% end %>
|
||
|
<li class="<%= @next_issue_id ? 'next page' : 'next' %>">
|
||
|
<% if @next_issue_id %>
|
||
|
<%= link_to "#{l(:label_next)} \xc2\xbb",
|
||
|
issue_path(@next_issue_id),
|
||
|
:title => "##{@next_issue_id}",
|
||
|
:accesskey => accesskey(:next) %>
|
||
|
<% else %>
|
||
|
<%= content_tag(:span, "#{l(:label_next)} \xc2\xbb") %>
|
||
|
<% end %>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</span>
|
||
|
</div>
|
||
|
<% end %>
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
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
|
||
| test/integration/issues_test.rb | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
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
|
||