From 300cd884ec5a8bd76be912f7d745e0ced7761175 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 17 Nov 2021 15:52:59 +0000 Subject: [PATCH 1/1] Use flex grid instead of floating to position changeset element paging nav This works much better when either the heading or the paging is long. The heading was moved into the partial to avoid repetitive grid definitions --- app/assets/stylesheets/common.scss | 2 -- app/views/browse/_paging_nav.html.erb | 19 ++++++++++++++----- app/views/browse/changeset.html.erb | 15 +++------------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 3cb69cf0b..58642dd55 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -803,8 +803,6 @@ tr.turn:hover { } .paginate { - float: right; - padding: 1px 6px; border: 1px solid $lightgrey; border-radius: 3px; } diff --git a/app/views/browse/_paging_nav.html.erb b/app/views/browse/_paging_nav.html.erb index 67f1c75a3..713a1d6d4 100644 --- a/app/views/browse/_paging_nav.html.erb +++ b/app/views/browse/_paging_nav.html.erb @@ -1,5 +1,14 @@ -<% if pages.page_count > 1 %> - - <%= raw pagination_links_each(pages, {}) { |n| link_to(n, page_param => n) } %> - -<% end %> +
+
+

<%= heading %>

+
+ <% if pages.page_count > 1 %> +
+

+ + <%= raw pagination_links_each(pages, {}) { |n| link_to(n, page_param => n) } %> + +

+
+ <% end %> +
diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 496589a08..523cb84d6 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -86,10 +86,7 @@ <% end %> <% unless @ways.empty? %> -

- <%= type_and_paginated_count("way", @way_pages) %> - <%= render :partial => "paging_nav", :locals => { :pages => @way_pages, :page_param => "way_page" } %> -

+ <%= render :partial => "paging_nav", :locals => { :heading => type_and_paginated_count("way", @way_pages), :pages => @way_pages, :page_param => "way_page" } %>