diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/application/_navbar.html.erb | 3 | ||||
-rw-r--r-- | app/views/application/_timer.html.erb | 37 | ||||
-rw-r--r-- | app/views/characters/show.html.erb | 4 | ||||
-rw-r--r-- | app/views/game/finish_activity.js.erb | 2 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 18 | ||||
-rw-r--r-- | app/views/look/show.html.erb | 7 |
6 files changed, 48 insertions, 23 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 %> diff --git a/app/views/characters/show.html.erb b/app/views/characters/show.html.erb index b2e8f94..dda770e 100644 --- a/app/views/characters/show.html.erb +++ b/app/views/characters/show.html.erb @@ -19,7 +19,7 @@ <% if @character.active_states.any? %> <ul> <% @character.active_states.each do |state| %> - <ul><%= state.condition.name %> (expires in <%= state.remaining_duration %> seconds)</ul> + <ul><%= state.condition.name %> (expires in <%= distance_of_time_in_words_to_now(state.expires_at)%>)</ul> <% end %> </ul> <% else %> @@ -109,7 +109,7 @@ <div class="my-6"> <h2 class="text-2xl mb-4">Rest</h2> <p class="mb-4"> - You have <%= @character.rested_duration %> seconds of rested time stored. + 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 %> diff --git a/app/views/game/finish_activity.js.erb b/app/views/game/finish_activity.js.erb index d5772f4..f37c142 100644 --- a/app/views/game/finish_activity.js.erb +++ b/app/views/game/finish_activity.js.erb @@ -1,5 +1,5 @@ var resultOutputDiv = document.getElementById("result_output"); -var resultControlsDiv = document.getElementById("result_controls"); +var resultControlsDiv = document.getElementById("activity_controls"); var outputHTML = "<%= j render(partial: "application/results", locals: { results: @results }) %>" diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fc627a2..513fcdd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -21,21 +21,21 @@ <%= render "navbar" %> <% end %> <div class="flex flex-col col-span-12 sm:col-span-8"> - <% if user_signed_in? %> - <div class="game-container-box mb-2 overflow-auto text-sm" style="height: 10rem;" id="result_output"> - </div> - <% end %> - <div class="game-container-box" style="height: 25rem;"> + <div class="game-container-box mb-2 overflow-y-auto" style="height: 20rem;"> <%= render "flash_messages" %> <%= yield %> </div> + <% if user_signed_in? %> + <div class="game-container-box overflow-auto text-sm p-2" style="height: 15rem;" id="result_output" + data-turbolinks-permanent> + </div> + <% end %> </div> <% if user_signed_in? %> <div class="flex flex-col col-span-12 sm:col-span-4"> - <div class="game-container-box mb-2" style="height: 15rem;"> - <div id="result_controls"> - <%= render "timer" %> - </div> + <div class="game-container-box mb-2 overflow-y-auto" style="height: 15rem;" id="activity_controls" + data-turbolinks-permanent> + <%= render "timer" %> </div> <div id="chat" class="game-container-box col-span-12 sm:col-span-4" style="height: 20rem;" data-turbolinks-permanent> diff --git a/app/views/look/show.html.erb b/app/views/look/show.html.erb deleted file mode 100644 index 4286944..0000000 --- a/app/views/look/show.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% if current_char.activity %> - <h1 class="text-2xl"><%= current_char.activity.name %></h1> - <p><%= current_char.activity.description %></p> -<% else %> - <p>You're not currently doing anything. Maybe you'd like to - <%= link_to "go somewhere", locations_path %>?</p> -<% end %> |