This commit is contained in:
2026-11-06 23:27:27 +01:00
parent 83ca68a62f
commit 20d56f6b0b
4 changed files with 9 additions and 6 deletions
+1
View File
@@ -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'
+2 -1
View File
@@ -8,7 +8,8 @@
</div>
<table class="main-area">
<caption class="hint"><%= t '.no_items' %></caption>
<tbody id="measurements">
<%= render(@measurements) || render_no_items %>
<%= render(@measurements) %>
</tbody>
</table>
+5 -4
View File
@@ -6,15 +6,16 @@
<%= readout.quantity.relative_pathname(@superquantity) %>
<%= form.hidden_field :quantity_id %>
</td>
<td>
<%= form.number_field :value, required: true, autofocus: readout_counter == 0 %>
<td class="hexpand">
<%= form.number_field :value, class: 'hminnumber hstretch', required: true,
autofocus: readout_counter == 0 %>
</td>
<td>
<%= form.collection_select :unit_id, @user_units, :id,
->(u){ sanitize('&emsp;' * (u.base_id ? 1 : 0) + u.symbol) },
{prompt: '', disabled: '', selected: ''}, required: true %>
{prompt: '', disabled: '', selected: ''}, class: 'hstretch', required: true %>
</td>
<td class="flex">
<td>
<%# 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),