aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKerwin Bryant <kerwin612@qq.com>2024-11-28 10:15:59 +0800
committerGitHub <noreply@github.com>2024-11-28 02:15:59 +0000
commit68d9f365437967e30c49550539f0e24de815408c (patch)
tree776abf333061be6211aa3cefb4341063bd353e06 /templates
parentf1bea3c3b878fba066bd25383f690a31fa9e5489 (diff)
downloadgitea-68d9f365437967e30c49550539f0e24de815408c.tar.gz
gitea-68d9f365437967e30c49550539f0e24de815408c.zip
Allow cropping an avatar before setting it (#32565)
Provide a cropping tool on the avatar editing page, allowing users to select the cropping area themselves. This way, users can decide the displayed area of the image, rather than us deciding for them. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/user/settings/profile.tmpl5
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index 9c7e2de218..f879587c71 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -127,6 +127,11 @@
<input id="new-avatar" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
</div>
+ <div class="field tw-pl-4 cropper-panel tw-hidden">
+ <div>{{ctx.Locale.Tr "settings.cropper_prompt"}}</div>
+ <div class="cropper-wrapper"><img class="cropper-source" src alt></div>
+ </div>
+
<div class="field">
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>