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 <%= h(@note_comments.first.body.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_comments.find { |comment| comment.author.nil? } -%>
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 <% if @note_comments.length > 1 %>
56 <div class='note-comments'>
57 <ul class="list-unstyled">
58 <% @note_comments.drop(1).each do |comment| %>
59 <li id="c<%= comment.id %>">
60 <small class='text-body-secondary'><%= note_event(comment.event, comment.created_at, comment.author) %></small>
62 <%= comment.body.to_html %>
70 <% if @note.status == "open" %>
71 <% if current_user -%>
72 <form class="mb-3" action="#">
74 <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
76 <div id="comment-error" class="alert alert-danger p-2 mb-3" hidden>
78 <div class="d-flex flex-wrap gap-1">
79 <% if current_user.moderator? -%>
80 <%= button_tag t(".hide"), :name => "hide", :class => "btn btn-light",
81 :data => { :method => "DELETE",
82 :url => api_note_url(@note, "json") } %>
84 <%= button_tag t(".resolve"), :name => "close", :class => "btn btn-primary",
85 :data => { :method => "POST",
86 :url => close_api_note_url(@note, "json"),
87 :default_action_text => t(".resolve"),
88 :comment_action_text => t(".comment_and_resolve") } %>
89 <%= button_tag t(".comment"), :name => "comment", :class => "btn btn-primary", :disabled => true,
90 :data => { :method => "POST",
91 :url => comment_api_note_url(@note, "json") } %>
96 <%= link_to t(".log_in_to_comment"), login_path(:referer => request.fullpath) %>
100 <form class="mb-3" action="#">
101 <input type="hidden" name="text" value="" autocomplete="off">
102 <div id="comment-error" class="alert alert-danger p-2 mb-3" hidden>
104 <div class="d-flex flex-wrap gap-1">
105 <% if @note.status != "hidden" and current_user and current_user.moderator? -%>
106 <%= button_tag t(".hide"), :name => "hide", :class => "btn btn-light",
107 :data => { :method => "DELETE",
108 :url => api_note_url(@note, "json") } %>
110 <% if current_user -%>
111 <%= button_tag t(".reactivate"), :name => "reopen", :class => "btn btn-primary",
112 :data => { :method => "POST",
113 :url => reopen_api_note_url(@note, "json") } %>
119 <% if current_user && current_user != @note.author %>
121 <small class="text-body-secondary">
122 <%= t ".report_link_html", :link => report_link(t(".report"), @note) %>
123 <% if @note.status == "open" %>
124 <%= t ".other_problems_resolve", :link => report_link(t(".report"), @note) %>
125 <% elsif @note.status == "closed" %>
126 <%= t ".other_problems_resolved" %>
132 <% if @note.freshly_closed? %>
133 <small class="text-body-secondary">
134 <%= t ".disappear_date_html", :disappear_in => friendly_date(@note.freshly_closed_until) %>