1 module NumberedPaginationHelper
2 def element_versions_pagination(top_version, active_version: 0, &)
4 "pagination pagination-sm",
5 "overflow-x-scroll pb-3", # horizontal scrollbar with reserved space below
6 "pt-1" # space reserved for focus outlines
8 (1..top_version).each do |v|
9 concat element_versions_pagination_item(v, **yield(v), :active => v == active_version)
16 def element_versions_pagination_item(body, href: nil, title: nil, active: false)
17 link_class = "page-link"
18 link = link_to body, href, :class => link_class, :title => title
19 tag.li link, :class => ["page-item", { "active" => active }]