]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/_map.html.erb
Remove unused stylesheet rules
[rails.git] / app / views / browse / _map.html.erb
1 <iframe id="linkloader" style="display: none">
2 </iframe>
3
4 <div id="browse_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          :lon  => 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   <% if map.instance_of? Note -%>
41     <%= link_to t("browse.map.larger.area"),
42                 root_path(:note => "yes"),
43                 :id => "area_larger_map",
44                 :class => "geolink bbox" %>
45   <% else -%>
46     <%= link_to t("browse.map.larger.area"),
47                 root_path(:box => "yes"),
48                 :id => "area_larger_map",
49                 :class => "geolink bbox" %>
50   <% end -%>
51   <br />
52   <%= link_to h(t("browse.map.edit.area")) + content_tag(:span, "▾", :class => "menuicon"),
53               edit_path,
54               :id => "area_edit",
55               :data => { :editor => preferred_editor },
56               :class => "geolink bbox" %>
57
58   <% unless map.instance_of? Changeset or map.instance_of? Note %>
59     <br />
60     <%= link_to t("browse.map.larger." + map.class.to_s.downcase),
61                 root_path,
62                 :id => "object_larger_map",
63                 :class => "geolink object" %>
64     <br />
65     <%= link_to h(t("browse.map.edit." + map.class.to_s.downcase)) + content_tag(:span, "▾", :class => "menuicon"),
66                 edit_path,
67                 :id => "object_edit",
68                 :data => { :editor => preferred_editor },
69                 :class => "geolink object" %>
70   <% end %>
71
72   <% else %>
73     <%= t 'browse.map.deleted' %>
74   <% end %>
75 </div>
76
77 <div id="area_edit_menu" class="menu">
78   <ul>
79     <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
80       <li><%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
81                       edit_path(:editor => editor),
82                       :data => {:editor => editor},
83                       :class => "geolink bbox" %></li>
84     <% end %>
85   </ul>
86 </div>
87
88 <div id="object_edit_menu" class="menu">
89   <ul>
90     <% Editors::RECOMMENDED_EDITORS.each do |editor| %>
91       <li><%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
92                       edit_path(:editor => editor),
93                       :data => {:editor => editor},
94                       :class => "geolink object" %></li>
95     <% end %>
96   </ul>
97 </div>