]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/note.html.erb
Fix display of browsed objects on map
[rails.git] / app / views / browse / note.html.erb
1 <% content_for :head do %>
2   <%= stylesheet_link_tag 'browse' %>
3   <%= javascript_include_tag 'index' %>
4 <% end %>
5
6 <% content_for :sidebar do %>
7   <h2><%= t "browse.note.#{@note.status}_title", :note_name => @note.id %></h2>
8
9   <% if @note.comments.find { |comment| comment.author.nil? } -%>
10   <div class='browse-section common'>
11     <p class="warning"><%= t "javascripts.notes.show.anonymous_warning" %></p>
12   </div>
13   <% end -%>
14
15   <div class='browse-section common'>
16     <div class='browse-field'>
17       <h4><%= t "browse.note.opened" %></h4>
18       <p><%= note_event(@note.created_at, @note.author) %></p>
19     </div>
20
21     <% if @note.status == "closed" %>
22       <div class='browse-field'>
23         <h4><%= t "browse.note.closed" %></h4>
24         <p><%= note_event(@note.closed_at, @note.comments.last.author) %></p>
25       </div>
26     <% elsif @note.comments.length > 1 %>
27       <div class='browse-field'>
28         <h4><%= t "browse.note.last_modified" %></h4>
29         <p><%= note_event(@note.updated_at, @note.comments.last.author) %></p>
30       </div>
31     <% end %>
32
33     <div class='browse-field' id="c<%= @note.comments.first.id %>">
34       <h4><%= t "browse.note.description" %></h4>
35       <p><%= h(@note.comments.first.body.to_html) %></p>
36     </div>
37
38     <div class='browse-field'>
39       <h4><%= t "browse.node_details.coordinates" %></h4>
40       <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>
41     </div>
42   </div>
43
44   <% if @note.comments.length > 1 %>
45     <div class='browse-section clearfix'>
46       <h4><%= t "browse.note.comments" %></h4>
47       <ul>
48         <% @note.comments[1..-1].each do |comment| %>
49           <li id="c<%= comment.id %>">
50             <%= comment.body.to_html %>
51             <small class="deemphasize"><%= note_event(comment.created_at, comment.author) %></small>
52           </li>
53         <% end %>
54       </ul>
55     </div>
56   <% end %>
57 <% end %>
58
59 <%= render :template => 'layouts/map' %>