X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/eec9e29c963bc20e4e968d5aefd7cc22ca1cbeba..6bc81dc3e7f423a29003d12732599351a75d931a:/app/views/traces/index.html.erb
diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb
index 86ac37f00..ddbaa9e94 100644
--- a/app/views/traces/index.html.erb
+++ b/app/views/traces/index.html.erb
@@ -1,43 +1,90 @@
+<% content_for :heading_class, "pb-0" %>
<% content_for :heading do %>
<%= @title %>
-
- - <%= t(".description") %>
- - <%= rss_link_to :action => "georss", :display_name => @display_name, :tag => @tag %>
- - <%= link_to t(".upload_trace"), new_trace_path %>
- <% if @tag %>
- - <%= link_to t(".see_all_traces"), :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil %>
- - <%= link_to t(".see_my_traces"), :action => "mine", :tag => nil, :page => nil %>
- <% else %>
- <% if @display_name %>
- - <%= link_to t(".see_all_traces"), :controller => "traces", :action => "index", :display_name => nil, :tag => nil, :page => nil %>
+
+
+ <% if @target_user.blank? %>
+
+ -
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link active" } %>
+
+ <% if current_user %>
+ -
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
+
<% end %>
+ <% elsif current_user && current_user == @target_user %>
+ -
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
+
+
+ -
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link active" } %>
+
+ <% else %>
+
+ -
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
+
<% if current_user && current_user != @target_user %>
- - <%= link_to t(".see_my_traces"), :action => "mine", :tag => nil, :page => nil %>
+ -
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
+
<% end %>
+ -
+ <%= link_to t(".public_traces_from", :user => @target_user&.display_name), { :action => "mine" }, { :class => "nav-link active" } %>
+
<% end %>
+
+
+ -
+
+ <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm" }) do %>
+
+ <% end -%>
+ <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm" %>
+
+
<% end %>
<% content_for :auto_discovery_link_tag do %>
-<%= auto_discovery_link_tag :rss, :action => "georss", :display_name => @display_name, :tag => @tag %>
+ <%= auto_discovery_link_tag :rss, :action => "georss", :display_name => @target_user&.display_name, :tag => params[:tag] %>
<% end %>
<% if @traces.size > 0 %>
- <%= render :partial => "trace_paging_nav" %>
+ <%= render "shared/pagination",
+ :newer_key => "traces.trace_paging_nav.newer",
+ :older_key => "traces.trace_paging_nav.older",
+ :newer_id => @newer_traces && @traces.first.id,
+ :older_id => @older_traces && @traces.last.id %>
-
-
- |
- |
-
-
- <%= render @traces unless @traces.nil? %>
+ <%= render @traces %>
- <%= render :partial => "trace_paging_nav" %>
+ <%= render "shared/pagination",
+ :newer_key => "traces.trace_paging_nav.newer",
+ :older_key => "traces.trace_paging_nav.older",
+ :newer_id => @newer_traces && @traces.first.id,
+ :older_id => @older_traces && @traces.last.id %>
<% else %>
- <%= t ".empty_html", :upload_link => new_trace_path %>
+ <%= t ".empty_title" %>
+ <%= t ".empty_upload_html", :upload_link => link_to(t(".upload_new"), new_trace_path),
+ :wiki_link => link_to(t(".wiki_page"), t(".wiki_page_url")) %>
<% end %>