]> git.openstreetmap.org Git - rails.git/blob - app/views/traces/show.html.erb
Merge remote-tracking branch 'upstream/pull/4747'
[rails.git] / app / views / traces / show.html.erb
1 <% content_for :heading do %>
2   <h1><%= t ".heading", :name => @trace.name %></h1>
3 <% end %>
4
5 <% if Settings.status != "gpx_offline" %>
6   <% if @trace.inserted %>
7     <%= image_tag trace_picture_path(@trace.user, @trace), :class => "trace_image" %>
8   <% else %>
9     <span class="text-danger"><%= t ".pending" %></span>
10   <% end %>
11 <% end %>
12
13 <table class="table table-borderless table-sm">
14   <tr>
15     <th><%= t ".filename" %></th>
16     <td><%= @trace.name %> (<%= link_to t(".download"), trace_data_path(@trace) %>)</td>
17   </tr>
18   <tr>
19     <th><%= t ".uploaded" %></th>
20     <td><%= l @trace.timestamp, :format => :friendly %></td>
21   </tr>
22   <% if @trace.inserted? %>
23   <tr>
24     <th><%= t ".points" %></th>
25     <td><%= number_with_delimiter(@trace.size) %></td></tr>
26   <tr>
27     <th><%= t ".start_coordinates" %></th>
28     <td>
29       <div class="d-inline">
30         <%= t ".coordinates_html",
31               :latitude => tag.span(number_with_delimiter(@trace.latitude), :class => "latitude"),
32               :longitude => tag.span(number_with_delimiter(@trace.longitude), :class => "longitude") %>
33       </div>
34       (<%= link_to t(".map"), root_path(:mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}") %> / <%= link_to t(".edit"), edit_path(:gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}") %>)</td>
35   </tr>
36   <% end %>
37   <tr>
38     <th><%= t ".owner" %></th>
39     <td><%= link_to @trace.user.display_name, @trace.user %></td>
40   </tr>
41   <tr>
42     <th><%= t ".description" %></th>
43     <td><%= @trace.description %></td>
44   </tr>
45   <tr>
46     <th><%= t ".tags" %></th>
47     <td>
48     <% unless @trace.tags.empty? %>
49       <%= safe_join(@trace.tags.collect { |tag| link_to tag.tag, :controller => "traces", :action => "index", :tag => tag.tag, :id => nil }, ", ") %>
50     <% else %>
51       <i><%= t ".none" %></i>
52     <% end %>
53     </td>
54   </tr>
55   <tr>
56     <th><%= t ".visibility" %></th>
57     <td><%= t "traces.visibility.#{@trace.visibility}" %></td>
58   </tr>
59 </table>
60
61 <% if current_user && (current_user==@trace.user || current_user.administrator? || current_user.moderator?) %>
62   <div>
63     <% if current_user == @trace.user %>
64       <%= link_to t(".edit_trace"), edit_trace_path(@trace), :class => "btn btn-outline-primary" %>
65     <% end %>
66     <%= link_to t(".delete_trace"), @trace, { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
67   </div>
68 <% end %>