summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-03 20:50:58 -0400
committerDavid Gay <david@davidgay.org>2021-06-03 20:51:17 -0400
commit7f129f24e351cafafdb4bc58a44ca0d714e30af6 (patch)
treee74f989bbeb8c1ea84a43262f97719d80d4010e6
parentdb41c035bfdd0e97662b80d02fbae4a99ed547c2 (diff)
Move timer and results to new game containers which are always visible
-rw-r--r--app/views/application/_results.html.erb (renamed from app/views/look/_results.html.erb)0
-rw-r--r--app/views/application/_timer.html.erb (renamed from app/views/look/_timer.html.erb)0
-rw-r--r--app/views/game/finish_activity.js.erb4
-rw-r--r--app/views/layouts/application.html.erb11
-rw-r--r--app/views/look/show.html.erb8
5 files changed, 9 insertions, 14 deletions
diff --git a/app/views/look/_results.html.erb b/app/views/application/_results.html.erb
index 1da0af7..1da0af7 100644
--- a/app/views/look/_results.html.erb
+++ b/app/views/application/_results.html.erb
diff --git a/app/views/look/_timer.html.erb b/app/views/application/_timer.html.erb
index 908689b..908689b 100644
--- a/app/views/look/_timer.html.erb
+++ b/app/views/application/_timer.html.erb
diff --git a/app/views/game/finish_activity.js.erb b/app/views/game/finish_activity.js.erb
index 79659b6..d5772f4 100644
--- a/app/views/game/finish_activity.js.erb
+++ b/app/views/game/finish_activity.js.erb
@@ -1,7 +1,7 @@
var resultOutputDiv = document.getElementById("result_output");
var resultControlsDiv = document.getElementById("result_controls");
-var outputHTML = "<%= j render(partial: "look/results", locals: { results: @results }) %>"
+var outputHTML = "<%= j render(partial: "application/results", locals: { results: @results }) %>"
if (resultOutputDiv) {
resultOutputDiv.innerHTML += outputHTML;
@@ -11,5 +11,5 @@ if (resultOutputDiv) {
}
if (resultControlsDiv) {
- resultControlsDiv.innerHTML = "<%= j render(partial: "look/timer") %>"
+ resultControlsDiv.innerHTML = "<%= j render(partial: "application/timer") %>"
}
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 485aa21..fc627a2 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -21,9 +21,10 @@
<%= render "navbar" %>
<% end %>
<div class="flex flex-col col-span-12 sm:col-span-8">
- <div class="game-container-box mb-2" style="height: 10rem;">
- Results go here.
- </div>
+ <% 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;">
<%= render "flash_messages" %>
<%= yield %>
@@ -32,7 +33,9 @@
<% 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;">
- Timer goes here.
+ <div id="result_controls">
+ <%= render "timer" %>
+ </div>
</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
index 2e0af81..4286944 100644
--- a/app/views/look/show.html.erb
+++ b/app/views/look/show.html.erb
@@ -1,14 +1,6 @@
<% if current_char.activity %>
<h1 class="text-2xl"><%= current_char.activity.name %></h1>
<p><%= current_char.activity.description %></p>
-
- <div class="min-w-full my-2 px-1 overflow-auto text-sm border-2 border-gray-800 rounded"
- style="height: 22rem;" id="result_output">
- </div>
-
- <div id="result_controls">
- <%= render "timer" %>
- </div>
<% else %>
<p>You're not currently doing anything. Maybe you'd like to
<%= link_to "go somewhere", locations_path %>?</p>