openstreetmap-website/app/views/traces/index.html.erb
Tobias Jordans 18ec273038 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.
2021-01-03 20:55:50 +01:00

37 lines
1.6 KiB
Text

<% content_for :heading do %>
<h1><%= @title %></h1>
<ul class='secondary-actions clearfix'>
<li><%= t(".description") %></li>
<li><%= rss_link_to :action => "georss", :display_name => @display_name, :tag => @tag %></li>
<li><%= link_to t(".upload_trace"), new_trace_path %></li>
<% if @tag %>
<li><%= link_to t(".see_all_traces"), :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil %></li>
<li><%= link_to t(".see_my_traces"), :action => "mine", :tag => nil, :page => nil %></li>
<% else %>
<% if @display_name %>
<li><%= link_to t(".see_all_traces"), :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil %></li>
<% end %>
<% if current_user && current_user != @target_user %>
<li><%= link_to t(".see_my_traces"), :action => "mine", :tag => nil, :page => nil %></li>
<% end %>
<% end %>
</ul>
<% end %>
<% content_for :auto_discovery_link_tag do %>
<%= auto_discovery_link_tag :rss, :action => "georss", :display_name => @display_name, :tag => @tag %>
<% end %>
<% if @traces.size > 0 %>
<%= render "trace_paging_nav", :page => @page, :page_size => @page_size, :traces => @traces, :params => @params %>
<table id="trace_list" class="table table-borderless table-striped mb-0">
<tbody>
<%= render @traces unless @traces.nil? %>
</tbody>
</table>
<%= render "trace_paging_nav", :page => @page, :page_size => @page_size, :traces => @traces, :params => @params %>
<% else %>
<h4><%= t ".empty_html", :upload_link => new_trace_path %></h4>
<% end %>