Skip to content

Commit 09111d7

Browse files
yardenshohamsilverwind
authored andcommitted
Fix labels referencing the wrong ID in the user profile settings (go-gitea#29199)
2 instances of `for` with a wrong value and 1 `for` that had a reference to a `name` instead of `id`. --------- Signed-off-by: Yarden Shoham <[email protected]>
1 parent e836e54 commit 09111d7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

templates/user/settings/profile.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
2323
</div>
2424
<div class="field {{if .Err_Email}}error{{end}}">
25-
<label for="email">{{ctx.Locale.Tr "email"}}</label>
26-
<p>{{.SignedUser.Email}}</p>
25+
<label>{{ctx.Locale.Tr "email"}}</label>
26+
<p id="signed-user-email">{{.SignedUser.Email}}</p>
2727
</div>
2828
<div class="field {{if .Err_Description}}error{{end}}">
2929
<label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label>
@@ -42,11 +42,11 @@
4242
<!-- private block -->
4343

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

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

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

127127
<div class="field">

tests/integration/auth_ldap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestLDAPUserSignin(t *testing.T) {
179179

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

185185
func TestLDAPAuthChange(t *testing.T) {

0 commit comments

Comments
 (0)