From 0581c53454d98509beda6898aed68ac23bb572c7 Mon Sep 17 00:00:00 2001 From: insects Date: Thu, 13 Mar 2025 12:00:06 +0100 Subject: [PATCH] feat: show next condition even when popped --- app/assets/stylesheets/application.css | 17 +++++++++-- app/views/instance/_list.html.erb | 40 +++++++++++++++----------- app/views/instance/show.html.erb | 2 +- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e1d8301..3115f9f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -57,7 +57,7 @@ main { #nm-list section { margin-bottom: 5px; display: grid; - grid-template-columns: .05fr 1fr 1fr .3fr; + grid-template-columns: .05fr 1fr 1.5fr .3fr; align-items: center; padding-left: 10px; background-color: #3D9970; @@ -176,7 +176,7 @@ section .meta { } .progress-container { - width: 50%; + width: 87%; display: inline-block; background-color: tomato; height: 10px; @@ -323,3 +323,16 @@ summary:hover { a:has(button) { text-decoration: none; } + +.condition { + display: grid; + grid-template-columns: 2fr 1fr; + gap: 5px; +} + +.pop-timer .timer { + display: flex; + align-items: center; + justify-content: space-between; + gap: 5px; +} diff --git a/app/views/instance/_list.html.erb b/app/views/instance/_list.html.erb index cf45a33..6c5c329 100644 --- a/app/views/instance/_list.html.erb +++ b/app/views/instance/_list.html.erb @@ -28,23 +28,31 @@ LV<%= nm[:spawned_by][:level].to_s.rjust(2, "0") %> -
+
<% if is_popped %> - <% pop = instance.pops.find { |pop| pop.name == nm[:name].parameterize } %> - <% mins = ActiveSupport::Duration.build(Time.current - pop.created_at) %> - » <%= (120.minutes - mins).in_minutes.floor %>m - - - -
- adjust pop time - <%= 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 +
+ <% pop = instance.pops.find { |pop| pop.name == nm[:name].parameterize } %> + <% mins = ActiveSupport::Duration.build(Time.current - pop.created_at) %> +
+
» <%= (120.minutes - mins).in_minutes.floor %>m
+
+ +
+
+
+ adjust pop time + <%= 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 %> -
- <% else %> + <%= f.number_field :mins, placeholder: "minutes ago" %> + <%= f.submit "change" %> + <% end %> +
+
+ <% end %> +
+ <% if is_popped && has_missing_reqs?(nm, forecast) %> + » + <% end %> <% if nm[:weather] && forecast[0][:curr_weather] != nm[:weather] %> <% next_pattern = forecast.find { |f| f[:curr_weather] == nm[:weather] } %> <%= Weather.get_weather_name(nm[:weather]) %> in <%= ((next_pattern[:time] - Time.now.utc) / 1.minutes).floor %>m @@ -56,7 +64,7 @@ <% if (nm[:night_only] || nm[:spawned_by][:night_only]) && is_day? %>
Night in <%= ((Clock.to_earth_time(Clock.get_current_eorzea_time.change(hour: 18)) - Time.now.utc) / 1.minutes).floor %>m
<% end %> - <% end %> +
<% if is_popped %> diff --git a/app/views/instance/show.html.erb b/app/views/instance/show.html.erb index eadc14b..a2854b0 100644 --- a/app/views/instance/show.html.erb +++ b/app/views/instance/show.html.erb @@ -1,5 +1,5 @@
-
+
<%= link_to root_path do %>eureka.coffee logo<% end %>