20 lines
891 B
Plaintext
20 lines
891 B
Plaintext
<%# locals: (record: Unit.new, **attrs) %>
|
|
<%= tabular_fields_for record, form: attrs.dig(:data, :form) do |form| %>
|
|
<%- tag.tr class: "form", onkeydown: "formProcessKey(event)", **attrs do %>
|
|
|
|
<td style="--depth:<%= form.object.base_id? ? 1 : 0 %>">
|
|
<%= form.text_field :symbol, autofocus: true, class: 'hstretch', required: true %>
|
|
<td>
|
|
<% if form.object.base_id? %>
|
|
<%= form.number_field :multiplier, class: 'hstretch', required: true %>
|
|
<% end %>
|
|
<td><%= form.text_area :description, class: 'hstretch', escape: false, rows: 1 %>
|
|
|
|
<td><%= form.button %>
|
|
<td>
|
|
<%= image_link_to t(:discard), "close-outline", units_path, class: 'dangerous',
|
|
name: :discard, onclick: render_turbo_stream('form_close', {id: attrs[:id]}) %>
|
|
<td><!-- TODO: add aria-disabled drag handle with proper vertical alignment? -->
|
|
<% end %>
|
|
<% end %>
|