summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2021-11-16 20:13:13 +0100
committerGitHub <noreply@github.com>2021-11-16 19:13:13 +0000
commit3be156f66a9682d698fe1191a7dd1016270873ab (patch)
tree55a17870cdfe1fa037a9b2d42836f1ae871debda /templates
parentbbffcc3aecda040a40d49078e7141213bc8d78af (diff)
downloadgitea-3be156f66a9682d698fe1191a7dd1016270873ab.tar.gz
gitea-3be156f66a9682d698fe1191a7dd1016270873ab.zip
Allow admins to change user avatars (#17661)
Adds the avatar change panel to the edit user page (bottom) and allows admins to change it this way Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/user/edit.tmpl38
1 files changed, 38 insertions, 0 deletions
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index fb0ccd22bb..9475a0cce6 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -155,6 +155,44 @@
</div>
</form>
</div>
+
+ <h4 class="ui top attached header">
+ {{.i18n.Tr "settings.avatar"}}
+ </h4>
+ <div class="ui attached segment">
+ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
+ {{.CsrfTokenHtml}}
+ {{if not DisableGravatar}}
+ <div class="inline field">
+ <div class="ui radio checkbox">
+ <input name="source" value="lookup" type="radio" {{if not .User.UseCustomAvatar}}checked{{end}}>
+ <label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label>
+ </div>
+ </div>
+ <div class="field {{if .Err_Gravatar}}error{{end}}">
+ <label for="gravatar">Avatar {{.i18n.Tr "email"}}</label>
+ <input id="gravatar" name="gravatar" value="{{.User.AvatarEmail}}" />
+ </div>
+ {{end}}
+
+ <div class="inline field">
+ <div class="ui radio checkbox">
+ <input name="source" value="local" type="radio" {{if .User.UseCustomAvatar}}checked{{end}}>
+ <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
+ </div>
+ </div>
+
+ <div class="inline field">
+ <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
+ <input name="avatar" type="file" >
+ </div>
+
+ <div class="field">
+ <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
+ <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
+ </div>
+ </form>
+ </div>
</div>
</div>