summaryrefslogtreecommitdiff
path: root/app/views/activities
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-27 18:41:51 -0400
committerDavid Gay <david@davidgay.org>2021-05-27 18:41:51 -0400
commit65c1ee3dbaf5c0a030dd28a7e3f41d47c7652cb1 (patch)
tree7536a43e8656d7cecc867c9a221fced1f225f731 /app/views/activities
parent2c2de801b4481695f3d1b6b14527116092cb1197 (diff)
Move active action display with timer and results to a `LookController`
Diffstat (limited to 'app/views/activities')
-rw-r--r--app/views/activities/_results.html.erb27
-rw-r--r--app/views/activities/_timer.html.erb16
-rw-r--r--app/views/activities/show.html.erb23
3 files changed, 10 insertions, 56 deletions
diff --git a/app/views/activities/_results.html.erb b/app/views/activities/_results.html.erb
deleted file mode 100644
index 36e8103..0000000
--- a/app/views/activities/_results.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div>
- <% results.each do |result| %>
- <% case result[:type] %>
- <% when "item" %>
- <p>You got <%= result[:quantity] %> <%= link_to result[:item].name, item_path(result[:item])%>
- <% if result[:xp]&.any? %>
- (<%= result[:xp].map { |award| "#{award[:amount] * result[:quantity]} xp #{award[:skill].name}" }.join(", ") %>)
- <% end %>
- </p>
- <% when "hearth_amenity" %>
- <p>You constructed <%= result[:hearth_amenity].name %>.</p>
- <% when "activity" %>
- <p>You realized how to <%= result[:activity].name %>!</p>
- <% when "monster" %>
- <p>You encountered a <%= result[:monster].name %>.</p>
- <p class="text-xs italic"><%= result[:monster].description %></p>
- <% when "xp" %>
- <p class="text-xs">You gained <%= result[:xp] %> <%= result[:skill].name %> XP.</p>
- <% when "title" %>
- <p>You earned the title <%= render "application/components/text/title", title: result[:title] %>!</p>
- <% when "message" %>
- <p><%= result[:body] %></p>
- <% when "error" %>
- <p><%= result[:message] %></p>
- <% end %>
- <% end %>
-</div>
diff --git a/app/views/activities/_timer.html.erb b/app/views/activities/_timer.html.erb
deleted file mode 100644
index c7d881c..0000000
--- a/app/views/activities/_timer.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% if current_char.activity %>
- <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-timer-target="timer" class="text-3xl"></span>
- </div>
-
- <% most_recent_cs = current_char.character_skills.order(:updated_at).last %>
- <div class="text-center text-sm">
- <div class="text-xs"><%= most_recent_cs.skill.name %> level <%= most_recent_cs.level %></div>
- <div><%= most_recent_cs.xp_to_next_level %> XP to next level</div>
- </div>
-
- <%= button_to "Stop", stop_activity_path %>
-<% end %>
diff --git a/app/views/activities/show.html.erb b/app/views/activities/show.html.erb
index c9c6d25..4516b51 100644
--- a/app/views/activities/show.html.erb
+++ b/app/views/activities/show.html.erb
@@ -1,15 +1,12 @@
-<h1 class="text-2xl"><%= @activity.name %></h1>
-<p><%= @activity.description %></p>
+<h1 class="text-3xl mb-2"><%= @activity.name %></h1>
+<p class="italic"><%= @activity.description %></p>
-<div class="min-w-full my-2 px-1 overflow-auto text-sm border-2 border-gray-800 rounded"
- style="height: 30rem;" id="result_output">
+<div class="my-6">
+ <h2 class="text-xl">Game Data</h2>
+ <p>GID: <span class="text-code"><%= @activity.gid %></span></p>
+ <% if @activity.whatnot %>
+ <div class="text-code my-2"><%= JSON.pretty_generate(@activity.whatnot) %></div>
+ <% else %>
+ <p>Item has no additional data.</p>
+ <% end %>
</div>
-
-<div id="result_controls">
- <%= render "timer" %>
-</div>
-
-<%= form_with url: start_activity_path do |f| %>
- <%= f.hidden_field :id, value: @activity.id %>
- <%= f.submit "Start" %>
-<% end %>