summaryrefslogtreecommitdiff
path: root/app/views/activities/_results.html.erb
blob: 0fef8fba9b9ea7e425657ac405498bd11b30738f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div>
  <% results.each do |result| %>
    <% case result[:type] %>
    <% when "item" %>
      <p>You got <%= result[:quantity] %> <%= result[:item].name %>
        <% if result[:xp]&.any? %>
          (<%= result[:xp].map { |award| "#{award[:amount]} 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 "error" %>
      <p><%= result[:message] %></p>
    <% end %>
  <% end %>
</div>