summaryrefslogtreecommitdiff
path: root/app/views/application
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-03 21:26:14 -0400
committerDavid Gay <david@davidgay.org>2021-06-03 21:26:14 -0400
commit60c9de4956547d46390c948146aa6e0c865ffcda (patch)
tree7bbde799de9cec589a53a08b8e4dccf98bfdc8e3 /app/views/application
parent7f129f24e351cafafdb4bc58a44ca0d714e30af6 (diff)
Move timer and results to new game containers which are always visible
Diffstat (limited to 'app/views/application')
-rw-r--r--app/views/application/_navbar.html.erb3
-rw-r--r--app/views/application/_timer.html.erb37
2 files changed, 36 insertions, 4 deletions
diff --git a/app/views/application/_navbar.html.erb b/app/views/application/_navbar.html.erb
index c45db15..c0e2761 100644
--- a/app/views/application/_navbar.html.erb
+++ b/app/views/application/_navbar.html.erb
@@ -1,9 +1,6 @@
<ul class="py-2 px-2 col-span-12 text-display">
<% if current_char %>
<li class="mr-6 inline">
- <%= link_to "Look", look_path %>
- </li>
- <li class="mr-6 inline">
<%= link_to "Locations", locations_path %>
</li>
<li class="mr-6 inline">
diff --git a/app/views/application/_timer.html.erb b/app/views/application/_timer.html.erb
index 908689b..ec10258 100644
--- a/app/views/application/_timer.html.erb
+++ b/app/views/application/_timer.html.erb
@@ -1,4 +1,5 @@
<% if current_char.activity %>
+ <h2 class="text-lg text-display text-center"><%= current_char.activity.name %></h2>
<div data-controller="timer"
data-timer-start-value="<%= current_char.activity_time_remaining.ceil %>"
data-timer-post-url-value="<%= finish_activity_url %>"
@@ -12,7 +13,41 @@
<div><%= most_recent_cs.xp_to_next_level %> XP to next level</div>
</div>
- <div class="text-center my-4">
+ <div class="text-center my-3">
<%= button_to "Stop", stop_activity_path %>
</div>
+
+ <div class="text-center text-xs my-2">
+ <% if current_char.activity.gid.include?("beastslay") %>
+ <%= current_char.wounds %> / <%= current_char.max_wounds %> wounds
+ <% end %>
+ <% current_char.active_states.each do |state| %>
+ <div>
+ <%= state.condition.name %>
+ </div>
+ <div>
+ (expires in <%= distance_of_time_in_words_to_now(state.expires_at) %>)
+ </div>
+ <% end %>
+ </div>
+
+<% else %>
+ <div class="text-center">
+ <% if current_char.resting? %>
+ <p>You're resting.</p>
+ <% else %>
+ <p>You're not doing anything.</p>
+ <% end %>
+
+ <div class="my-2">
+ <%= button_to current_char.resting? ? "Stop Resting" : "Start Resting", toggle_resting_path %>
+ </div>
+
+ <div class="text-xs">
+ You have <%= distance_of_time_in_words_to_now(current_char.rested_until) %> of rested time.
+ <% if current_char.resting? %>
+ This does not include time from your current rest. That time will be added when you stop resting.
+ <% end %>
+ </div>
+ </div>
<% end %>