From 20d56f6b0bac4d79a4a91081b35a70759d2e4c69 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Fri, 6 Nov 2026 23:27:27 +0100 Subject: [PATCH] WIP --- app/helpers/application_helper.rb | 1 + app/views/measurements/index.html.erb | 3 ++- app/views/readouts/_form.html.erb | 9 +++++---- config/locales/en.yml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 97fa6c1..5a4cc2c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -218,6 +218,7 @@ module ApplicationHelper end.join.html_safe end + # TODO: remove from Default::Units and delete def render_no_items tag.tr id: :no_items do tag.td t("#{controller_path.tr('/', '.')}.no_items"), colspan: 10, class: 'hint' diff --git a/app/views/measurements/index.html.erb b/app/views/measurements/index.html.erb index bac10e1..b1c3047 100644 --- a/app/views/measurements/index.html.erb +++ b/app/views/measurements/index.html.erb @@ -8,7 +8,8 @@ + - <%= render(@measurements) || render_no_items %> + <%= render(@measurements) %>
<%= t '.no_items' %>
diff --git a/app/views/readouts/_form.html.erb b/app/views/readouts/_form.html.erb index b53068c..7bdaf5c 100644 --- a/app/views/readouts/_form.html.erb +++ b/app/views/readouts/_form.html.erb @@ -6,15 +6,16 @@ <%= readout.quantity.relative_pathname(@superquantity) %> <%= form.hidden_field :quantity_id %> - - <%= form.number_field :value, required: true, autofocus: readout_counter == 0 %> + + <%= form.number_field :value, class: 'hminnumber hstretch', required: true, + autofocus: readout_counter == 0 %> <%= form.collection_select :unit_id, @user_units, :id, ->(u){ sanitize(' ' * (u.base_id ? 1 : 0) + u.symbol) }, - {prompt: '', disabled: '', selected: ''}, required: true %> + {prompt: '', disabled: '', selected: ''}, class: 'hstretch', required: true %> - + <%# TODO: change to _link_ after giving up displaying relative paths %> <%= image_button_tag '', 'delete-outline', class: 'dangerous', name: nil, formaction: discard_readouts_path(readout.quantity), diff --git a/config/locales/en.yml b/config/locales/en.yml index abe8396..5af1b20 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -98,12 +98,12 @@ en: source_code: Get code measurements: navigation: Measurements - no_items: There are no measurements taken. You can Add some now. form: select_quantity: select quantities... taken_at_html: Measurement taken at  index: new_measurement: Add measurement + no_items: There are no measurements taken. You can Add some now. quantities: navigation: Quantities quantity: