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