Skip to content

Fix labels referencing the wrong ID in the user profile settings #29199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 17, 2024
12 changes: 6 additions & 6 deletions templates/user/settings/profile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
</div>
<div class="field {{if .Err_Email}}error{{end}}">
<label for="email">{{ctx.Locale.Tr "email"}}</label>
<p>{{.SignedUser.Email}}</p>
<label>{{ctx.Locale.Tr "email"}}</label>
<p id="signed-user-email">{{.SignedUser.Email}}</p>
</div>
<div class="field {{if .Err_Description}}error{{end}}">
<label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label>
Expand All @@ -42,11 +42,11 @@
<!-- private block -->

<div class="field" id="privacy-user-settings">
<label for="security-private"><strong>{{ctx.Locale.Tr "settings.privacy"}}</strong></label>
<label><strong>{{ctx.Locale.Tr "settings.privacy"}}</strong></label>
</div>

<div class="inline field {{if .Err_Visibility}}error{{end}}">
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
<span class="inline required field"><label>{{ctx.Locale.Tr "settings.visibility"}}</label></span>
<div class="ui selection type dropdown">
{{if .SignedUser.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}}
{{if .SignedUser.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}}
Expand Down Expand Up @@ -120,8 +120,8 @@
</div>

<div class="inline field gt-pl-4">
<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
<label for="new-avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
<input id="new-avatar" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
</div>

<div class="field">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/auth_ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestLDAPUserSignin(t *testing.T) {

assert.Equal(t, u.UserName, htmlDoc.GetInputValueByName("name"))
assert.Equal(t, u.FullName, htmlDoc.GetInputValueByName("full_name"))
assert.Equal(t, u.Email, htmlDoc.Find(`label[for="email"]`).Siblings().First().Text())
assert.Equal(t, u.Email, htmlDoc.Find("#signed-user-email").Text())
}

func TestLDAPAuthChange(t *testing.T) {
Expand Down