From 65c1ee3dbaf5c0a030dd28a7e3f41d47c7652cb1 Mon Sep 17 00:00:00 2001 From: David Gay Date: Thu, 27 May 2021 18:41:51 -0400 Subject: Move active action display with timer and results to a `LookController` --- app/views/activities/_results.html.erb | 27 --------------------------- app/views/activities/_timer.html.erb | 16 ---------------- app/views/activities/show.html.erb | 23 ++++++++++------------- 3 files changed, 10 insertions(+), 56 deletions(-) delete mode 100644 app/views/activities/_results.html.erb delete mode 100644 app/views/activities/_timer.html.erb (limited to 'app/views/activities') 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 @@ -
- <% results.each do |result| %> - <% case result[:type] %> - <% when "item" %> -

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 %> -

- <% when "hearth_amenity" %> -

You constructed <%= result[:hearth_amenity].name %>.

- <% when "activity" %> -

You realized how to <%= result[:activity].name %>!

- <% when "monster" %> -

You encountered a <%= result[:monster].name %>.

-

<%= result[:monster].description %>

- <% when "xp" %> -

You gained <%= result[:xp] %> <%= result[:skill].name %> XP.

- <% when "title" %> -

You earned the title <%= render "application/components/text/title", title: result[:title] %>!

- <% when "message" %> -

<%= result[:body] %>

- <% when "error" %> -

<%= result[:message] %>

- <% end %> - <% end %> -
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 %> -
- -
- - <% most_recent_cs = current_char.character_skills.order(:updated_at).last %> -
-
<%= most_recent_cs.skill.name %> level <%= most_recent_cs.level %>
-
<%= most_recent_cs.xp_to_next_level %> XP to next level
-
- - <%= 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 @@ -

<%= @activity.name %>

-

<%= @activity.description %>

+

<%= @activity.name %>

+

<%= @activity.description %>

-
+
+

Game Data

+

GID: <%= @activity.gid %>

+ <% if @activity.whatnot %> +
<%= JSON.pretty_generate(@activity.whatnot) %>
+ <% else %> +

Item has no additional data.

+ <% end %>
- -
- <%= render "timer" %> -
- -<%= form_with url: start_activity_path do |f| %> - <%= f.hidden_field :id, value: @activity.id %> - <%= f.submit "Start" %> -<% end %> -- cgit v1.2.3