cleanup markup with implied locale, absolute URL icon pointers

This commit is contained in:
Ryan Kulp
2025-05-22 00:24:49 -04:00
parent 6c073b3aaa
commit 32e6adb2e8
+19 -17
View File
@@ -2,7 +2,7 @@
<div class="layout layout--col gap--space-between">
<div class="grid">
<div class="row row--center col--span-3 col--end">
<img class="weather-image" style="filter: brightness(0.5) saturate(0%);" src="https://tempestwx.com/images/Updated/<%= weather_image %>.svg" />
<img class="weather-image" style="filter: brightness(0.5) saturate(0%);" src="<%= weather_image %>" />
</div>
<div class="col col--span-3 col--end">
<div class="item h--full">
@@ -10,7 +10,7 @@
<div class="content">
<span class="value value--xxxlarge" data-fit-value="true"><%= temperature&.round %>°</span>
<span class="label w--full">
<img style="max-height: 24px; vertical-align: middle" src="<%= Rails.application.credentials.base_url %>/images/weather/wi-sunrise.svg" />
<img style="max-height: 24px; vertical-align: middle" src="<%= Rails.application.credentials.base_url %>/images/plugins/weather/wi-sunrise.svg" />
<%= forecast[:right_now][:sunrise] %>
</span>
<span class="label w--full">
@@ -24,33 +24,33 @@
<div class="item">
<div class="meta"></div>
<div class="icon">
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/weather/wi-thermometer.svg" />
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/plugins/weather/wi-thermometer.svg" />
</div>
<div class="content">
<span class="value value--small"><%= feels_like&.round %>°</span>
<span class="label"><%= t('renders.weather.feels_like', locale:) %></span>
<span class="label"><%= t('renders.weather.feels_like') %></span>
</div>
</div>
<div class="item">
<div class="meta"></div>
<div class="icon">
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/weather/wi-raindrops.svg" />
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/plugins/weather/wi-raindrops.svg" />
</div>
<div class="content">
<span class="value value--small"><%= humidity %>%</span>
<span class="label"><%= t('renders.weather.humidity', locale:) %></span>
<span class="label"><%= t('renders.weather.humidity') %></span>
</div>
</div>
<div class="item">
<div class="meta"></div>
<div class="icon">
<img class="weather-icon" style="filter: brightness(0.5) saturate(0%);" src="https://tempestwx.com/images/Updated/<%= weather_image %>.svg" />
<img class="weather-icon" style="filter: brightness(0.5) saturate(0%);" src="<%= weather_image %>" />
</div>
<div class="content">
<span class="value value--xsmall"><%= conditions %></span>
<span class="label"><%= t('renders.weather.right_now', locale:) %></span>
<span class="label"><%= t('renders.weather.right_now') %></span>
</div>
</div>
</div>
@@ -65,11 +65,11 @@
<div class="item col--span-3">
<div class="meta"></div>
<div class="icon">
<img class="weather-icon" style="filter: brightness(0.5) saturate(0%);" src="https://tempestwx.com/images/Updated/<%= local_assigns["#{day}_weather_image".to_sym] %>.svg" />
<img class="weather-icon" style="filter: brightness(0.5) saturate(0%);" src="<%= local_assigns["#{day}_weather_image".to_sym] %>" />
</div>
<div class="content">
<span class="value value--xsmall"><%= forecast[day][:conditions] %></span>
<span class="label"><%= forecast[day][:day_override] || t("renders.weather.#{day.to_s}", locale:) %></span>
<span class="label"><%= forecast[day][:day_override] || t("renders.weather.#{day.to_s}") %></span>
</div>
</div>
@@ -79,12 +79,12 @@
<div class="row">
<div class="icon">
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/weather/wi-hot.svg" />
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/plugins/weather/wi-hot.svg" />
</div>
<div class="content w--14">
<span class="value value--xsmall"><%= forecast[day][:uv_index] %></span>
<span class="label"><%= t('renders.weather.uv', locale:) %></span>
<span class="label"><%= t('renders.weather.uv') %></span>
</div>
<div class="icon" style="margin-top: auto; margin-bottom: auto;">
@@ -94,7 +94,9 @@
<!-- justify-content is needed for 'tomorrow' precip amount/units, given they are always nil -->
<div class="content w--14" style="<%= 'justify-content: center' if day == :tomorrow %>">
<span class="value value--xsmall"><%= forecast[day][:precip][:probability] %>%</span>
<span class="label"><%= forecast[day][:precip][:amount] %> <%= forecast[day][:precip][:units] %></span>
<% if forecast[day][:precip][:amount].present? %>
<span class="label"><%= forecast[day][:precip][:amount] %> <%= forecast[day][:precip][:units] %></span>
<% end %>
</div>
</div>
</div>
@@ -104,16 +106,16 @@
<div class="item">
<div class="meta"></div>
<div class="icon">
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/weather/wi-thermometer.svg" />
<img class="weather-icon" src="<%= Rails.application.credentials.base_url %>/images/plugins/weather/wi-thermometer.svg" />
</div>
<div class="row">
<div class="content w--20">
<span class="value value--small"><%= forecast[day][:mintemp]&.round %>°</span>
<span class="label"><%= t('renders.weather.low', locale:) %></span>
<span class="label"><%= t('renders.weather.low') %></span>
</div>
<div class="content w--20">
<span class="value value--small"><%= forecast[day][:maxtemp]&.round %>°</span>
<span class="label"><%= t('renders.weather.high', locale:) %></span>
<span class="label"><%= t('renders.weather.high') %></span>
</div>
</div>
</div>
@@ -126,7 +128,7 @@
<div class="title_bar">
<img class="image" src="<%= Rails.application.credentials.base_url %>/images/plugins/tempest_weather_station--render.svg" />
<h1 class="title"><%= t('renders.weather.title', locale:) %></h1>
<h1 class="title"><%= t('renders.weather.title') %></h1>
<span class="instance"><%= instance_name %></span>
</div>
</div>