-
-
Notifications
You must be signed in to change notification settings - Fork 576
Expand file tree
/
Copy path_table.html.erb
More file actions
54 lines (54 loc) · 1.6 KB
/
_table.html.erb
File metadata and controls
54 lines (54 loc) · 1.6 KB
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
53
54
<table class="table table-items-location">
<thead>
<tr>
<th>Name</th>
<th>Items</th>
<th>Allocations</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<% @kits.each do |kit| %>
<tr>
<td><%= kit.name %></td>
<td>
<ul>
<% kit.kit_item.line_items.quantities_by_name.map do |id, item_hash| %>
<li><%= "#{item_hash[:quantity]} #{item_hash[:name]}" %></li>
<% end %>
</ul>
</td>
<td class='d-flex flex-column'>
<table>
<thead>
<tr>
<td> Storage Location </td>
<td class="text-right"> Quantity </td>
</tr>
</thead>
<% @inventory.all_items.select { |i| i.item_id == kit.kit_item.id}.each do |item| %>
<tr>
<td><%= @inventory.storage_location_name(item.storage_location_id) %></td>
<td class="text-right"><%= item.quantity %></td>
</tr>
<% end %>
</table>
</td>
<td class="text-right">
<% if kit.active %>
<%= deactivate_kit_button(kit, @inventory) %>
<% else %>
<%= reactivate_button_to reactivate_kit_path(kit),
{ confirm: confirm_reactivate_msg(kit.name),
class: 'reactivate-kit-button',
size: 'xs' } %>
<% end %>
<%= edit_button_to allocations_kit_path(kit), { text: "Modify Allocation" } %>
</td>
</tr>
<% end %>
</tbody>
</table>
<script type="module">
$('.tooltip-target').tooltip();
</script>