forked from fixin.me/fixin.me
26 lines
994 B
Plaintext
26 lines
994 B
Plaintext
<% @readouts.each do |readout| %>
|
|
<%= tabular_fields_for 'readouts[]', readout do |form| %>
|
|
<%- tag.tr id: dom_id(readout.quantity, :new, :readout),
|
|
onkeydown: 'processKey(event)' do %>
|
|
<%= tag.td id: dom_id(readout.quantity, nil, :pathname) do %>
|
|
<%= readout.quantity.relative_pathname(@common_ancestor) %>
|
|
<%end%>
|
|
<td>
|
|
<%= form.number_field :value, required: true, autofocus: true, size: 10 %>
|
|
</td>
|
|
<td>
|
|
<%= form.select :unit_id, options_from_collection_for_select(
|
|
@units, :id, ->(u){ sanitize(' '*(u.base_id ? 1 : 0) + u.symbol) }
|
|
) %>
|
|
</td>
|
|
|
|
<td class="actions">
|
|
<%= image_button_tag '', 'delete-outline', class: 'dangerous',
|
|
formaction: discard_new_measurement_path(readout.quantity),
|
|
formmethod: :get, formnovalidate: true, data: {turbo_stream: true} %>
|
|
<%= form.hidden_field :quantity_id %>
|
|
</td>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|