-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathtools_places.html.erb
38 lines (29 loc) · 1.37 KB
/
tools_places.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<% if params[:action] == "places" %>
</div>
<div style="width:100%;margin-left:0;height:300px;" id="map"></div>
<script>
var map = L.map('map').setView([22,0], 2);
L.tileLayer("https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png",{
attribution: "<a href='http://openstreetmap.org'>OSM</a> tiles by <a href='http://mapbox.com'>MapBox</a>",
}).addTo(map)
<% @notes.each do |place| %>
<% if place.lat && place.lon %>L.marker([<%= place.lat %>, <%= place.lon %>]).addTo(map).bindPopup("<a href='<%= place.path %>'><%= place.latest.title %></a>");<% end %>
<% end %>
</script>
<br />
<div class="row">
<% end %>
<div class="col-lg-12">
<%= feature('places') %>
<hr />
<% if params[:controller] == "notes" && (params[:action] == "popular" || params[:action] == "index" || params[:action] == "liked") %>
<div class="navbar">
<ul class="navbar-nav">
<li class="nav-item <% if params[:action] == "methods" %> active <% end %>"><a class="nav-link" href="/methods/"><i class="fa fa-wrench"></i> <%= translation('notes.tools_places.tools') %></a></li>
<li class="nav-item <% if params[:action] == "places" %> active <% end %>"><a class="nav-link" href="/places/"><i class="fa fa-flag"></i> <%= translation('notes.tools_places.places') %></a></li>
</ul>
</div>
<% end %>
<%= render :partial => "notes/notes" %>
<hr />
</div>