summaryrefslogtreecommitdiff
path: root/app/views/look/look.html.erb
blob: ef0f6c4ba667af1932df51bbad98ab4d85d8df91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<div class="mb-4">
  <h1 class="text-3xl"><%= @location.name %></h1>
  <p class="italic"><%= @location.description %></p>
</div>

<%# TODO: Don't load into memory %>
<% @location.monster_spawns.select(&:alive?).each do |ms| %>
  <p class="text-yellow-400">A <%= ms.monster.name %> is ravaging this location! (<%= ms.remaining_hp %> HP)</p>
  <% activity = Activity.find_by_gid("beastslay_leviathan_#{@location.gid}") %>
  <%= form_with url: start_activity_path(activity) do |f| %>
    <%= f.hidden_field :id, value: activity.id %>
    <%= f.submit "Hunt" %>
  <% end %>
<% end %>

<% @location.activities.order(:name).each do |activity| %>
  <div class="my-4">
    <h2 class="text-xl"><%= link_to activity.name, activity_path(activity) %></h2>
    <p class="italic"><%= activity.description %></p>
    <%= form_with url: start_activity_path(activity) do |f| %>
      <%= f.hidden_field :id, value: activity.id %>
      <%= f.submit "Start" %>
    <% end %>
  </div>
<% end %>