]> git.openstreetmap.org Git - rails.git/blob - app/helpers/pagination_helper.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / app / helpers / pagination_helper.rb
1 # frozen_string_literal: true
2
3 module PaginationHelper
4   def pagination_item(params, title, &)
5     link_class = "page-link icon-link text-center"
6     page_link_content = capture(&)
7     if params
8       page_link = link_to page_link_content,
9                           params,
10                           :class => link_class,
11                           :title => title,
12                           :data => { "turbo" => true, "turbo-frame" => "pagination", "turbo-action" => "advance" }
13       tag.li page_link, :class => "page-item d-flex"
14     else
15       page_link = tag.span page_link_content,
16                            :class => link_class
17       tag.li page_link, :class => "page-item d-flex disabled"
18     end
19   end
20 end