diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 32dae52..d45ffea 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -563,6 +563,9 @@ form table.items td:first-child { .hflex.centered { justify-content: center; } +.vexpand { + width: 100%; +} .vflex { display: flex; gap: 0.8em; diff --git a/app/helpers/quantities_helper.rb b/app/helpers/quantities_helper.rb index cf1f741..9e6aa8b 100644 --- a/app/helpers/quantities_helper.rb +++ b/app/helpers/quantities_helper.rb @@ -1,17 +1,2 @@ module QuantitiesHelper - def quantity_option_text(quantity, checked = nil) - prefix = case checked - when true - # Use color and gray unicode emoji to assure same width. - # Avoid shapes similar to inputs (chackboxes, radio buttons etc.) - # (U+27A1 U+FE0F)/U+1F7E6/U+2705/U+1F499 U+2004 - '💙 ' - when false - # U+2B1C/U+1F90D U+2004 - '🤍 ' - else - '' - end - sanitize(' ' * quantity.depth + prefix + quantity.name) - end end diff --git a/app/models/quantity.rb b/app/models/quantity.rb index 6748492..ed81124 100644 --- a/app/models/quantity.rb +++ b/app/models/quantity.rb @@ -100,6 +100,11 @@ class Quantity < ApplicationRecord name end + def to_s_with_depth + # em space, U+2003 + ' ' * depth + name + end + def destroyable? subquantities.empty? end diff --git a/app/views/measurements/_form.html.erb b/app/views/measurements/_form.html.erb index 6e1f675..e85d036 100644 --- a/app/views/measurements/_form.html.erb +++ b/app/views/measurements/_form.html.erb @@ -1,32 +1,16 @@ <%= tabular_form_with model: Measurement.new do |form| %>