Skip to content

Commit

Permalink
Add links to shademap
Browse files Browse the repository at this point in the history
  • Loading branch information
olliebennett committed May 5, 2024
1 parent 2ed7044 commit 46583d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions app/views/homes/_link_icons.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<% verbose ||= false %>
<% if home.latitude.present? && home.longitude.present? %>
<%= link_to image_tag('external-icons/google-maps.svg', size: 30, alt: 'Google Maps'),
<%= link_to image_tag('external-icons/google-maps.svg', size: 30, alt: 'Google Maps', title: 'View location on Google Maps'),
"https://www.google.co.uk/maps/place/#{home.latitude},#{home.longitude}" %>
<% if verbose %>
<%= link_to image_tag('external-icons/shademap.png', size: 30, class: 'rounded', alt: 'Shademap', title: 'View sun position over time on Shademap'),
"https://shademap.app/@#{home.latitude},#{home.longitude},18z,#{Time.zone.now.to_i}000t" %>
<% end %>
<% end %>
<% if home.zoopla_url.present? %>
<%= link_to image_tag('external-icons/zoopla.png', size: 30, class: 'rounded', alt: 'Zoopla'),
<%= link_to image_tag('external-icons/zoopla.png', size: 30, class: 'rounded', alt: 'Zoopla', title: 'View property on Zoopla'),
home.zoopla_url %>
<% end %>
<% if home.rightmove_url.present? %>
<%= link_to image_tag('external-icons/rightmove.png', size: 30, class: 'rounded', alt: 'Rightmove'),
<%= link_to image_tag('external-icons/rightmove.png', size: 30, class: 'rounded', alt: 'Rightmove', title: 'View property on Rightmove'),
home.rightmove_url %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/homes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<h3><%= @home.price_display %></h3>
<p>
<%= render 'link_icons', home: @home %>
<%= render 'link_icons', home: @home, verbose: true %>
</p>
</div>
</div>
Expand Down

0 comments on commit 46583d0

Please sign in to comment.