Default Units index

This commit is contained in:
2024-11-10 21:30:19 +01:00
parent aebbe11bef
commit 51011951f9
5 changed files with 35 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
<%= tag.tr do %>
<td class="<%= class_names({subunit: unit.base}) %>">
<%= unit.symbol %>
</td>
<td class="actions">
<% if current_user.at_least(:active) && unit.default? %>
<%= image_button_to t(".import"), "download-outline", import_default_unit_path(unit) %>
<% end %>
<% if current_user.at_least(:admin) %>
<% if !unit.default? %>
<%= image_button_to t(".export"), "upload-outline", export_default_unit_path(unit) %>
<% else %>
<%= image_button_to t(".delete"), "delete-outline", unit_path(unit),
method: :delete %>
<% end %>
<% end %>
</td>
<% end %>