+<% content_for :heading_class, "pb-0" %>
<% 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>
+ <nav class="secondary-actions mb-3">
+ <ul>
+ <li>
+ <%= t(".description") %>
+ </li>
+ <% if params[:tag] %>
+ <li>
+ <%= link_to t(".remove_tag_filter", :tag => params[:tag]), { :controller => "traces", :action => "index", :tag => nil } %>
+ </li>
+ <% end %>
+ </ul>
+ </nav>
+ <ul class="nav nav-tabs flex-column flex-sm-row">
+ <% if @target_user.blank? %>
+ <!-- public traces -->
+ <li class="nav-item">
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link active" } %>
+ </li>
+ <% if current_user %>
+ <li class="nav-item">
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
+ </li>
<% end %>
+ <% elsif current_user && current_user == @target_user %>
+ <li class="nav-item">
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
+ </li>
+ <!-- my traces -->
+ <li class="nav-item">
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link active" } %>
+ </li>
+ <% else %>
+ <!-- traces_from @target_user -->
+ <li class="nav-item">
+ <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
+ </li>
<% if current_user && current_user != @target_user %>
- <li><%= link_to t(".see_my_traces"), :action => "mine", :tag => nil, :page => nil %></li>
+ <li class="nav-item">
+ <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
+ </li>
<% end %>
+ <li class="nav-item">
+ <%= link_to t(".traces_from", :user => @target_user&.display_name), { :controller => "traces", :action => "index", :display_name => @target_user&.display_name }, { :class => "nav-link active" } %>
+ </li>
<% end %>
+
+ <li class="nav-item ms-auto">
+ <div class="nav-link pe-0">
+ <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm my-n2 align-baseline border-0" }) do %>
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class="align-text-bottom">
+ <circle cx="2" cy="14" r="2" fill="white" />
+ <path d="M 8 14 a 6 6 0 0 0 -6 -6 M 14 14 a 12 12 0 0 0 -12 -12" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" />
+ </svg><% end -%>
+ <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm my-n2 align-baseline border-0" %>
+ </div>
+ </li>
</ul>
<% 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 %>
<table id="trace_list" class="table table-borderless table-striped">
- <thead>
- <tr>
- <th></th>
- <th></th>
- </tr>
- </thead>
<tbody>
- <%= render @traces unless @traces.nil? %>
+ <%= render @traces %>
</tbody>
</table>
- <%= 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 %>
- <h4><%= t ".empty_html", :upload_link => new_trace_path %></h4>
+ <h2><%= t ".empty_title" %></h2>
+ <p><%= 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")) %></p>
<% end %>