Add autocomplete attributes to profile fields

This commit is contained in:
jordi fita mas 2023-02-01 11:37:13 +01:00
parent b8b3d73e95
commit 4f13fa58dc
1 changed files with 12 additions and 0 deletions

View File

@ -29,22 +29,34 @@ func newProfileForm(ctx context.Context, conn *Conn, locale *Locale) *profileFor
Label: pgettext("input", "User name", locale), Label: pgettext("input", "User name", locale),
Type: "text", Type: "text",
Required: true, Required: true,
Attributes: []*Attribute{
{"autocomplete", "name"},
},
}, },
Email: &InputField{ Email: &InputField{
Name: "email", Name: "email",
Label: pgettext("input", "Email", locale), Label: pgettext("input", "Email", locale),
Type: "email", Type: "email",
Required: true, Required: true,
Attributes: []*Attribute{
{"autocomplete", "username"},
},
}, },
Password: &InputField{ Password: &InputField{
Name: "password", Name: "password",
Label: pgettext("input", "Password", locale), Label: pgettext("input", "Password", locale),
Type: "password", Type: "password",
Attributes: []*Attribute{
{"autocomplete", "new-password"},
},
}, },
PasswordConfirm: &InputField{ PasswordConfirm: &InputField{
Name: "password_confirm", Name: "password_confirm",
Label: pgettext("input", "Password Confirmation", locale), Label: pgettext("input", "Password Confirmation", locale),
Type: "password", Type: "password",
Attributes: []*Attribute{
{"autocomplete", "new-password"},
},
}, },
Language: &SelectField{ Language: &SelectField{
Name: "language", Name: "language",