Remove the map_marker partial, which is no longer useful.

Akinori MUSHA 10 anos atrás
pai
commit
d22cad0327

+ 5 - 2
app/views/agents/agent_views/user_location_agent/_show.html.erb

@@ -1,4 +1,7 @@
1
-<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
1
+<% content_for :head do -%>
2
+<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?sensor=false" %>
3
+<%= javascript_include_tag "map_marker" %>
4
+<% end -%>
2 5
 
3 6
 <h3>Recent Event Map</h3>
4 7
 
@@ -15,7 +18,7 @@
15 18
 
16 19
     var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
17 20
     <% events.each do |event| %>
18
-      <%= render "shared/map_marker", map: 'map', location: event.location %>
21
+    map_marker(map, <%= Utils.jsonify(event.location) %>);
19 22
     <% end %>
20 23
   </script>
21 24
 <% else %>

+ 5 - 2
app/views/events/show.html.erb

@@ -16,7 +16,10 @@
16 16
       </p>
17 17
 
18 18
       <% if @event.lat && @event.lng %>
19
-        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
19
+        <% content_for :head do -%>
20
+<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?sensor=false" %>
21
+<%= javascript_include_tag "map_marker" %>
22
+        <% end -%>
20 23
 
21 24
         <p>
22 25
           <b>Lat:</b>
@@ -37,7 +40,7 @@
37 40
 
38 41
           var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
39 42
 
40
-          <%= render "shared/map_marker", map: 'map', location: @event.location %>
43
+          map_marker(map, <%= Utils.jsonify(@event.location) %>);
41 44
         </script>
42 45
       <% end %>
43 46
 

+ 0 - 7
app/views/shared/_map_marker.html.erb

@@ -1,7 +0,0 @@
1
-<%- unless @map_marker_included_p -%>
2
-<%- content_for :head do -%>
3
-<%= javascript_include_tag "map_marker" %>
4
-<%- end -%>
5
-<%- @map_marker_included_p = true -%>
6
-<%- end -%>
7
-map_marker(<%= map %>, <%= Utils.jsonify(location) %>)