]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/_map.html.erb
Make titles in note popups link to the note
[rails.git] / app / views / browse / _map.html.erb
1 <iframe id="linkloader" style="display: none">
2 </iframe>
3
4 <div id="browse_map" class='clearfix content_map'>
5   <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %>
6
7   <% content_for :head do %>
8     <%= javascript_include_tag "browse" %>
9   <% end %>
10
11   <%
12      if map.instance_of? Changeset
13        bbox = map.bbox.to_unscaled
14        data = {
15          :type   => "changeset",
16          :id     => map.id,
17          :minlon => bbox.min_lon,
18          :minlat => bbox.min_lat,
19          :maxlon => bbox.max_lon,
20          :maxlat => bbox.max_lat
21        }
22      elsif map.instance_of? Note
23        data = {
24          :type => "note",
25          :lon  => map.lon,
26          :lat  => map.lat
27        }
28      else
29        data = {
30          :type    => map.class.name.downcase,
31          :id      => map.id,
32          :version => map.version,
33          :visible => map.visible
34        }
35      end
36   %>
37   <%= content_tag "div", "", :id => "small_map", :data => data %>
38   <span id="loading"><%= t 'browse.map.loading' %></span>
39
40 <ul class='secondary-actions clearfix'>
41   <li>
42     <% if map.instance_of? Note -%>
43       <%= link_to t("browse.map.larger.area"),
44                   root_path(:notes => "yes"),
45                   :id => "area_larger_map",
46                   :class => "geolink bbox" %>
47     <% else -%>
48       <%= link_to t("browse.map.larger.area"),
49                   root_path(:box => "yes"),
50                   :id => "area_larger_map",
51                   :class => "geolink bbox" %>
52     <% end -%>
53   </li>
54   <li>
55     <%= link_to h(t("browse.map.edit.area")) + content_tag(:span, "▼", :class => "menuicon"),
56                 edit_path,
57                 :id => "area_edit",
58                 :data => { :editor => preferred_editor },
59                 :class => "geolink bbox" %>
60   </li>
61 </ul>
62
63   <% unless map.instance_of? Changeset or map.instance_of? Note %>
64   <ul class='secondary-actions clearfix'>
65     <li>
66       <%= link_to t("browse.map.larger." + map.class.to_s.downcase),
67                   root_path,
68                   :id => "object_larger_map",
69                   :class => "geolink object" %>
70     </li>
71     <li>
72       <%= link_to h(t("browse.map.edit." + map.class.to_s.downcase)) + content_tag(:span, "▼", :class => "menuicon"),
73                   edit_path,
74                   :id => "object_edit",
75                   :data => { :editor => preferred_editor },
76                   :class => "geolink object" %>
77     </li>
78   </ul>
79   <% end %>
80
81   <% else %>
82     <%= t 'browse.map.deleted' %>
83   <% end %>
84 </div>
85
86 <div id="area_edit_menu" class="menu">
87   <ul>
88     <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
89       <li><%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
90                       edit_path(:editor => editor),
91                       :data => {:editor => editor},
92                       :class => "geolink bbox" %></li>
93     <% end %>
94   </ul>
95 </div>
96
97 <div id="object_edit_menu" class="menu">
98   <ul>
99     <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
100       <li><%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
101                       edit_path(:editor => editor),
102                       :data => {:editor => editor},
103                       :class => "geolink object" %></li>
104     <% end %>
105   </ul>
106 </div>