diff --git a/app/helpers/weather_arts_helper.rb b/app/helpers/weather_arts_helper.rb index 6643a83..ca52218 100644 --- a/app/helpers/weather_arts_helper.rb +++ b/app/helpers/weather_arts_helper.rb @@ -1,2 +1,51 @@ module WeatherArtsHelper + def weather_description_icon(description) + case description&.downcase + when /rain/ + ''.html_safe + when /cloud/ + ''.html_safe + when /sun|clear/ + ''.html_safe + else + ''.html_safe + end + end + def weather_stat_icon(type) + case type + when "temperature" + ''.html_safe + when "wind" + ''.html_safe + when "humidity" + ''.html_safe + when "visibility" + ''.html_safe + when "pressure" + ''.html_safe + when "cloud" + ''.html_safe + end + end end diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index c3b1f80..f4d5437 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -1,37 +1,53 @@ -
+ <%= @city.country.name %>, <%= @city.region %> + • + <%= Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") %> +
+- <%= @weather_art.weather_date.strftime("%B %d, %Y") %> -
-<%= @weather_art.prompt %>
++ <%= @weather_art.prompt %> +
+