Browse Source

Администратор может редактировать доверительные свойства и интересы личности #9

pull/100/head
Artur Galyamov 2 years ago
parent
commit
f894ff9305
  1. 3
      routers/web/admin/users.go
  2. 3
      services/forms/admin.go
  3. 12
      templates/admin/user/edit.tmpl

3
routers/web/admin/users.go

@ -372,6 +372,9 @@ func EditUserPost(ctx *context.Context) {
u.Email = form.Email
u.Website = form.Website
u.Description = form.Description
u.Competences = form.Competences
u.Resources = form.Resources
u.Interests = form.Interests
u.Location = form.Location
u.LocationCoordinate = form.LocationCoordinate
u.MaxRepoCreation = form.MaxRepoCreation

3
services/forms/admin.go

@ -42,6 +42,9 @@ type AdminEditUserForm struct {
Password string `binding:"MaxSize(255)"`
Website string `binding:"ValidUrl;MaxSize(255)"`
Description string `binding:"MaxSize(1024)"`
Competences string `binding:"MaxSize(1024)"`
Resources string `binding:"MaxSize(1024)"`
Interests string `binding:"MaxSize(1024)"`
Location string `binding:"MaxSize(50)"`
LocationCoordinate string `binding:"MaxSize(255)"`
MaxRepoCreation int

12
templates/admin/user/edit.tmpl

@ -77,6 +77,18 @@
<label for="description">{{$.i18n.Tr "user.user_bio"}}</label>
<textarea id="description" name="description" rows="4" placeholder="{{.i18n.Tr "settings.biography_placeholder"}}">{{.User.Description}}</textarea>
</div>
<div class="field {{if .Err_Competences}}error{{end}}">
<label for="competences">{{$.i18n.Tr "user.user_competences"}}</label>
<textarea id="competences" name="competences" rows="4">{{.User.Competences}}</textarea>
</div>
<div class="field {{if .Err_Resources}}error{{end}}">
<label for="resources">{{$.i18n.Tr "user.user_resources"}}</label>
<textarea id="resources" name="resources" rows="4">{{.User.Resources}}</textarea>
</div>
<div class="field {{if .Err_Interests}}error{{end}}">
<label for="interests">{{$.i18n.Tr "user.user_interests"}}</label>
<textarea id="interests" name="interests" rows="4">{{.User.Interests}}</textarea>
</div>
<div class="field {{if .Err_Website}}error{{end}}">
<label for="website">{{.i18n.Tr "settings.website"}}</label>
<input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com">

Loading…
Cancel
Save