]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/browse/note.html.erb
Rename api_notes resource to avoid conflict with non-API resource
[rails.git] / app / views / browse / note.html.erb
index 0180e26cad8d84103558354ee9a76f1163823116..3373b0b6dada316b82248f9d4d2f0bd0a4094f86 100644 (file)
     <p class='alert alert-warning'><%= t "javascripts.notes.show.anonymous_warning" %></p>
   <% end -%>
 
     <p class='alert alert-warning'><%= t "javascripts.notes.show.anonymous_warning" %></p>
   <% end -%>
 
-  <% if current_user && current_user != @note.author %>
-    <p class="text-muted"><%= report_link(t(".report"), @note) %></p>
-  <% end %>
-
   <% if @note_comments.length > 1 %>
     <div class='note-comments'>
       <ul class="list-unstyled">
   <% if @note_comments.length > 1 %>
     <div class='note-comments'>
       <ul class="list-unstyled">
 
   <% if @note.status == "open" %>
     <% if current_user -%>
 
   <% if @note.status == "open" %>
     <% if current_user -%>
-      <form action="#">
-        <div class="form-group">
+      <form class="mb-3" action="#">
+        <div class="mb-3">
           <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
         </div>
         <div class="btn-wrapper">
           <% if current_user.moderator? -%>
           <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
         </div>
         <div class="btn-wrapper">
           <% if current_user.moderator? -%>
-            <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
+            <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>">
           <% end -%>
           <% end -%>
-          <input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, "json") %>">
-          <input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, "json") %>" disabled="1">
+          <input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" class="btn btn-primary" data-method="POST" data-url="<%= close_api_note_url(@note, "json") %>">
+          <input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" class="btn btn-primary" data-method="POST" data-url="<%= comment_api_note_url(@note, "json") %>" disabled="1">
         </div>
       </form>
     <% end -%>
   <% else %>
         </div>
       </form>
     <% end -%>
   <% else %>
-    <form action="#">
-      <input type="hidden" name="text" value="">
+    <form class="mb-3" action="#">
+      <input type="hidden" name="text" value="" autocomplete="off">
       <div class="btn-wrapper">
       <div class="btn-wrapper">
-        <% if current_user and current_user.moderator? -%>
-          <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
+        <% if @note.status != "hidden" and current_user and current_user.moderator? -%>
+          <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>">
         <% end -%>
         <% if current_user -%>
         <% end -%>
         <% if current_user -%>
-          <input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, "json") %>">
+          <input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" class="btn btn-primary" data-method="POST" data-url="<%= reopen_api_note_url(@note, "json") %>">
         <% end -%>
       </div>
     </form>
   <% end %>
         <% end -%>
       </div>
     </form>
   <% end %>
+
+  <% if current_user && current_user != @note.author %>
+    <p>
+      <small class="text-muted">
+        <%= 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 %>
+      </small>
+    </p>
+  <% end %>
+
+  <% if @note.freshly_closed? %>
+    <small class="text-muted">
+      <%= t "javascripts.notes.show.disappear_date_html", :disappear_in => disappear_in(@note) %>
+    </small>
+  <% end %>
 </div>
 </div>