From 5f26394947d1150e2656bb22c5858ae5edcdcac7 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 24 Jul 2026 17:20:22 +0200 Subject: Polish the OTP flows: autocomplete tokens, button dialect, QR sizing, my-account link --- app/views/users/edit.html.erb | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'app/views/users/edit.html.erb') diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 8d14a058..8adad789 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,4 +1,4 @@ -

Edit existing user

+

<%= @user == current_user ? "My account" : "Edit user “#{@user.login}”" %>

<% if @user.errors.any? %>
@@ -10,16 +10,16 @@ <%= form_for @user do |f| %>
Login
-
<%= f.text_field :login %>
+
<%= f.text_field :login, :autocomplete => "username" %>
E-Mail
<%= f.text_field :email %>
Password
-
<%= f.password_field :password %>
+
<%= f.password_field :password, :autocomplete => "new-password" %>
Confirm
-
<%= f.password_field :password_confirmation %>
+
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
<% if current_user.admin? %>
Admin?
@@ -36,17 +36,23 @@
<% if current_user.otp_enrolled? %>

Enabled.

- <%= form_tag otp_enrollment_path, :method => :delete do %> - <%= password_field_tag :current_password, nil, :placeholder => "Current password" %> + <%= form_tag otp_enrollment_path, :method => :delete, :class => "otp_form" do %> + <%= text_field_tag :login, current_user.login, :autocomplete => "username", :readonly => true, :tabindex => -1, :class => "visually_hidden" %> + <%= password_field_tag :current_password, nil, :placeholder => "Current password", :autocomplete => "current-password" %> <%= text_field_tag :code, nil, :placeholder => "Current code", :autocomplete => "one-time-code", :inputmode => "numeric" %> - <%= submit_tag "Disable second factor" %> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> Disable second factor + <% end %> <% end %> <% else %>

Not enrolled.

- <%= form_tag otp_enrollment_path, :method => :post do %> - <%= password_field_tag :current_password, nil, :placeholder => "Current password" %> - <%= submit_tag "Enable second factor" %> + <%= form_tag otp_enrollment_path, :method => :post, :class => "otp_form" do %> + <%= text_field_tag :login, current_user.login, :autocomplete => "username", :readonly => true, :tabindex => -1, :class => "visually_hidden" %> + <%= password_field_tag :current_password, nil, :placeholder => "Current password", :autocomplete => "current-password"%> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> Enable second factor + <% end %> <% end %> <% end %>
-- cgit v1.3