X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/81a6c7b7bebb06c2e9711451e6795f65b34d59ca..f7367baa6b6091df3eabbe8b7a4b99e3fa314743:/app/views/browse/note.html.erb diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index 59c96c4aa..3373b0b6d 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -1,58 +1,91 @@ -<%= render :partial => "navigation" %> - -

- <%= image_tag "#{@note.status}_note_marker.png", :alt => @note.status %> - <%= t "browse.note.#{@note.status}_title", :note_name => @note.id %> -

- -<%= render :partial => "map", :object => @note %> - - - - - - - - - <% if @note.status == "closed" %> - - - - - <% elsif @note.comments.length > 1 %> - - - - +<% set_title(t(".title", :id => @note.id)) %> + +<%= render "sidebar_header", :title => t(".#{@note.status}_title", :note_name => @note.id) %> + +
+

<%= t(".description") %>

+
+ <%= h(@note_comments.first.body.to_html) %> +
+ +
+ +
+ + <% if @note_comments.find { |comment| comment.author.nil? } -%> +

<%= t "javascripts.notes.show.anonymous_warning" %>

+ <% end -%> + + <% if @note_comments.length > 1 %> +
+ +
+ <% end %> + + <% if @note.status == "open" %> + <% if current_user -%> +
+
+ +
+
+ <% if current_user.moderator? -%> + " class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>"> + <% end -%> + " class="btn btn-primary" data-method="POST" data-url="<%= close_api_note_url(@note, "json") %>"> + " class="btn btn-primary" data-method="POST" data-url="<%= comment_api_note_url(@note, "json") %>" disabled="1"> +
+ + <% end -%> + <% else %> +
+ +
+ <% if @note.status != "hidden" and current_user and current_user.moderator? -%> + " class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>"> + <% end -%> + <% if current_user -%> + " class="btn btn-primary" data-method="POST" data-url="<%= reopen_api_note_url(@note, "json") %>"> + <% end -%> +
+ <% end %> -
- - - - - - - - - - <% if @note.comments.length > 1 %> - - - - + <% if current_user && current_user != @note.author %> +

+ + <%= t "javascripts.notes.show.report_link_html", :link => report_link(t(".report"), @note) %> + <% if @note.status == "open" %> + <%= t "javascripts.notes.show.other_problems_resolve", :link => report_link(t(".report"), @note) %> + <% elsif @note.status == "closed" %> + <%= t "javascripts.notes.show.other_problems_resolved" %> + <% end %> + +

<% end %> -
<%= t "browse.note.opened" %><%= t "browse.note.at_by", :when => friendly_date(@note.created_at), :user => note_author(@note) %>
<%= t "browse.note.closed" %><%= t "browse.note.at_by", :when => friendly_date(@note.closed_at), :user => note_author(@note.comments.last) %>
<%= t "browse.note.last_modified" %><%= t "browse.note.at_by", :when => friendly_date(@note.updated_at), :user => note_author(@note.comments.last) %>
<%= t "browse.note.description" %><%= h(@note.comments.first.body) %>
<%= t "browse.node_details.coordinates" %>
<%= link_to ("#{number_with_delimiter(@note.lat)}, #{number_with_delimiter(@note.lon)}"), {:controller => 'site', :action => 'index', :lat => h(@note.lat), :lon => h(@note.lon), :zoom => "18"} %>
<%= t "browse.note.comments" %> - - <% @note.comments[1..-1].each do |comment| %> - - - - <% end %> -
- <%= h(comment.body) %> -
- <%= t "browse.note.at_by", :when => friendly_date(comment.created_at), :user => note_author(comment) %> -
-
+ <% if @note.freshly_closed? %> + + <%= t "javascripts.notes.show.disappear_date_html", :disappear_in => disappear_in(@note) %> + + <% end %> +