]> git.openstreetmap.org Git - rails.git/blob - app/views/traces/index.html.erb
Use start margin instead of empty <li> for gap before traces rss button
[rails.git] / app / views / traces / index.html.erb
1 <% content_for :heading_class, "pb-0" %>
2 <% content_for :heading do %>
3   <h1><%= @title %></h1>
4   <nav class="secondary-actions mb-3">
5     <ul>
6       <li>
7         <%= t(".description") %>
8       </li>
9       <% if params[:tag] %>
10         <li>
11           <%= link_to t(".remove_tag_filter", :tag => params[:tag]), { :controller => "traces", :action => "index", :tag => nil } %>
12         </li>
13       <% end %>
14     </ul>
15   </nav>
16   <ul class="nav nav-tabs flex-column flex-sm-row">
17     <% if @target_user.blank? %>
18       <!-- public traces -->
19       <li class="nav-item">
20         <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link active" } %>
21       </li>
22       <% if current_user %>
23         <li class="nav-item">
24           <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
25         </li>
26       <% end %>
27     <% elsif current_user && current_user == @target_user %>
28       <li class="nav-item">
29         <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
30       </li>
31       <!-- my traces -->
32       <li class="nav-item">
33         <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link active" } %>
34       </li>
35     <% else %>
36       <!-- public_traces_from @target_user -->
37       <li class="nav-item">
38         <%= link_to t(".all_traces"), { :controller => "traces", :action => "index", :display_name => nil }, { :class => "nav-link" } %>
39       </li>
40       <% if current_user && current_user != @target_user %>
41         <li class="nav-item">
42           <%= link_to t(".my_traces"), { :action => "mine" }, { :class => "nav-link" } %>
43         </li>
44       <% end %>
45       <li class="nav-item">
46         <%= link_to t(".public_traces_from", :user => @target_user&.display_name), { :action => "mine" }, { :class => "nav-link active" } %>
47       </li>
48     <% end %>
49
50     <li class="nav-item ms-auto">
51       <div class="ps-3 py-2 py-sm-0">
52         <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm" }) do %>
53           <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="white" viewBox="0 0 16 16">
54             <path d="M5.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-3-8.5a1 1 0 0 1 1-1c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1 6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1-1-1z" />
55           </svg>
56         <% end -%>
57         <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm" %>
58       </div>
59     </li>
60   </ul>
61 <% end %>
62
63 <% content_for :auto_discovery_link_tag do %>
64   <%= auto_discovery_link_tag :rss, :action => "georss", :display_name => @target_user&.display_name, :tag => params[:tag] %>
65 <% end %>
66
67 <% if @traces.size > 0 %>
68   <%= render "shared/pagination",
69              :newer_key => "traces.trace_paging_nav.newer",
70              :older_key => "traces.trace_paging_nav.older",
71              :newer_id => @newer_traces && @traces.first.id,
72              :older_id => @older_traces && @traces.last.id %>
73
74   <table id="trace_list" class="table table-borderless table-striped">
75     <tbody>
76       <%= render @traces %>
77     </tbody>
78   </table>
79
80   <%= render "shared/pagination",
81              :newer_key => "traces.trace_paging_nav.newer",
82              :older_key => "traces.trace_paging_nav.older",
83              :newer_id => @newer_traces && @traces.first.id,
84              :older_id => @older_traces && @traces.last.id %>
85 <% else %>
86   <h2><%= t ".empty_title" %></h2>
87   <p><%= t ".empty_upload_html", :upload_link => link_to(t(".upload_new"), new_trace_path),
88                                  :wiki_link => link_to(t(".wiki_page"), t(".wiki_page_url")) %></p>
89 <% end %>