feat: add ffxiv-eureka.com import function

This commit is contained in:
insects 2025-03-12 12:31:03 +01:00
parent a28484d0e0
commit e2c99cbc6a
9 changed files with 131 additions and 1 deletions

View file

@ -1,6 +1,6 @@
<div id="nm-list">
<% APP_DATA[instance.zone.to_sym][:nms].each do |nm| %>
<% is_popped = instance.pops.filter { |pop| (Time.current - 120.minutes) <= pop.created_at }.any? { |pop| pop.name == nm[:name].parameterize } %>
<% is_popped = instance.pops.filter { |pop| (Time.now.utc - 120.minutes) <= pop.created_at }.any? { |pop| pop.name == nm[:name].parameterize } %>
<section class="<%= class_names(popped: is_popped, missing_reqs: has_missing_reqs?(nm, forecast)) %>">
<div>
<img src="<%= "/#{nm[:element]}.png" %>" alt="<%= nm[:element] %>" width="30" />

View file

@ -40,3 +40,17 @@
</button>
<% end %>
</div>
<h3>Import from ffxiv-eureka.com</h3>
<p>
Paste the text from the "killed NMs" button
<img src="/the_button.png" title="this one" alt="the button" />
in here, and we'll create an identical tracker for you.
</p>
<%= form_with url: new_from_fe_path do |f| %>
<%= f.text_field :info, placeholder: "Paste here!" %>
<%= f.submit "Create" %>
<% end %>