fixin.me/app/views/default/units/_unit.html.erb
cryptogopher 1fedd70fe5 Fix defaults listing
Base symbol was displayed twice when it existed as default and
non-default and both of them had at least one subunit.
Also: sorting by base_id yielded non-alphabetic order in such case.
2024-11-27 19:54:50 +01:00

23 lines
808 B
Plaintext

<%= tag.tr do %>
<td class="<%= class_names({subunit: unit.base, grayed: unit.default?}) %>">
<%= unit %>
</td>
<td class="actions">
<% unless unit.portable.nil? %>
<% if current_user.at_least(:active) && unit.default? %>
<%= image_button_to t('.import'), 'download-outline', import_default_unit_path(unit),
disabled_attributes(!unit.portable?) %>
<% end %>
<% if current_user.at_least(:admin) %>
<% if unit.default? %>
<%= image_button_to t('.delete'), 'delete-outline', unit_path(unit), method: :delete %>
<% else %>
<%= image_button_to t('.export'), 'upload-outline', export_default_unit_path(unit),
disabled_attributes(!unit.portable?) %>
<% end %>
<% end %>
<% end %>
</td>
<% end %>