mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge pull request #21249 from opf/fix-login-input-ids
use different ids for login form inputs in pulldown
This commit is contained in:
@@ -37,6 +37,7 @@ class LoginForm < ApplicationForm
|
||||
|
||||
f.text_field(
|
||||
name: :username,
|
||||
id: "username#{@id_suffix}",
|
||||
value: @username,
|
||||
autofocus: @username.blank?,
|
||||
label: User.human_attribute_name(:login),
|
||||
@@ -46,6 +47,7 @@ class LoginForm < ApplicationForm
|
||||
|
||||
f.text_field(
|
||||
name: :password,
|
||||
id: "password#{@id_suffix}",
|
||||
type: :password,
|
||||
autofocus: @username.present?,
|
||||
label: User.human_attribute_name(:password),
|
||||
@@ -55,6 +57,7 @@ class LoginForm < ApplicationForm
|
||||
|
||||
if Setting::Autologin.enabled?
|
||||
f.check_box name: "autologin",
|
||||
id: "autologin#{@id_suffix}",
|
||||
checked: false,
|
||||
value: 1,
|
||||
label: I18n.t("users.autologins.prompt",
|
||||
@@ -85,9 +88,10 @@ class LoginForm < ApplicationForm
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(back_url: nil, username: nil)
|
||||
def initialize(back_url: nil, username: nil, id_suffix: nil)
|
||||
super()
|
||||
@back_url = back_url
|
||||
@username = username
|
||||
@id_suffix = id_suffix
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +33,14 @@ See COPYRIGHT and LICENSE files for more details.
|
||||
url: { controller: "/account", action: "login" },
|
||||
method: :post
|
||||
) do |form_builder|
|
||||
render(LoginForm.new(form_builder, back_url: back_url_to_current_page, username: params[:username]))
|
||||
render(
|
||||
LoginForm.new(
|
||||
form_builder,
|
||||
back_url: back_url_to_current_page,
|
||||
username: params[:username],
|
||||
id_suffix: "-pulldown"
|
||||
)
|
||||
)
|
||||
end
|
||||
%>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user