forked from fixin.me/fixin.me
Implement Measurements#new
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
<div class="main">
|
||||
<div class="topside vflex">
|
||||
<% if current_user.at_least(:active) %>
|
||||
<%= render partial: 'form' %>
|
||||
<%# TODO: show hint when no quantities/units defined %>
|
||||
<%= form_tag new_measurement_path, method: :get, class: "htoolbox",
|
||||
data: {turbo_stream: true} do %>
|
||||
<%= select_tag :id,
|
||||
options_from_collection_for_select(@quantities, :id,
|
||||
->(q) { sanitize('- '*q.depth + q.name) }) %>
|
||||
<%= image_button_tag t('.new_quantity'), 'plus-outline', name: :scope -%>
|
||||
<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, formaction: new_measurement_path,
|
||||
formmethod: :get, formnovalidate: true,
|
||||
data: {turbo_stream: true}} %>
|
||||
<%= image_button_tag t('.new_quantity'), 'plus-outline', name: :scope,
|
||||
**common_options -%>
|
||||
<%= image_button_tag t('.new_children'), 'plus-multiple-outline', name: :scope,
|
||||
value: :children -%>
|
||||
value: :children, **common_options -%>
|
||||
<%= image_button_tag t('.new_subtree'), 'plus-multiple-outline', name: :scope,
|
||||
value: :subtree -%>
|
||||
<% end %>
|
||||
value: :subtree, **common_options -%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user