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

@@ -17,8 +17,8 @@
id: dom_id(unit, :new, :link), onclick: 'this.blur();', data: {turbo_stream: true} %>
<% end %>
<%= image_button_to t('.delete_unit'), 'delete-outline', unit_path(unit),
method: :delete %>
<%= image_button_to t('.destroy'), 'delete-outline', unit_path(unit),
method: :delete, **disabled_attributes(!unit.movable?) %>
</td>
<% if unit.movable? %>
<td class="handle" draggable="true">&#x283F</td>