diff options
author | David Gay <david@davidgay.org> | 2021-07-05 20:30:15 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-05 20:30:15 -0400 |
commit | 28426519e11e72576b1a3339f47c420f9c184e49 (patch) | |
tree | ae92cce4888f8cbd038359902a6db6df557fe5cc /app/views/look/look.html.erb | |
parent | f160f81a6daae8b478a5547078abc7c7b29ef747 (diff) |
Give characters a location, and replace the Locations view+controller with a Look view+controller
Diffstat (limited to 'app/views/look/look.html.erb')
-rw-r--r-- | app/views/look/look.html.erb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/views/look/look.html.erb b/app/views/look/look.html.erb new file mode 100644 index 0000000..2f1074a --- /dev/null +++ b/app/views/look/look.html.erb @@ -0,0 +1,25 @@ +<div class="mb-4"> + <h1 class="text-3xl"><%= @location.name %></h1> + <p class="italic"><%= @location.description %></p> +</div> + +<% @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> + <%# TODO: HACK %> + <% activity = Activity.find_by_gid("beastslay_leviathan_floret") %> + <%= 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 %> |