1 <% set_title(t(".title", :id => @note.id)) %>
 
   3 <%= render "sidebar_header", :title => t(".#{@note.status}_title", :note_name => @note.id) %>
 
   6   <h4><%= t(".description") %></h4>
 
   7   <div class="overflow-hidden ms-2">
 
   8     <%= note_description(@note.author, @note.description, current_user&.moderator? ? @note.comments.unscope(:where => :visible).first : @note.comments.first).to_html %>
 
  11   <div class="details" data-coordinates="<%= @note.lat %>,<%= @note.lon %>" data-status="<%= @note.status %>">
 
  12     <p class="mb-2"><%= note_event("opened", @note.created_at, @note.author) %></p>
 
  13     <% if @note.status == "closed" %>
 
  14       <p class="mb-2"><%= note_event(@note.status, @note.closed_at, @note.all_comments.last.author) %></p>
 
  17       <%= t "browse.location" %>
 
  18       <%= link_to t(".coordinates_html",
 
  19                     :latitude => tag.span(number_with_delimiter(@note.lat), :class => "latitude"),
 
  20                     :longitude => tag.span(number_with_delimiter(@note.lon), :class => "longitude")),
 
  21                   root_path(:anchor => "map=18/#{@note.lat}/#{@note.lon}") %>
 
  25   <% if @note_includes_anonymous -%>
 
  26     <p class='alert alert-warning'><%= t ".anonymous_warning" %></p>
 
  31       <h4><%= t(".discussion") %></h4>
 
  35       <div class="col-auto">
 
  36         <% if @note.subscribers.exists?(current_user.id) %>
 
  37           <%= tag.button t(".unsubscribe"),
 
  39                          :class => "btn btn-sm btn-primary",
 
  40                          :name => "unsubscribe",
 
  41                          :data => { :method => "DELETE",
 
  42                                     :url => api_note_subscription_path(@note) } %>
 
  44           <%= tag.button t(".subscribe"),
 
  46                          :class => "btn btn-sm btn-primary",
 
  48                          :data => { :method => "POST",
 
  49                                     :url => api_note_subscription_path(@note) } %>
 
  55   <% @note_comments.each do |comment| %>
 
  56     <article id="c<%= comment.id %>">
 
  57       <small class='text-body-secondary'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
 
  59         <%= comment.body.to_html %>
 
  64   <% if @note.status == "open" %>
 
  65     <% if current_user -%>
 
  66       <form class="mb-3" action="#">
 
  68           <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
 
  70         <div id="comment-error" class="alert alert-danger p-2 mb-3" hidden>
 
  72         <div class="d-flex flex-wrap gap-1">
 
  73           <% if current_user.moderator? -%>
 
  74             <%= button_tag t(".hide"), :name => "hide", :class => "btn btn-light",
 
  75                                        :data => { :method => "DELETE",
 
  76                                                   :url => api_note_url(@note, "json") } %>
 
  78           <%= button_tag t(".resolve"), :name => "close", :class => "btn btn-primary",
 
  79                                         :data => { :method => "POST",
 
  80                                                    :url => close_api_note_url(@note, "json"),
 
  81                                                    :default_action_text => t(".resolve"),
 
  82                                                    :comment_action_text => t(".comment_and_resolve") } %>
 
  83           <%= button_tag t(".comment"), :name => "comment", :class => "btn btn-primary", :disabled => true,
 
  84                                         :data => { :method => "POST",
 
  85                                                    :url => comment_api_note_url(@note, "json") } %>
 
  90         <%= link_to t(".log_in_to_comment"), login_path(:referer => request.fullpath) %>
 
  94     <form class="mb-3" action="#">
 
  95       <input type="hidden" name="text" value="" autocomplete="off">
 
  96       <div id="comment-error" class="alert alert-danger p-2 mb-3" hidden>
 
  98       <div class="d-flex flex-wrap gap-1">
 
  99         <% if @note.status != "hidden" and current_user and current_user.moderator? -%>
 
 100           <%= button_tag t(".hide"), :name => "hide", :class => "btn btn-light",
 
 101                                      :data => { :method => "DELETE",
 
 102                                                 :url => api_note_url(@note, "json") } %>
 
 104         <% if current_user -%>
 
 105           <%= button_tag t(".reactivate"), :name => "reopen", :class => "btn btn-primary",
 
 106                                            :data => { :method => "POST",
 
 107                                                       :url => reopen_api_note_url(@note, "json") } %>
 
 113   <% if current_user && current_user != @note.author %>
 
 115       <small class="text-body-secondary">
 
 116         <%= t ".report_link_html", :link => report_link(t(".report"), @note) %>
 
 117         <% if @note.status == "open" %>
 
 118           <%= t ".other_problems_resolve", :link => report_link(t(".report"), @note) %>
 
 119         <% elsif @note.status == "closed" %>
 
 120           <%= t ".other_problems_resolved" %>
 
 126   <% if @note.freshly_closed? %>
 
 127     <small class="text-body-secondary">
 
 128       <%= t ".disappear_date_html", :disappear_in => friendly_date(@note.freshly_closed_until) %>