Disable Unit destuction for base units with subunits

Closes #40
This commit is contained in:
2024-12-28 23:57:47 +01:00
parent bd40727231
commit 8552571526
6 changed files with 15 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
<% if current_user.at_least(:admin) %>
<% if unit.default? %>
<%= image_button_to t('.delete'), 'delete-outline', default_unit_path(unit),
method: :delete %>
method: :delete, **disabled_attributes(!unit.movable?) %>
<% else %>
<%= image_button_to t('.export'), 'upload-outline', export_default_unit_path(unit),
disabled_attributes(!unit.portable?) %>