1 module NumberedPaginationHelper
2 def element_versions_pagination(top_version, active_version: 0, &)
5 lists << tag.ul(:class => [
6 "pagination pagination-sm",
7 "overflow-x-scroll pb-3", # horizontal scrollbar with reserved space below
8 "pt-1" # space reserved for focus outlines
10 (1..top_version).each do |v|
11 concat element_versions_pagination_item(v, **yield(v), :active => v == active_version)
15 tag.div safe_join(lists), :class => "d-flex align-items-start"
20 def element_versions_pagination_item(body, href: nil, title: nil, active: false)
21 link_class = "page-link"
22 link = link_to body, href, :class => link_class, :title => title
23 tag.li link, :class => ["page-item", { "active" => active }]