1 <div class="d-flex flex-wrap gap-2">
2 <h4 class="fs-5 mb-0"><%= heading %></h4>
3 <% if pages.page_count > 1 %>
4 <ul class="pagination pagination-sm mb-1 ms-auto">
6 max_width_for_default_padding = 35
9 pagination_items(pages, {}).each do |body, n|
10 width += 2 # padding width
13 link_classes = ["page-link", {"px-1" => width > max_width_for_default_padding}]
15 pagination_items(pages, {}).each do |body, n|
16 linked = !(n.is_a? String)
18 <%= content_tag "li", :class => ["page-item", {n => !linked}] do
20 link_to(body, url_for(page_param => n), :class => link_classes)
22 content_tag("span", body, :class => link_classes)