From a6f068a93bda0ad501d793ad36448301941a1fa3 Mon Sep 17 00:00:00 2001 From: hazycora Date: Tue, 26 Sep 2023 00:34:09 -0500 Subject: [PATCH] use dropdown for pronoun input --- options/locale/locale_en-US.ini | 1 + routers/web/user/setting/profile.go | 2 ++ templates/user/settings/profile.tmpl | 52 ++++++++++++++++++++++++++-- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d099e7820..b7237711d 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -702,6 +702,7 @@ full_name = Full name website = Website location = Location pronouns = Pronouns +pronouns_custom = Custom update_theme = Change theme update_profile = Update profile update_language = Change language diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go index b5d916b78..6843340fe 100644 --- a/routers/web/user/setting/profile.go +++ b/routers/web/user/setting/profile.go @@ -46,6 +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 != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" ctx.HTML(http.StatusOK, tplSettingsProfile) } @@ -56,6 +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 != "he/him" && ctx.Doer.Pronouns != "she/her" && ctx.Doer.Pronouns != "they/them" && ctx.Doer.Pronouns != "it/its" if ctx.HasError() { ctx.HTML(http.StatusOK, tplSettingsProfile) diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index ac8260613..7638727e8 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -37,9 +37,55 @@ -
- - +
+ + + +