File tree 4 files changed +25
-0
lines changed
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) {
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 {
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ type AdminEditUserForm struct {
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
Original file line number Diff line number Diff line change 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">
Original file line number Diff line number Diff line change 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>
You can’t perform that action at this time.
0 commit comments