37 lines
1.5 KiB
HTML
37 lines
1.5 KiB
HTML
<ng-template #upload_modal let-modal>
|
|
<div class="modal-header">
|
|
<h4 class="modal-title" i18n>Edit image</h4>
|
|
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="cropper">
|
|
<div *ngIf="!isImageLoaded" class="no-image" (click)="fileInput.click()">
|
|
<i class="fal fa-image"></i>
|
|
<div i18n>No image selected</div>
|
|
</div>
|
|
<image-cropper #imageCropper
|
|
[imageChangedEvent]="imageChangedEvent"
|
|
[maintainAspectRatio]="true"
|
|
[format]="imageType"
|
|
[aspectRatio]="aspectRatio"
|
|
[autoCrop]="true"
|
|
[resizeToWidth]="maxWidth"
|
|
[roundCropper]="roundImage"
|
|
(imageCropped)="imageCropped($event)"
|
|
(imageLoaded)="imageLoaded($event)"
|
|
(cropperReady)="cropperReady()"
|
|
(loadImageFailed)="loadImageFailed()"
|
|
[imageURL]="imageUrl"
|
|
></image-cropper>
|
|
</div>
|
|
<input #fileInput type="file" (change)="fileChangeEvent($event)" style="display:none" accept="image/*"/>
|
|
<span class="btn btn-primary" (click)="fileInput.click()" i18n>Select image</span>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="submit" class="btn btn-primary" i18n [disabled]="!isImageLoaded" (click)="save()">Apply</button>
|
|
<button type="button" autofocus class="btn btn-secondary" (click)="modal.close('Save click')" i18n="@@buttonCancel">Cancel</button>
|
|
</div>
|
|
</ng-template>
|