]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/note.html.erb
Improve notes template
[rails.git] / app / views / browse / note.html.erb
1 <div class='browse-section header'>
2   <h2><%= t "browse.note.#{@note.status}_title", :note_name => @note.id %></h2>
3   <span>
4     <%= t "browse.note.opened" %>: 
5     <abbr><%= note_event(@note.created_at, @note.author) %></abbr> by 
6     <% if @note.author.nil? %>
7       <%= t "browse.note.anonymous" %>
8     <% else %>
9       <%= note_author(@note.author) %>
10     <% end %>
11     <% if @note.status == "closed" %>
12       </span><span>
13       <%= t "browse.note.closed" %>:
14       <abbr><%= note_event(@note.closed_at, @note.author) %></abbr> by 
15       <%= @note.comments.last.author %>
16     <% end %>
17   </span>
18 </div>
19
20 <% if @note.comments.find { |comment| comment.author.nil? } -%>
21 <div class='browse-section common'>
22   <p class='warning'><%= t "javascripts.notes.show.anonymous_warning" %></p>
23 </div>
24 <% end -%>
25
26 <div class='browse-section common'>
27   <% if @note.status == "closed" %>
28     <div class='browse-field'>
29       <h4><%= t "browse.note.closed" %></h4>
30       <p><%= note_event(@note.closed_at, @note.comments.last.author) %></p>
31     </div>
32   <% elsif @note.comments.length > 1 %>
33     <div class='browse-field'>
34       <h4><%= t "browse.note.last_modified" %></h4>
35       <p><%= note_event(@note.updated_at, @note.comments.last.author) %></p>
36     </div>
37   <% end %>
38
39   <div class='browse-field' id="c<%= @note.comments.first.id %>">
40     <h4><%= t "browse.note.description" %></h4>
41     <%= h(@note.comments.first.body.to_html) %>
42     <!-- this provides it's own <p> tags -->
43   </div>
44
45   <div class='browse-field'>
46     <h4><%= t "browse.node_details.coordinates" %></h4>
47     <p class='geo'><%= link_to ("<span class='latitude'>#{number_with_delimiter(@note.lat)}</span>, <span class='longitude'>#{number_with_delimiter(@note.lon)}</span>".html_safe), {:controller => 'site', :action => 'index', :lat => h(@note.lat), :lon => h(@note.lon), :zoom => "18"} %></p>
48   </div>
49 </div>
50
51 <% if @note.comments.length > 1 %>
52   <div class='browse-section clearfix note-comments'>
53     <h4><%= t "browse.note.comments" %></h4>
54     <ul>
55       <% @note.comments[1..-1].each do |comment| %>
56         <li id="c<%= comment.id %>">
57           <%= comment.body.to_html %>
58           <small class='deemphasize'><%= note_event(comment.created_at, comment.author) %></small>
59         </li>
60       <% end %>
61     </ul>
62   </div>
63 <% end %>