%# TODO: add readout reordering by dragging %>
<%= tabular_fields_for 'readouts[]', readout do |form| %>
<%- tag.tr id: dom_id(readout.quantity, :new, :readout),
onkeydown: 'processKey(event)' do %>
<%= readout.quantity.relative_pathname(@superquantity) %>
|
<%= form.number_field :value, required: true, autofocus: true, size: 10 %>
|
<%= form.hidden_field :quantity_id %>
<%= form.collection_select :unit_id, @user_units, :id,
->(u){ sanitize(' ' * (u.base_id ? 1 : 0) + u.symbol) } %>
|
<%= image_button_tag '', 'delete-outline', class: 'dangerous', name: :discard,
formaction: discard_readouts_path(readout.quantity),
formmethod: :get, formnovalidate: true, data: {turbo_stream: true} %>
|
<% end %>
<% end %>