loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add option to set language in admin user view (#28449)

![image](https://github.com/go-gitea/gitea/assets/24977596/be7e3f92-af3f-4628-b4ed-abf6439687f3)
`/admin/users/<UserID>/edit`

![image](https://github.com/go-gitea/gitea/assets/24977596/906af0dd-cceb-4ed9-9cd9-32c71ae1bf71)
`/admin/users/<UserID>`

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit e3e6569c5fd8c69aa65384e6d1636cc14b23a32b)

authored by

6543 and committed by
Earl Warren
318634ef 1e29bccd

+25
+1
routers/web/admin/users.go
··· 439 439 AllowCreateOrganization: optional.Some(form.AllowCreateOrganization), 440 440 IsRestricted: optional.Some(form.Restricted), 441 441 Visibility: optional.Some(form.Visibility), 442 + Language: optional.Some(form.Language), 442 443 } 443 444 444 445 if err := user_service.UpdateUser(ctx, u, opts); err != nil {
+1
services/forms/admin.go
··· 41 41 Password string `binding:"MaxSize(255)"` 42 42 Website string `binding:"ValidUrl;MaxSize(255)"` 43 43 Location string `binding:"MaxSize(50)"` 44 + Language string `binding:"MaxSize(5)"` 44 45 MaxRepoCreation int 45 46 Active bool 46 47 Admin bool
+15
templates/admin/user/edit.tmpl
··· 70 70 <input id="password" name="password" type="password" autocomplete="new-password"> 71 71 <p class="help">{{ctx.Locale.Tr "admin.users.password_helper"}}</p> 72 72 </div> 73 + 74 + <div class="field {{if .Err_Language}}error{{end}}"> 75 + <label for="language">{{ctx.Locale.Tr "settings.language"}}</label> 76 + <div class="ui selection dropdown"> 77 + <input name="language" type="hidden" value="{{.User.Language}}"> 78 + {{svg "octicon-triangle-down" 14 "dropdown icon"}} 79 + <div class="text">{{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}}</div> 80 + <div class="menu"> 81 + {{range .AllLangs}} 82 + <div class="item{{if eq $.User.Language .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div> 83 + {{end}} 84 + </div> 85 + </div> 86 + </div> 87 + 73 88 <div class="field {{if .Err_Website}}error{{end}}"> 74 89 <label for="website">{{ctx.Locale.Tr "settings.website"}}</label> 75 90 <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="http://mydomain.com or https://mydomain.com" maxlength="255">
+8
templates/admin/user/view_details.tmpl
··· 48 48 {{svg "octicon-x"}} 49 49 {{end}} 50 50 </div> 51 + {{if .User.Language}} 52 + <div class="flex-item-body"> 53 + <span class="flex-text-inline"> 54 + <b>{{ctx.Locale.Tr "settings.language"}}:</b> 55 + {{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}} 56 + </span> 57 + </div> 58 + {{end}} 51 59 {{if .User.Location}} 52 60 <div class="flex-item-body"> 53 61 <span class="flex-text-inline">{{svg "octicon-location"}}{{.User.Location}}</span>