From 46583d09fedab26d2cae1ae5995b6ede890760d2 Mon Sep 17 00:00:00 2001 From: Ollie Bennett Date: Sun, 5 May 2024 06:20:26 +0100 Subject: [PATCH] Add links to shademap --- app/views/homes/_link_icons.html.erb | 11 ++++++++--- app/views/homes/show.html.erb | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/homes/_link_icons.html.erb b/app/views/homes/_link_icons.html.erb index 99e8b2e6..e0cfd229 100644 --- a/app/views/homes/_link_icons.html.erb +++ b/app/views/homes/_link_icons.html.erb @@ -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 %> diff --git a/app/views/homes/show.html.erb b/app/views/homes/show.html.erb index d69a1ddb..efc5ffcb 100644 --- a/app/views/homes/show.html.erb +++ b/app/views/homes/show.html.erb @@ -47,7 +47,7 @@

<%= @home.price_display %>

- <%= render 'link_icons', home: @home %> + <%= render 'link_icons', home: @home, verbose: true %>