From 12e00abe29b7fbc091658897a711e659a67fbc7a Mon Sep 17 00:00:00 2001 From: hazycora Date: Tue, 26 Sep 2023 12:54:18 -0500 Subject: [PATCH] add any/all pronoun option to dropdown --- routers/web/user/setting/profile.go | 4 ++-- templates/user/settings/profile.tmpl | 1 + web_src/js/features/user-settings.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go index 1b1cdb54d4..7a2f6ba46d 100644 --- a/routers/web/user/setting/profile.go +++ b/routers/web/user/setting/profile.go @@ -46,7 +46,7 @@ func Profile(ctx *context.Context) { ctx.Data["PageIsSettingsProfile"] = true ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() ctx.Data["DisableGravatar"] = setting.Config().Picture.DisableGravatar.Value(ctx) - ctx.Data["PronounsAreCustom"] = ctx.Doer.Pronouns != "" && ctx.Doer.Pronouns != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" + ctx.Data["PronounsAreCustom"] = ctx.Doer.Pronouns != "" && ctx.Doer.Pronouns != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" && ctx.Doer.Pronouns != "any/all" ctx.HTML(http.StatusOK, tplSettingsProfile) } @@ -57,7 +57,7 @@ func ProfilePost(ctx *context.Context) { ctx.Data["PageIsSettingsProfile"] = true ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() ctx.Data["DisableGravatar"] = setting.Config().Picture.DisableGravatar.Value(ctx) - ctx.Data["PronounsAreCustom"] = ctx.Doer.Pronouns != "" && ctx.Doer.Pronouns != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" + ctx.Data["PronounsAreCustom"] = ctx.Doer.Pronouns != "" && ctx.Doer.Pronouns != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" && ctx.Doer.Pronouns != "any/all" if ctx.HasError() { ctx.HTML(http.StatusOK, tplSettingsProfile) diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 0a576f9d3b..4a9074eb4d 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -57,6 +57,7 @@
she/her
they/them
it/its
+
any/all
{{if .PronounsAreCustom}}
{{.locale.Tr "settings.pronouns_custom"}}
{{else}} diff --git a/web_src/js/features/user-settings.js b/web_src/js/features/user-settings.js index ec99f168fe..5ad8bd94d4 100644 --- a/web_src/js/features/user-settings.js +++ b/web_src/js/features/user-settings.js @@ -9,7 +9,8 @@ function onPronounsDropdownUpdate() { pronounsInput.value === 'he/him' || pronounsInput.value === 'she/her' || pronounsInput.value === 'they/them' || - pronounsInput.value === 'it/its' + pronounsInput.value === 'it/its' || + pronounsInput.value === 'any/all' ); if (isCustom) { if (pronounsInput.value === '!') {