feat: add weather forecasting
This commit is contained in:
parent
6eea0dc29f
commit
705e7b1dc0
20 changed files with 181 additions and 19 deletions
|
@ -22,7 +22,26 @@
|
|||
</div>
|
||||
</header>
|
||||
|
||||
<%= render partial: "list", locals: { instance: @instance } %>
|
||||
<main>
|
||||
<%= render partial: "list", locals: { instance: @instance } %>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="weather-list">
|
||||
<% forecast = Weather.forecast(@instance.zone.to_sym) %>
|
||||
<div class="weather">
|
||||
<img src="/weather/<%= forecast[0][:curr_weather] %>.png" width="25" title="<%= forecast[0][:weather_name] %>" />
|
||||
<div>now</div>
|
||||
</div>
|
||||
<% 4.times do |i| %>
|
||||
»
|
||||
<div class="weather">
|
||||
<img src="/weather/<%= forecast[i + 1][:curr_weather] %>.png" width="25" title="<%= forecast[i + 1][:weather_name] %>" />
|
||||
<div><%= ((forecast[i + 1][:time] - Time.now.utc) / 1.minutes).floor %>m</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<%= javascript_include_tag "list" %>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue