Merge corrections provided by Bambuch, cont.

This commit is contained in:
cryptogopher 2025-04-26 19:12:56 +02:00
parent cd9a64b5ad
commit 9dbcfddf98
9 changed files with 22 additions and 18 deletions

View File

@ -172,6 +172,7 @@ input[type=checkbox]:checked {
} }
/* Hide spin buttons in input number fields */ /* Hide spin buttons in input number fields */
input[type=number] { input[type=number] {
appearance: textfield;
-moz-appearance: textfield; -moz-appearance: textfield;
} }
input::-webkit-inner-spin-button { input::-webkit-inner-spin-button {

View File

@ -106,7 +106,7 @@ function dragLeave(event) {
if (event.timeStamp <= lastEnterTime) return; if (event.timeStamp <= lastEnterTime) return;
event.currentTarget.closest("table").querySelectorAll(".dropzone").forEach((tr) => { event.currentTarget.closest("table").querySelectorAll(".dropzone").forEach((tr) => {
tr.classList.remove("dropzone"); tr.classList.remove("dropzone");
}) });
} }
window.dragLeave = dragLeave; window.dragLeave = dragLeave;

View File

@ -7,9 +7,10 @@ class User < ApplicationRecord
admin: 4, # admin level access admin: 4, # admin level access
active: 3, # read-write user level access active: 3, # read-write user level access
restricted: 2, # read-only user level access restricted: 2, # read-only user level access
locked: 1, # disallowed to sign in due to failed logins; maintained by Devise :lockable locked: 1, # disallowed to sign in due to failed logins; maintained by
# Devise :lockable
disabled: 0, # administratively disallowed to sign in disabled: 0, # administratively disallowed to sign in
}, default: :active }, default: :active, validate: true
has_many :readouts, dependent: :destroy has_many :readouts, dependent: :destroy
accepts_nested_attributes_for :readouts accepts_nested_attributes_for :readouts

View File

@ -4,7 +4,7 @@
<%# TODO: show hint when no quantities/units defined %> <%# TODO: show hint when no quantities/units defined %>
<div class="hflex"> <div class="hflex">
<%= select_tag :id, options_from_collection_for_select( <%= select_tag :id, options_from_collection_for_select(
@quantities, :id, ->(q){ sanitize('&emsp;'*q.depth + q.name) } @quantities, :id, ->(q){ sanitize('&emsp;' * q.depth + q.name) }
), form: :new_readouts_form %> ), form: :new_readouts_form %>
<% common_options = {form: :new_readouts_form, formaction: new_measurement_path, <% common_options = {form: :new_readouts_form, formaction: new_measurement_path,
formmethod: :get, formnovalidate: true, formmethod: :get, formnovalidate: true,

View File

@ -1,6 +1,6 @@
<%= turbo_stream.close_form dom_id(@quantity.parent || Quantity, :new) %> <%= turbo_stream.close_form dom_id(@quantity.parent || Quantity, :new) %>
<%= turbo_stream.remove :no_items %> <%= turbo_stream.remove :no_items %>
<% @ancestors.map do |ancestor| %> <% @ancestors.each do |ancestor| %>
<%= turbo_stream.replace ancestor %> <%= turbo_stream.replace ancestor %>
<% end %> <% end %>
<%= @before ? turbo_stream.before(@before, @quantity) : <%= @before ? turbo_stream.before(@before, @quantity) :

View File

@ -1,4 +1,4 @@
<% @ancestors.map do |ancestor| %> <% @ancestors.each do |ancestor| %>
<%= turbo_stream.replace ancestor %> <%= turbo_stream.replace ancestor %>
<% end %> <% end %>
<%= turbo_stream.remove @quantity %> <%= turbo_stream.remove @quantity %>

View File

@ -1,7 +1,7 @@
<% @self_and_progenies.each do |q| %> <% @self_and_progenies.each do |q| %>
<%= turbo_stream.remove q %> <%= turbo_stream.remove q %>
<% end %> <% end %>
<% @previous_ancestors.union(@ancestors).map do |ancestor| %> <% @previous_ancestors.union(@ancestors).each do |ancestor| %>
<%= turbo_stream.replace ancestor %> <%= turbo_stream.replace ancestor %>
<% end %> <% end %>
<% @self_and_progenies.each do |q| %> <% @self_and_progenies.each do |q| %>

View File

@ -1,4 +1,4 @@
<%= turbo_stream.close_form dom_id(@quantity, :edit) %> <%= turbo_stream.close_form dom_id(@quantity, :edit) %>
<% @ancestors.push(@quantity).map do |ancestor| %> <% @ancestors.push(@quantity).each do |ancestor| %>
<%= turbo_stream.replace ancestor %> <%= turbo_stream.replace ancestor %>
<% end %> <% end %>

View File

@ -4,7 +4,9 @@
<th><%= User.human_attribute_name(:email).capitalize %></th> <th><%= User.human_attribute_name(:email).capitalize %></th>
<th><%= User.human_attribute_name(:status).capitalize %></th> <th><%= User.human_attribute_name(:status).capitalize %></th>
<th><%= User.human_attribute_name(:confirmed_at).capitalize %></th> <th><%= User.human_attribute_name(:confirmed_at).capitalize %></th>
<th><%= User.human_attribute_name(:created_at).capitalize %>&nbsp;<sup>UTC</sup></th> <th>
<%= User.human_attribute_name(:created_at).capitalize %>&nbsp;<sup>UTC</sup>
</th>
<th><%= t :actions %></th> <th><%= t :actions %></th>
</tr> </tr>
</thead> </thead>
@ -22,15 +24,15 @@
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
<td class="svg"> <td class="svg">
<%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %> <%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %>
</td> </td>
<td><%= user.created_at.to_fs(:db_without_sec) %></td> <td><%= user.created_at.to_fs(:db_without_sec) %></td>
<td class="actions"> <td class="actions">
<% if allow_disguise?(user) %> <% if allow_disguise?(user) %>
<%= image_link_to t(".disguise"), "incognito", disguise_user_path(user) %> <%= image_link_to t(".disguise"), "incognito", disguise_user_path(user) %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>