forked from fixin.me/fixin.me
Measurement form based on select-styled <details>
This commit is contained in:
@@ -1,20 +1,14 @@
|
||||
<div class="topside vflex">
|
||||
<%# TODO: show hint when no quantities/units defined %>
|
||||
<div class="rightside buttongrid">
|
||||
<% if current_user.at_least(:active) %>
|
||||
<%# TODO: show hint when no quantities/units defined %>
|
||||
<%= tabular_form_with url: new_measurement_path,
|
||||
html: {id: :new_readouts_form} do |f| %>
|
||||
<% end %>
|
||||
<div class="hflex">
|
||||
<%= select_tag :id, options_from_collection_for_select(
|
||||
@quantities, :id, ->(q){ sanitize(' ' * q.depth + q.name) }
|
||||
), form: :new_readouts_form %>
|
||||
<% common_options = {form: :new_readouts_form, formmethod: :get,
|
||||
formnovalidate: true, data: {turbo_stream: true}} %>
|
||||
<%= image_button_tag t('.new_quantity'), 'plus-outline', **common_options -%>
|
||||
<%= image_button_tag t('.new_children'), 'plus-multiple-outline',
|
||||
formaction: new_measurement_path(:children), **common_options -%>
|
||||
<%= image_button_tag t('.new_subtree'), 'plus-multiple-outline',
|
||||
formaction: new_measurement_path(:subtree), **common_options -%>
|
||||
</div>
|
||||
<%= image_link_to t('.new_measurement'), 'plus-outline', new_measurement_path,
|
||||
id: :new_measurement_link, onclick: 'this.blur();',
|
||||
data: {turbo_stream: true} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<table class="main">
|
||||
<tbody id="measurements">
|
||||
<%= render(@measurements) || render_no_items %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user