diff options
author | David Gay <david@davidgay.org> | 2021-05-02 22:38:32 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-02 22:38:32 -0400 |
commit | 1b2de86007508ba86c6c9cb99fbdcac178045131 (patch) | |
tree | a007fc55acd2b54b5db108e3580928a9a006d71e /app/views/characters | |
parent | 1d5083ddf7f2b285e63bb8019d38199e862fa1d8 (diff) |
Character items and inventory, with ability to add and remove items
Diffstat (limited to 'app/views/characters')
-rw-r--r-- | app/views/characters/items/index.html.erb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/views/characters/items/index.html.erb b/app/views/characters/items/index.html.erb new file mode 100644 index 0000000..e313f7e --- /dev/null +++ b/app/views/characters/items/index.html.erb @@ -0,0 +1,36 @@ +<h1 class="text-xl">Inventory</h1> + +<table class="table-auto"> + <thead> + <tr> + <th class="table-header-padded">Amount</th> + <th class="table-header-padded">Item</th> + <th class="table-header-padded">Equip</th> + <th class="table-header-padded">Use</th> + <th class="table-header-padded">Destroy</th> + </tr> + </thead> + <tbody> + <% @character_items.ordered_by_item_name.each do |ci| %> + <tr> + <td class="table-cell-padded text-right"><%= ci.quantity %></td> + <td class="table-cell-padded"><%= ci.item.name %></td> + <td class="table-cell-padded"> + <% if ci.item.equip_slot %> + <%= link_to "[Equip]", "#" %> + <% end %> + </td> + <td class="table-cell-padded"> + <% if ci.item.usable? %> + <%= link_to "[Use]", "#" %> + <% end %> + </td> + <td class="table-cell-padded"> + <%= link_to "[Destroy]", "#" %> + <%= link_to "[Destroy All]", "#" %> + </td> + </tr> + <% end %> + </tbody> +</table> + |