From: Tobias Jordans Date: Sat, 2 Jan 2021 21:48:25 +0000 (+0100) Subject: Traces: Migrate pagination to bootstrap X-Git-Tag: live~1819^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/18ec2730389a92a74fd3fd6d85c22c7403fdbf74 Traces: Migrate pagination to bootstrap Same feature, different style. - Change pagination to use bootstrap default styles - … but with empty span-tags instead of non-active a-tags - refactor partial to not use @-variables but get the variables via the render-call, simplify render-call-syntax - remove the additional `if @traces.size > 1` inside the pagination partial since that caused the pagination to disappear on the last page. The partial will be visible with inactive links. - Add bootstrap spacer-classes to overwrite commons-css so removing. Eg. commons also has a pagination class same as bootstrap. --- diff --git a/app/views/traces/_trace_paging_nav.html.erb b/app/views/traces/_trace_paging_nav.html.erb index 4fcc7b4d8..f3666d926 100644 --- a/app/views/traces/_trace_paging_nav.html.erb +++ b/app/views/traces/_trace_paging_nav.html.erb @@ -1,18 +1,27 @@ -

+

diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb index 609dbcede..925f9beac 100644 --- a/app/views/traces/index.html.erb +++ b/app/views/traces/index.html.erb @@ -23,15 +23,15 @@ <% end %> <% if @traces.size > 0 %> - <%= render :partial => "trace_paging_nav" %> + <%= render "trace_paging_nav", :page => @page, :page_size => @page_size, :traces => @traces, :params => @params %> - +
<%= render @traces unless @traces.nil? %>
- <%= render :partial => "trace_paging_nav" %> + <%= render "trace_paging_nav", :page => @page, :page_size => @page_size, :traces => @traces, :params => @params %> <% else %>

<%= t ".empty_html", :upload_link => new_trace_path %>

<% end %>