]> git.openstreetmap.org Git - rails.git/commitdiff
Move bootstrap pagination list wrapper to template
authorAnton Khorev <tony29@yandex.ru>
Tue, 3 Oct 2023 15:02:11 +0000 (18:02 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 16 Nov 2023 10:21:14 +0000 (13:21 +0300)
app/views/browse/_paging_nav.html.erb
lib/classic_pagination/pagination_helper.rb

index 1f4cbee85e8a8af148b08a720c272db7e34481c6..738d2f2eed616926c484e61737da2cfa36ab96e7 100644 (file)
@@ -1,8 +1,8 @@
 <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>
index 3ff7fbf4e24bbc5f167a4b471082f8d43ba527cc..c691360e09f103207bac0e54e83ac5d0db638f15 100644 (file)
@@ -133,6 +133,7 @@ module ActionView
 
       # 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)
@@ -148,8 +149,6 @@ module ActionView
 
         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
@@ -168,8 +167,6 @@ module ActionView
           html << bootstrap_page_item_link(last.number.to_s, yield(last.number))
         end
 
-        html << "</ul>"
-
         html
       end