diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 17:20:22 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 17:20:22 +0200 |
| commit | 5f26394947d1150e2656bb22c5858ae5edcdcac7 (patch) | |
| tree | 2aca70e25cfc9809cde0efdfad52854cdc7381e8 /app/views/users | |
| parent | dcb576618b868b888a5b1b31e35491f300ce4050 (diff) | |
Polish the OTP flows: autocomplete tokens, button dialect, QR sizing, my-account link
Diffstat (limited to 'app/views/users')
| -rw-r--r-- | app/views/users/edit.html.erb | 26 |
1 files changed, 16 insertions, 10 deletions
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 @@ | |||
| 1 | <h1>Edit existing user</h1> | 1 | <h1><%= @user == current_user ? "My account" : "Edit user “#{@user.login}”" %></h1> |
| 2 | 2 | ||
| 3 | <% if @user.errors.any? %> | 3 | <% if @user.errors.any? %> |
| 4 | <div class="error_messages"> | 4 | <div class="error_messages"> |
| @@ -10,16 +10,16 @@ | |||
| 10 | <%= form_for @user do |f| %> | 10 | <%= form_for @user do |f| %> |
| 11 | <div id="content"> | 11 | <div id="content"> |
| 12 | <div class="node_description">Login</div> | 12 | <div class="node_description">Login</div> |
| 13 | <div class="node_content"><%= f.text_field :login %></div> | 13 | <div class="node_content"><%= f.text_field :login, :autocomplete => "username" %></div> |
| 14 | 14 | ||
| 15 | <div class="node_description">E-Mail</div> | 15 | <div class="node_description">E-Mail</div> |
| 16 | <div class="node_content"><%= f.text_field :email %></div> | 16 | <div class="node_content"><%= f.text_field :email %></div> |
| 17 | 17 | ||
| 18 | <div class="node_description">Password</div> | 18 | <div class="node_description">Password</div> |
| 19 | <div class="node_content"><%= f.password_field :password %></div> | 19 | <div class="node_content"><%= f.password_field :password, :autocomplete => "new-password" %></div> |
| 20 | 20 | ||
| 21 | <div class="node_description">Confirm</div> | 21 | <div class="node_description">Confirm</div> |
| 22 | <div class="node_content"><%= f.password_field :password_confirmation %></div> | 22 | <div class="node_content"><%= f.password_field :password_confirmation, :autocomplete => "new-password" %></div> |
| 23 | 23 | ||
| 24 | <% if current_user.admin? %> | 24 | <% if current_user.admin? %> |
| 25 | <div class="node_description">Admin?</div> | 25 | <div class="node_description">Admin?</div> |
| @@ -36,17 +36,23 @@ | |||
| 36 | <div class="node_content"> | 36 | <div class="node_content"> |
| 37 | <% if current_user.otp_enrolled? %> | 37 | <% if current_user.otp_enrolled? %> |
| 38 | <p>Enabled.</p> | 38 | <p>Enabled.</p> |
| 39 | <%= form_tag otp_enrollment_path, :method => :delete do %> | 39 | <%= form_tag otp_enrollment_path, :method => :delete, :class => "otp_form" do %> |
| 40 | <%= password_field_tag :current_password, nil, :placeholder => "Current password" %> | 40 | <%= text_field_tag :login, current_user.login, :autocomplete => "username", :readonly => true, :tabindex => -1, :class => "visually_hidden" %> |
| 41 | <%= password_field_tag :current_password, nil, :placeholder => "Current password", :autocomplete => "current-password" %> | ||
| 41 | <%= text_field_tag :code, nil, :placeholder => "Current code", | 42 | <%= text_field_tag :code, nil, :placeholder => "Current code", |
| 42 | :autocomplete => "one-time-code", :inputmode => "numeric" %> | 43 | :autocomplete => "one-time-code", :inputmode => "numeric" %> |
| 43 | <%= submit_tag "Disable second factor" %> | 44 | <%= button_tag :type => "submit", :class => "action_button" do %> |
| 45 | <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> Disable second factor | ||
| 46 | <% end %> | ||
| 44 | <% end %> | 47 | <% end %> |
| 45 | <% else %> | 48 | <% else %> |
| 46 | <p>Not enrolled.</p> | 49 | <p>Not enrolled.</p> |
| 47 | <%= form_tag otp_enrollment_path, :method => :post do %> | 50 | <%= form_tag otp_enrollment_path, :method => :post, :class => "otp_form" do %> |
| 48 | <%= password_field_tag :current_password, nil, :placeholder => "Current password" %> | 51 | <%= text_field_tag :login, current_user.login, :autocomplete => "username", :readonly => true, :tabindex => -1, :class => "visually_hidden" %> |
| 49 | <%= submit_tag "Enable second factor" %> | 52 | <%= password_field_tag :current_password, nil, :placeholder => "Current password", :autocomplete => "current-password"%> |
| 53 | <%= button_tag :type => "submit", :class => "action_button" do %> | ||
| 54 | <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> Enable second factor | ||
| 55 | <% end %> | ||
| 50 | <% end %> | 56 | <% end %> |
| 51 | <% end %> | 57 | <% end %> |
| 52 | </div> | 58 | </div> |
