-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create separate partial for sidebar map and add it in questions
- Loading branch information
1 parent
783fbe2
commit ae15db7
Showing
3 changed files
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<% if @node && @node.lat && @node.lon %> | ||
<% if @node.has_tag("place") %> | ||
<%= render_top_map(@node.lat, @node.lon, @node.zoom) %> | ||
<% else %> | ||
<%= render_map(@node.lat, @node.lon, @node.zoom) %> | ||
<% end %> | ||
<%# Link to map %> | ||
<% zoom = @node.zoom ? @node.zoom : "" %> | ||
<% url = "/map#" + zoom.to_s + "/" + @node.lat.to_s + "/" + @node.lon.to_s %> | ||
<% if @node.type == "page" %> | ||
<% url = "/map/" + @node.slug_from_path %> | ||
<% end %> | ||
<a href="<%= url %>" class="btn btn-outline-secondary btn-location mt-2"><i class="fa fa-map" aria-hidden="true"></i> View on a map</a> | ||
<% elsif !@node.lat && !@node.lon %> | ||
<div id="map_template" style="position: relative; display: inline-block;"> | ||
<a class="blurred-location-input btn btn-outline-secondary btn-lg btn-location my-2"><i class="fa fa-map-marker" style="color:#c40;" ></i> <strong>Add a location</strong></a> | ||
</div> | ||
<br> | ||
<span>Learn about location <a href="https://publiclab.org/location-privacy">privacy</a></span> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters