blob: 8b5466e2a1fb774112418419b8bdbffffd9a3557 (
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
|
<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 class="text-red-500"><%= result[:message] %></p>
<% end %>
<% end %>
</div>
|