From 90207029de7474082310d0725801d60f7145fa98 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 24 Jul 2026 22:08:05 +0200 Subject: Extract admin strings to i18n: sessions, otp, users/edit --- app/views/users/edit.html.erb | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'app/views/users') diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index a8994701..ea5e7dec 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,4 +1,4 @@ -

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

+

<%= @user == current_user ? t(".my_account") : t(".edit_user", :login => @user.login) %>

<% if @user.errors.any? %>
@@ -9,61 +9,60 @@
<%= form_for @user do |f| %>
-
Login
+
<%= t(".login") %>
<%= f.text_field :login, :autocomplete => "username" %>
-
E-Mail
+
<%= t(".email") %>
<%= f.text_field :email %>
-
Password
+
<%= t(".password") %>
<%= f.password_field :password, :autocomplete => "new-password" %>
-
Confirm
+
<%= t(".confirm") %>
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
<% if current_user.admin? %> -
Admin?
+
<%= t(".admin") %>
<%= f.check_box :admin %>
<% end %>
-
<%= f.submit "Update" %>
+
<%= submit_tag t(".update") %>
<% end %>
<% if @user == current_user %> -
Second factor
+
<%= t(".second_factor") %>
<% if current_user.otp_enrolled? %> -

Enabled.

+

<%= t(".enabled") %>

<%= 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", + <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password" %> + <%= text_field_tag :code, nil, :placeholder => t(".current_code"), :autocomplete => "one-time-code", :inputmode => "numeric" %> <%= button_tag :type => "submit", :class => "action_button" do %> - <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> Disable second factor + <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> <%= t(".disable_second_factor") %> <% end %> <% end %> <% else %> -

Not enrolled.

+

<%= t(".not_enrolled") %>

<%= 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"%> + <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password"%> <%= button_tag :type => "submit", :class => "action_button" do %> - <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> Enable second factor + <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> <%= t(".enable_second_factor") %> <% end %> <% end %> <% end %>
<% elsif current_user.admin? && @user.otp_enrolled? %> -
Second factor
+
<%= t(".second_factor") %>
- Enabled. - <%= button_to "Reset second factor", reset_otp_user_path(@user), :method => :put, + <%= t(".enabled") %> + <%= button_to t(".reset_second_factor"), reset_otp_user_path(@user), :method => :put, :form_class => "button_to destructive", - :form => { :data => { :confirm => - "Reset #{@user.login}'s second factor? They will log in with password only afterwards." } } %> + :form => { :data => { :confirm => t(".reset_confirm", :login => @user.login) } } %>
<% end %>
-- cgit v1.3