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