forked from fixin.me/fixin.me
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
<div class="rightside buttongrid">
|
|
<% if current_user.at_least(:active) %>
|
|
<%= image_link_to t('.new_quantity'), 'plus-outline', new_quantity_path,
|
|
id: dom_id(Quantity, :new, :link), onclick: 'this.blur();', data: {turbo_stream: true} %>
|
|
<% end %>
|
|
<%#= image_link_to t('.import_quantities'), 'download-outline', default_quantities_path,
|
|
class: 'tools' %>
|
|
</div>
|
|
|
|
<%= tag.div id: :quantity_form %>
|
|
|
|
<table class="main items">
|
|
<thead>
|
|
<tr>
|
|
<th><%= Quantity.human_attribute_name(:name).capitalize %></th>
|
|
<th><%= Quantity.human_attribute_name(:description).capitalize %></th>
|
|
<% if current_user.at_least(:active) %>
|
|
<th><%= t :actions %></th>
|
|
<th></th>
|
|
<% end %>
|
|
</tr>
|
|
<%= tag.tr id: "quantity_", hidden: true,
|
|
ondragover: "dragOver(event)", ondrop: "drop(event)",
|
|
ondragenter: "dragEnter(event)", ondragleave: "dragLeave(event)",
|
|
data: {drop_id: "quantity_", drop_id_param: "quantity[parent_id]"} do %>
|
|
<th colspan="4"><%= t '.top_level_drop' %></th>
|
|
<% end %>
|
|
</thead>
|
|
<tbody id="quantities">
|
|
<%= render(@quantities) || render_no_items %>
|
|
</tbody>
|
|
</table>
|