File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ func EditUserPost(ctx *context.Context) {
439439 AllowCreateOrganization : optional .Some (form .AllowCreateOrganization ),
440440 IsRestricted : optional .Some (form .Restricted ),
441441 Visibility : optional .Some (form .Visibility ),
442+ Language : optional .Some (form .Language ),
442443 }
443444
444445 if err := user_service .UpdateUser (ctx , u , opts ); err != nil {
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ type AdminEditUserForm struct {
4141 Password string `binding:"MaxSize(255)"`
4242 Website string `binding:"ValidUrl;MaxSize(255)"`
4343 Location string `binding:"MaxSize(50)"`
44+ Language string `binding:"MaxSize(5)"`
4445 MaxRepoCreation int
4546 Active bool
4647 Admin bool
Original file line number Diff line number Diff line change 7070 <input id="password" name="password" type="password" autocomplete="new-password">
7171 <p class="help">{{ctx.Locale.Tr "admin.users.password_helper"}}</p>
7272 </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+
7388 <div class="field {{if .Err_Website}}error{{end}}">
7489 <label for="website">{{ctx.Locale.Tr "settings.website"}}</label>
7590 <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="http://mydomain.com or https://mydomain.com" maxlength="255">
Original file line number Diff line number Diff line change 4848 {{svg "octicon-x"}}
4949 {{end}}
5050 </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}}
5159 {{if .User.Location}}
5260 <div class="flex-item-body">
5361 <span class="flex-text-inline">{{svg "octicon-location"}}{{.User.Location}}</span>
You can’t perform that action at this time.
0 commit comments