From bb96d5623e58f9042d4561e4022803d49fe2619c Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Thu, 7 Dec 2023 15:39:37 +0100 Subject: [PATCH 1/2] backend --- routers/web/admin/users.go | 1 + services/forms/admin.go | 1 + 2 files changed, 2 insertions(+) diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go index 44c4fa7512548..d5e13bd1e6ce0 100644 --- a/routers/web/admin/users.go +++ b/routers/web/admin/users.go @@ -442,6 +442,7 @@ func EditUserPost(ctx *context.Context) { u.Email = form.Email u.Website = form.Website u.Location = form.Location + u.Language = form.Language u.MaxRepoCreation = form.MaxRepoCreation u.IsActive = form.Active u.IsAdmin = form.Admin diff --git a/services/forms/admin.go b/services/forms/admin.go index 4b3cacc606f7d..b241960406926 100644 --- a/services/forms/admin.go +++ b/services/forms/admin.go @@ -41,6 +41,7 @@ type AdminEditUserForm struct { Password string `binding:"MaxSize(255)"` Website string `binding:"ValidUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` + Language string `binding:"MaxSize(5)"` MaxRepoCreation int Active bool Admin bool From eb47d06d9fdd846b0154fb74c2b51ce1c004be8e Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 13 Dec 2023 05:54:11 +0100 Subject: [PATCH 2/2] frontend --- templates/admin/user/edit.tmpl | 15 +++++++++++++++ templates/admin/user/view_details.tmpl | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index fcb8ce08277fb..159c8210993fc 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -70,6 +70,21 @@

{{ctx.Locale.Tr "admin.users.password_helper"}}

+ +
+ + +
+
diff --git a/templates/admin/user/view_details.tmpl b/templates/admin/user/view_details.tmpl index 21425eecb4c3e..be2f32b5ec7de 100644 --- a/templates/admin/user/view_details.tmpl +++ b/templates/admin/user/view_details.tmpl @@ -48,6 +48,14 @@ {{svg "octicon-x"}} {{end}}
+ {{if .User.Language}} +
+ + {{ctx.Locale.Tr "settings.language"}}: + {{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}} + +
+ {{end}} {{if .User.Location}}
{{svg "octicon-location"}}{{.User.Location}}