blob: 727e3a17a8480b079cdbc9bc0ba1cb5d767ca76d (
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
31
32
33
34
|
<% if character_items.any? %>
<h3 class="text-xl"><%= heading %></h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5
border border-gray-500 rounded p-2 my-2">
<% character_items.each do |ci| %>
<div class="my-1">
<div class="flex items-center text-display">
<div><%= link_to ci.item.name, item_path(ci.item) %></div>
<div class="text-sm border border-gray-500 rounded-lg mx-2 px-1 py-0.5">
<%= ci.quantity %>
</div>
</div>
<div>
<span class="text-xs italic"><%= truncate(ci.item.description) %></span>
</div>
<% if ci.item.equipment? %>
<div class="text-xs"><%= ci.item.equip_slots.map {|s| s.to_s.humanize}.join(", ") %></div>
<% end %>
<div class="flex flex-row my-2 text-sm">
<% if ci.item.equipment? %>
<div class="mr-2">
<%= button_to "Equip", character_item_equip_path(item_id: ci.item.id) %>
</div>
<% end %>
<% if ci.item.usable? %>
<div class="mr-2">
<%= button_to "Use", character_item_use_path(item_id: ci.item.id) %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<% end %>
|