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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<h2 class="text-xl">Equipped Items</h2>
<div class="grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
<% Equipment.slots.each do |slot| %>
<div class="my-2">
<div class="text-xs text-gray-500"><%= slot[0].to_s.humanize %></div>
<% eq = @character.equipment.find_by(slot: slot)%>
<% if eq.present? %>
<div class="text-display"><%= eq.item.name %></div>
<% else %>
<div class="text-gray-500 italic">–</div>
<% end %>
<% if eq.present? %>
<div class="text-sm">
<%= button_to "Unequip", character_item_unequip_path(slot: eq.slot ) %>
</div>
<% end %>
</div>
<% end %>
</div>
<%= render "characters/items/inventory_section", heading: "Equipment",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.equipment? && ci.item.tags.none? } %>
<%= render "characters/items/inventory_section", heading: "Consumables",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.usable? } %>
<%= render "characters/items/inventory_section", heading: "Tools",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.has_tag?("tool") } %>
<%= render "characters/items/inventory_section", heading: "Currency",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.has_tag?("currency") } %>
<%= render "characters/items/inventory_section", heading: "Omens",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.has_tag?("omen") } %>
<%= render "characters/items/inventory_section", heading: "Seeds",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.has_tag?("seed") } %>
<%= render "characters/items/inventory_section", heading: "Materials",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
ci.item.has_tag?("material") } %>
<%= render "characters/items/inventory_section", heading: "Miscellany",
character_items: @character.character_items.ordered_by_item_name.select { |ci|
!ci.item.equipment? && !ci.item.usable? && ci.item.tags.none? } %>
|