1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00

Fix labels referencing the wrong ID in the user profile settings (#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 <git@yardenshoham.com>
This commit is contained in:
Yarden Shoham 2024-02-17 17:01:25 +02:00 committed by GitHub
parent 0157db84b1
commit 1d275c1748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -22,8 +22,8 @@
<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100"> <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
</div> </div>
<div class="field {{if .Err_Email}}error{{end}}"> <div class="field {{if .Err_Email}}error{{end}}">
<label for="email">{{ctx.Locale.Tr "email"}}</label> <label>{{ctx.Locale.Tr "email"}}</label>
<p>{{.SignedUser.Email}}</p> <p id="signed-user-email">{{.SignedUser.Email}}</p>
</div> </div>
<div class="field {{if .Err_Description}}error{{end}}"> <div class="field {{if .Err_Description}}error{{end}}">
<label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label> <label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label>
@ -42,11 +42,11 @@
<!-- private block --> <!-- private block -->
<div class="field" id="privacy-user-settings"> <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>
<div class="inline field {{if .Err_Visibility}}error{{end}}"> <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"> <div class="ui selection type dropdown">
{{if .SignedUser.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}} {{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}} {{if .SignedUser.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}}
@ -120,8 +120,8 @@
</div> </div>
<div class="inline field gt-pl-4"> <div class="inline field gt-pl-4">
<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> <label for="new-avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> <input id="new-avatar" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
</div> </div>
<div class="field"> <div class="field">

View File

@ -179,7 +179,7 @@ func TestLDAPUserSignin(t *testing.T) {
assert.Equal(t, u.UserName, htmlDoc.GetInputValueByName("name")) assert.Equal(t, u.UserName, htmlDoc.GetInputValueByName("name"))
assert.Equal(t, u.FullName, htmlDoc.GetInputValueByName("full_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) { func TestLDAPAuthChange(t *testing.T) {