]> git.openstreetmap.org Git - rails.git/blob - app/views/notes/show.html.erb
Tweak sizes and alignment of traces rss/upload buttons
[rails.git] / app / views / notes / show.html.erb
1 <% set_title(t(".title", :id => @note.id)) %>
2
3 <%= render "sidebar_header", :title => t(".#{@note.status}_title", :note_name => @note.id) %>
4
5 <div>
6   <h4><%= t(".description") %></h4>
7   <div class="note-description">
8     <%= h(@note_comments.first.body.to_html) %>
9   </div>
10
11   <div class="details" data-coordinates="<%= @note.lat %>,<%= @note.lon %>" data-status="<%= @note.status %>">
12     <ul class="list-unstyled">
13       <li><%= note_event("opened", @note.created_at, @note.author) %></li>
14       <% if @note.status == "closed" %>
15         <li><%= note_event(@note.status, @note.closed_at, @note.all_comments.last.author) %></li>
16       <% end %>
17       <li>
18         <%= t "browse.location" %>
19         <%= link_to(t(".coordinates_html",
20                       :latitude => tag.span(number_with_delimiter(@note.lat), :class => "latitude"),
21                       :longitude => tag.span(number_with_delimiter(@note.lon), :class => "longitude")),
22                     root_path(:anchor => "map=18/#{@note.lat}/#{@note.lon}")) %>
23       </li>
24     </ul>
25   </div>
26
27   <% if @note_comments.find { |comment| comment.author.nil? } -%>
28     <p class='alert alert-warning'><%= t ".anonymous_warning" %></p>
29   <% end -%>
30
31   <% if @note_comments.length > 1 %>
32     <div class='note-comments'>
33       <ul class="list-unstyled">
34         <% @note_comments.drop(1).each do |comment| %>
35           <li id="c<%= comment.id %>">
36             <small class='text-muted'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
37             <%= comment.body.to_html %>
38           </li>
39         <% end %>
40       </ul>
41     </div>
42   <% end %>
43
44   <% if @note.status == "open" %>
45     <% if current_user -%>
46       <form class="mb-3" action="#">
47         <div class="mb-3">
48           <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
49         </div>
50         <div class="btn-wrapper">
51           <% if current_user.moderator? -%>
52             <%= submit_tag t(".hide"), :name => "hide", :class => "btn btn-light",
53                                        :data => { :method => "DELETE",
54                                                   :url => api_note_url(@note, "json") } %>
55           <% end -%>
56           <%= submit_tag t(".resolve"), :name => "close", :class => "btn btn-primary",
57                                         :data => { :method => "POST",
58                                                    :url => close_api_note_url(@note, "json"),
59                                                    :default_action_text => t(".resolve"),
60                                                    :comment_action_text => t(".comment_and_resolve") } %>
61           <%= submit_tag t(".comment"), :name => "comment", :class => "btn btn-primary", :disabled => true,
62                                         :data => { :method => "POST",
63                                                    :url => comment_api_note_url(@note, "json") } %>
64         </div>
65       </form>
66     <% end -%>
67   <% else %>
68     <form class="mb-3" action="#">
69       <input type="hidden" name="text" value="" autocomplete="off">
70       <div class="btn-wrapper">
71         <% if @note.status != "hidden" and current_user and current_user.moderator? -%>
72           <input type="submit" name="hide" value="<%= t(".hide") %>" class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>">
73         <% end -%>
74         <% if current_user -%>
75           <input type="submit" name="reopen" value="<%= t(".reactivate") %>" class="btn btn-primary" data-method="POST" data-url="<%= reopen_api_note_url(@note, "json") %>">
76         <% end -%>
77       </div>
78     </form>
79   <% end %>
80
81   <% if current_user && current_user != @note.author %>
82     <p>
83       <small class="text-muted">
84         <%= t ".report_link_html", :link => report_link(t(".report"), @note) %>
85         <% if @note.status == "open" %>
86           <%= t ".other_problems_resolve", :link => report_link(t(".report"), @note) %>
87         <% elsif @note.status == "closed" %>
88           <%= t ".other_problems_resolved" %>
89         <% end %>
90       </small>
91     </p>
92   <% end %>
93
94   <% if @note.freshly_closed? %>
95     <small class="text-muted">
96       <%= t ".disappear_date_html", :disappear_in => disappear_in(@note) %>
97     </small>
98   <% end %>
99 </div>