feat: support adjusting pop time

This commit is contained in:
insects 2025-03-12 13:08:05 +01:00
parent 54d18f4968
commit 5914b85fc6
5 changed files with 37 additions and 0 deletions

View file

@ -36,6 +36,14 @@
<span class="progress-container">
<span class="progress-bar" style="width: <%= (mins.in_minutes / 120) * 100 %>%"></span>
</span>
<details class="needs_pwd" hx-preserve id="change-form-<%= nm[:name].parameterize %>">
<summary>adjust pop time</summary>
<%= form_with url: adjust_pop_path(instance: instance.public_id, nm: nm[:name].parameterize), class: "action-form", html: {"hx-boost": true, "hx-replace-url": false, "hx-target": "#nm-list", "hx-select": "#nm-list", "hx-swap": "outerHTML:w
"} do |f| %>
<%= f.number_field :mins, placeholder: "minutes ago" %>
<%= f.submit "change" %>
<% end %>
</details>
<% else %>
<% if nm[:weather] && forecast[0][:curr_weather] != nm[:weather] %>
<% next_pattern = forecast.find { |f| f[:curr_weather] == nm[:weather] } %>