]> git.openstreetmap.org Git - rails.git/blob - app/views/traces/index.html.erb
Adding information about Croatia sources
[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="nav-link pe-0">
52         <%= 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 %>
53           <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class="align-text-bottom">
54             <circle cx="2" cy="14" r="2" fill="white" />
55             <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" />
56           </svg><% end -%>
57         <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm my-n2 align-baseline border-0" %>
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 %>