<% if current_user.at_least(:active) %>
<%= image_link_to t('.new_unit'), 'plus-outline', new_unit_path,
id: :new_unit_link, onclick: 'this.blur();', data: {turbo_stream: true} %>
<% end %>
<%= image_link_to t('.import_units'), 'download-outline', default_units_path,
class: 'tools-area' %>
<%= t '.no_items' %>
| <%= Unit.human_attribute_name(:symbol) %>
| <%= Unit.human_attribute_name(:multiplier) %>
| <%= Unit.human_attribute_name(:description) %>
<% if current_user.at_least(:active) %>
| <%= t :actions %>
|
| <%= t '.top_level_drop' %>
<% end %>
<%= render @units %>
<% if current_user.at_least(:active) %>
<%# Hidden header and `#endmark` rows allows simplier row insertion by using only
turbo_stream #after/#before instead of #after + #prepend/#before + #append. %>
<%# TODO: replace with custom turbo_stream action, e.g. #afterrow that #prepend-s
if ID has `rows` property (`rows` in object) and #after otherwise? %>
|
<%# Insert form to prevent actions column width change on form toggle. %>
<%= render partial: 'form', locals: {hidden: true} %>
<% end %>