forked from fixin.me/fixin.me
Merge upstream/final-form into master
Incorporates WIP alternative measurement form (single select form with multiple select actions) and readouts controller. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,28 +1,23 @@
|
||||
<%= tabular_form_with model: Measurement.new, id: :measurement_form,
|
||||
class: 'topside-area vflex', html: {onkeydown: 'formProcessKey(event)'} do |form| %>
|
||||
<table class="items centered">
|
||||
<tbody id="readouts"></tbody>
|
||||
</table>
|
||||
|
||||
<div class="hflex">
|
||||
<%# TODO: right-click selection %>
|
||||
<details id="quantity_select" class="hexpand" open
|
||||
onkeydown="detailsProcessKey(event)">
|
||||
<summary autofocus>
|
||||
<!-- TODO: Set content with CSS when span empty to avoid duplication -->
|
||||
<span data-prompt="<%= t('.select_quantity') %>">
|
||||
<%= t('.select_quantity') %>
|
||||
</span>
|
||||
<%= image_button_tag t(:apply), "update", name: nil, disabled: true,
|
||||
formaction: new_readout_path, formmethod: :get, formnovalidate: true,
|
||||
data: {turbo_stream: true} %>
|
||||
</summary>
|
||||
<ul><%= quantities_check_boxes %></ul>
|
||||
</details>
|
||||
<%= form.button id: :create_measurement_button, disabled: true -%>
|
||||
</div>
|
||||
|
||||
<div class="hflex reverse">
|
||||
<%= tabular_form_with model: Measurement.new do |form| %>
|
||||
<fieldset>
|
||||
<table class="items centered">
|
||||
<tbody id="readouts">
|
||||
<tr id="readouts_form">
|
||||
<td colspan="4">
|
||||
<%= collection_select :quantity, :id, @quantities, :id, :to_s_with_depth,
|
||||
{prompt: t('.select_quantity'), disabled: '', selected: ''},
|
||||
{name: :id, class: 'quantity vexpand',
|
||||
onchange: "this.form.requestSubmit(new_readout_submit);"} %>
|
||||
<%= form.submit id: :new_readout_submit, name: nil, value: nil,
|
||||
formaction: new_readout_path, formmethod: :get, formnovalidate: true,
|
||||
hidden: true, data: {turbo_stream: true} %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<div class="hflex centered">
|
||||
<%= form.button -%>
|
||||
<%= image_link_to t(:cancel), "close-outline", measurements_path, name: :cancel,
|
||||
class: 'dangerous', onclick: render_turbo_stream('form_close') %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user