summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-19 18:39:35 -0400
committerDavid Gay <david@davidgay.org>2021-05-19 18:39:35 -0400
commit9fec79398a34d26be1042e35cae429b88f8b96d0 (patch)
treec51814b60f5fb3ae753f9fe7549b30af6930adcc /app/views
parent9ab7dfd99e7015513bfe1a092f257c1c7a7afb1b (diff)
Revise and progress with hearth amenity construction
Diffstat (limited to 'app/views')
-rw-r--r--app/views/activities/_timer.html.erb9
-rw-r--r--app/views/characters/hearth/index.html.erb8
2 files changed, 10 insertions, 7 deletions
diff --git a/app/views/activities/_timer.html.erb b/app/views/activities/_timer.html.erb
index 418c378..27d9272 100644
--- a/app/views/activities/_timer.html.erb
+++ b/app/views/activities/_timer.html.erb
@@ -1,8 +1,9 @@
<% if current_char.activity %>
- <div data-controller="activities--timer"
- data-activities--timer-start-value="<%= current_char.activity_time_remaining.ceil %>"
+ <div data-controller="timer"
+ data-timer-start-value="<%= current_char.activity_time_remaining.ceil %>"
+ data-timer-post-url-value="<%= finish_activity_url %>"
class="text-center">
- <span data-activities--timer-target="timer" class="text-3xl"></span>
+ <span data-timer-target="timer" class="text-3xl"></span>
</div>
- <%= link_to "Stop", location_path(current_char.activity.location) %>
+ <%= link_to "Stop", character_path(current_char) %>
<% end %>
diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb
index 421d5e6..f087ede 100644
--- a/app/views/characters/hearth/index.html.erb
+++ b/app/views/characters/hearth/index.html.erb
@@ -1,8 +1,10 @@
+<% foundation = @all_amenities.find_by_gid("foundation") %>
<h1 class="text-3xl">Hearth</h1>
-<% if current_char.hearth %>
+<% if current_char.hearth.has_amenity?(foundation) %>
<% else %>
<p>You haven't built your hearth yet. First, you'll need to start with a foundation.</p>
- <% foundation = @all_amenities.find_by_gid("foundation") %>
- <%= link_to "Build #{foundation.name}", "#" %> (requires <%= foundation.build_requirements_string(1) %>)
+ <% construct_activity = foundation.construct_activity(1) %>
+ <%= link_to construct_activity.name, start_activity_path(construct_activity), method: :post %>
+ (costs <%= construct_activity.cost_string %>)
<% end %>