<div class="d-flex flex-wrap gap-2">
<h4 class="fs-5 mb-0"><%= heading %></h4>
<% if pages.page_count > 1 %>
- <div class="ms-auto">
+ <ul class="pagination pagination-sm mb-1 ms-auto">
<%= raw pagination_links_bootstrap(pages, {}) { |n| url_for(page_param => n) } %>
- </div>
+ </ul>
<% end %>
</div>
# Same as above, but
# - with bootstrap classes
+ # - no list wrapper
# - invoked block returns the page url
def pagination_links_bootstrap(paginator, options)
options = DEFAULT_OPTIONS.merge(options)
html = ""
- html << "<ul class='pagination pagination-sm mb-1'>"
-
if always_show_anchors && !(wp_first = window_pages[0]).first?
html << bootstrap_page_item_link(first.number.to_s, yield(first.number))
html << bootstrap_page_item_disabled("...") if wp_first.number - first.number > 1
html << bootstrap_page_item_link(last.number.to_s, yield(last.number))
end
- html << "</ul>"
-
html
end