1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-01 17:38:33 +00:00

Merge pull request 'Add optional pronoun field in user settings' (#1518) from hazy/forgejo:feat/pronoun-field into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1518
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
This commit is contained in:
Gusted 2024-04-06 12:23:54 +00:00
commit d8eebe7698
21 changed files with 331 additions and 1 deletions

View file

@ -61,6 +61,10 @@
<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
<input id="full_name" name="full_name" value="{{.User.FullName}}" maxlength="100">
</div>
<div class="field">
<label for="pronouns">{{ctx.Locale.Tr "settings.pronouns"}}</label>
<input id="pronouns" name="pronouns" value="{{.User.Pronouns}}" maxlength="50">
</div>
<div class="required field {{if .Err_Email}}error{{end}}">
<label for="email">{{ctx.Locale.Tr "email"}}</label>
<input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required>

View file

@ -13,7 +13,7 @@
</div>
<div class="content gt-word-break profile-avatar-name">
{{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
<span class="username text center">{{.ContextUser.Name}} {{if .IsAdmin}}
<span class="username text center">{{.ContextUser.Name}}{{if .ContextUser.Pronouns}} · {{.ContextUser.Pronouns}}{{end}} {{if .IsAdmin}}
<a class="muted" href="{{AppSubUrl}}/admin/users/{{.ContextUser.ID}}" data-tooltip-content="{{ctx.Locale.Tr "admin.users.details"}}">
{{svg "octicon-gear" 18}}
</a>

View file

@ -20331,6 +20331,10 @@
"type": "boolean",
"x-go-name": "ProhibitLogin"
},
"pronouns": {
"type": "string",
"x-go-name": "Pronouns"
},
"restricted": {
"type": "boolean",
"x-go-name": "Restricted"
@ -23830,6 +23834,11 @@
"type": "boolean",
"x-go-name": "ProhibitLogin"
},
"pronouns": {
"description": "the user's pronouns",
"type": "string",
"x-go-name": "Pronouns"
},
"restricted": {
"description": "Is user restricted",
"type": "boolean",
@ -23905,6 +23914,10 @@
"type": "string",
"x-go-name": "Location"
},
"pronouns": {
"type": "string",
"x-go-name": "Pronouns"
},
"theme": {
"type": "string",
"x-go-name": "Theme"
@ -23953,6 +23966,10 @@
"type": "string",
"x-go-name": "Location"
},
"pronouns": {
"type": "string",
"x-go-name": "Pronouns"
},
"theme": {
"type": "string",
"x-go-name": "Theme"

View file

@ -21,6 +21,36 @@
<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
</div>
<div class="inline field">
<span class="inline field"><label for="pronouns">{{ctx.Locale.Tr "settings.pronouns"}}</label></span>
<div id="pronouns-dropdown" style="display: none" class="ui selection dropdown">
<input type="hidden" value="{{.SignedUser.Pronouns}}">
<div class="text">
{{if .PronounsAreCustom}}
{{ctx.Locale.Tr "settings.pronouns_custom"}}
{{else if eq "" .SignedUser.Pronouns}}
{{ctx.Locale.Tr "settings.pronouns_unspecified"}}
{{else}}
{{.SignedUser.Pronouns}}
{{end}}
</div>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item{{if eq "" .SignedUser.Pronouns}} active selected{{end}}" data-value=""><i>{{ctx.Locale.Tr "settings.pronouns_unspecified"}}</i></div>
<div class="item{{if eq "he/him" .SignedUser.Pronouns}} active selected{{end}}" data-value="he/him">he/him</div>
<div class="item{{if eq "she/her" .SignedUser.Pronouns}} active selected{{end}}" data-value="she/her">she/her</div>
<div class="item{{if eq "they/them" .SignedUser.Pronouns}} active selected{{end}}" data-value="they/them">they/them</div>
<div class="item{{if eq "it/its" .SignedUser.Pronouns}} active selected{{end}}" data-value="it/its">it/its</div>
<div class="item{{if eq "any pronouns" .SignedUser.Pronouns}} active selected{{end}}" data-value="any pronouns">any pronouns</div>
{{if .PronounsAreCustom}}
<div class="item active selected" data-value="{{.SignedUser.Pronouns}}"><i>{{ctx.Locale.Tr "settings.pronouns_custom"}}</i></div>
{{else}}
<div class="item" data-value="!"><i>{{ctx.Locale.Tr "settings.pronouns_custom"}}</i></div>
{{end}}
</div>
</div>
<input id="pronouns-custom" name="pronouns" value="{{.SignedUser.Pronouns}}" maxlength="50">
</div>
<div class="field {{if .Err_Email}}error{{end}}">
<label>{{ctx.Locale.Tr "email"}}</label>
<p id="signed-user-email">{{.SignedUser.Email}}</p>