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.join.html_safe
end end
# TODO: remove from Default::Units and delete
def render_no_items def render_no_items
tag.tr id: :no_items do tag.tr id: :no_items do
tag.td t("#{controller_path.tr('/', '.')}.no_items"), colspan: 10, class: 'hint' tag.td t("#{controller_path.tr('/', '.')}.no_items"), colspan: 10, class: 'hint'
+2 -1
View File
@@ -8,7 +8,8 @@
</div> </div>
<table class="main-area"> <table class="main-area">
<caption class="hint"><%= t '.no_items' %></caption>
<tbody id="measurements"> <tbody id="measurements">
<%= render(@measurements) || render_no_items %> <%= render(@measurements) %>
</tbody> </tbody>
</table> </table>
+5 -4
View File
@@ -6,15 +6,16 @@
<%= readout.quantity.relative_pathname(@superquantity) %> <%= readout.quantity.relative_pathname(@superquantity) %>
<%= form.hidden_field :quantity_id %> <%= form.hidden_field :quantity_id %>
</td> </td>
<td> <td class="hexpand">
<%= form.number_field :value, required: true, autofocus: readout_counter == 0 %> <%= form.number_field :value, class: 'hminnumber hstretch', required: true,
autofocus: readout_counter == 0 %>
</td> </td>
<td> <td>
<%= form.collection_select :unit_id, @user_units, :id, <%= form.collection_select :unit_id, @user_units, :id,
->(u){ sanitize('&emsp;' * (u.base_id ? 1 : 0) + u.symbol) }, ->(u){ sanitize('&emsp;' * (u.base_id ? 1 : 0) + u.symbol) },
{prompt: '', disabled: '', selected: ''}, required: true %> {prompt: '', disabled: '', selected: ''}, class: 'hstretch', required: true %>
</td> </td>
<td class="flex"> <td>
<%# TODO: change to _link_ after giving up displaying relative paths %> <%# TODO: change to _link_ after giving up displaying relative paths %>
<%= image_button_tag '', 'delete-outline', class: 'dangerous', name: nil, <%= image_button_tag '', 'delete-outline', class: 'dangerous', name: nil,
formaction: discard_readouts_path(readout.quantity), formaction: discard_readouts_path(readout.quantity),
+1 -1
View File
@@ -98,12 +98,12 @@ en:
source_code: Get code source_code: Get code
measurements: measurements:
navigation: Measurements navigation: Measurements
no_items: There are no measurements taken. You can Add some now.
form: form:
select_quantity: select quantities... select_quantity: select quantities...
taken_at_html: Measurement taken at&emsp; taken_at_html: Measurement taken at&emsp;
index: index:
new_measurement: Add measurement new_measurement: Add measurement
no_items: There are no measurements taken. You can Add some now.
quantities: quantities:
navigation: Quantities navigation: Quantities
quantity: quantity: