mirror of https://github.com/go-gitea/gitea.git
Add cropping support when modifying the user/org/repo avatar (#33498)
Fixed #33321 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>pull/33529/head
parent
943cc4f989
commit
40426addfa
@ -0,0 +1,8 @@
|
|||||||
|
{{- /* we do not need to set for/id here, global aria init code will add them automatically */ -}}
|
||||||
|
<label>{{.LabelText}}</label>
|
||||||
|
<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
|
||||||
|
{{- /* the cropper-panel must be next sibling of the input "avatar" */ -}}
|
||||||
|
<div class="cropper-panel tw-hidden">
|
||||||
|
<div class="tw-my-2">{{ctx.Locale.Tr "settings.cropper_prompt"}}</div>
|
||||||
|
<div class="cropper-wrapper"><img class="cropper-source" src alt></div>
|
||||||
|
</div>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
@import "cropperjs/dist/cropper.css";
|
@import "cropperjs/dist/cropper.css";
|
||||||
|
|
||||||
.page-content.user.profile .cropper-panel .cropper-wrapper {
|
.avatar-file-with-cropper + .cropper-panel .cropper-wrapper {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue