summaryrefslogtreecommitdiff
path: root/app/views/characters/hearth/index.html.erb
blob: 487bd46c73eebab5a4aa0b37b1d792fdce555bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<% foundation = @all_amenities.find_by_gid("foundation") %>
<h1 class="text-3xl mb-2">Hearth</h1>

<% if current_char.hearth.has_amenity?(foundation) %>
  <p class="mb-2">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.
  </p>

  <ul class="my-4">
    <% @construct_activities.each do |activity| %>
      <li><%= link_to activity.name, start_activity_path(activity), method: :post %>
        (costs <%= activity.cost_string %>)</li>
    <% end %>
  </ul>

  <div class="grid grid-cols-2 gap-4">
    <% current_char.hearth.built_hearth_amenities.each do |bhi| %>
      <div class="border-2 border-gray-800 rounded p-4">
        <h2 class="text-lg font-bold"><%= bhi.hearth_amenity.name %></h2>
        <p>Level <%= bhi.level %></p>
        <p><%= bhi.hearth_amenity.description %></p>
      </div>
    <% end %>
  </div>
<% else %>
  <p>You haven't built your hearth yet. First, you'll need to start with a foundation.</p>
  <% construct_activity = foundation.construct_activity(1) %>
  <%= link_to construct_activity.name, start_activity_path(construct_activity), method: :post %>
  (costs <%= construct_activity.cost_string %>)
<% end %>