diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f07b8bfa4a1..f6e422959ba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -94,7 +94,11 @@ def insert_extras(body) # we should move this to the Node model: def render_map(lat, lon) - render partial: 'map/leaflet', locals: { lat: lat, lon: lon } + render partial: 'map/leaflet', locals: { lat: lat, lon: lon, top_map: false } + end + + def render_top_map(lat, lon) + render partial: 'map/leaflet', locals: { lat: lat, lon: lon, top_map: true } end # we should move this to the Comment model: diff --git a/app/models/node.rb b/app/models/node.rb index 5a6bed732a1..a4a8068391e 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -436,7 +436,7 @@ def location_tags end end - # accests a tagname /or/ tagname ending in wildcard such as "tagnam*" + # access a tagname /or/ tagname ending in wildcard such as "tagnam*" # also searches for other tags whose parent field matches given tagname, # but not tags matching given tag's parent field def has_tag(tagname) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 247dd24ef3e..104d4ceb403 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -106,7 +106,7 @@
<%= render :partial => 'layouts/header' %> - +Share your own location on your profile.
<% end %> - + + \ No newline at end of file diff --git a/app/views/sidebar/_related.html.erb b/app/views/sidebar/_related.html.erb index 55616bcf2ad..e3c8f3fe37c 100644 --- a/app/views/sidebar/_related.html.erb +++ b/app/views/sidebar/_related.html.erb @@ -44,7 +44,9 @@ <% if @node && @node.has_power_tag('response') %> <%= render partial: 'sidebar/notes', locals: { notes: @node.responses, title: I18n.t('sidebar._related.responses_to_note'), node: @node } %> <% end %> - <% if @node && !@node.has_power_tag('place') && @node.lat && @node.lon %> + <% if @node && @node.has_tag("place") && @node.lat && @node.lon %> + <%= render_top_map(@node.lat, @node.lon) %> + <% elsif @node && @node.lat && @node.lon %> <%= render_map(@node.lat, @node.lon) %> <% elsif @node&.has_power_tag('place') && !@node.lat && !@node.lon %>