From 8323f7da46f48b17646f5e7d6b407e1a994d7a3f Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 19 May 2021 19:41:34 -0400 Subject: Show constructed amenities and provide links for building new ones --- app/controllers/characters/hearth_controller.rb | 1 + app/views/characters/hearth/index.html.erb | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/characters/hearth_controller.rb b/app/controllers/characters/hearth_controller.rb index 27cd77d..f2d2bf7 100644 --- a/app/controllers/characters/hearth_controller.rb +++ b/app/controllers/characters/hearth_controller.rb @@ -1,5 +1,6 @@ class Characters::HearthController < ApplicationController def index @all_amenities = HearthAmenity.all + @construct_activities = Activity.where("gid like ?", "construct_%") end end diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index f087ede..487bd46 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -1,7 +1,27 @@ <% foundation = @all_amenities.find_by_gid("foundation") %> -

Hearth

+

Hearth

<% if current_char.hearth.has_amenity?(foundation) %> +

Here is your hearth, your safe haven and stronghold against all that ravages and thrashes + in these realms. Amidst this great dream of planar chaos and destruction, you have built something. +

+ + + +
+ <% current_char.hearth.built_hearth_amenities.each do |bhi| %> +
+

<%= bhi.hearth_amenity.name %>

+

Level <%= bhi.level %>

+

<%= bhi.hearth_amenity.description %>

+
+ <% end %> +
<% else %>

You haven't built your hearth yet. First, you'll need to start with a foundation.

<% construct_activity = foundation.construct_activity(1) %> -- cgit v1.2.3