|
|
|
@ -19,7 +19,7 @@ |
|
|
|
<div fxFlex fxLayout="column" class="tb-images-content" [ngClass]="{'tb-outlined-border': pageMode}"> |
|
|
|
<mat-toolbar class="mat-mdc-table-toolbar" [fxShow]="!textSearchMode && dataSource.selection.isEmpty()"> |
|
|
|
<div class="mat-toolbar-tools"> |
|
|
|
<span class="tb-images-title" translate>image.gallery</span> |
|
|
|
<span fxHide fxShow.gt-sm class="tb-images-title" translate>image.gallery</span> |
|
|
|
<div class="tb-images-view-type-toolbar" |
|
|
|
fxLayout="row" |
|
|
|
fxLayoutAlign="start center"> |
|
|
|
@ -43,7 +43,7 @@ |
|
|
|
</div> |
|
|
|
<section fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="16px"> |
|
|
|
<span fxFlex></span> |
|
|
|
<section fxLayout="row"> |
|
|
|
<section fxLayout="row" fxLayoutAlign="start center"> |
|
|
|
<button [disabled]="isLoading$ | async" |
|
|
|
mat-icon-button |
|
|
|
(click)="enterFilterMode()" |
|
|
|
@ -63,10 +63,18 @@ |
|
|
|
(click)="importImage()" |
|
|
|
matTooltip="{{'image.import-image' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<tb-icon>mdi:file-import</tb-icon> |
|
|
|
</button> |
|
|
|
<button fxHide fxShow.lt-sm [disabled]="isLoading$ | async" |
|
|
|
mat-icon-button |
|
|
|
color="primary" |
|
|
|
(click)="uploadImage()" |
|
|
|
matTooltip="{{'image.upload-image' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>upload</mat-icon> |
|
|
|
</button> |
|
|
|
</section> |
|
|
|
<button [disabled]="isLoading$ | async" |
|
|
|
<button fxHide fxShow.gt-xs [disabled]="isLoading$ | async" |
|
|
|
mat-flat-button |
|
|
|
color="primary" |
|
|
|
(click)="uploadImage()"> |
|
|
|
@ -121,6 +129,7 @@ |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let image"> |
|
|
|
<mat-checkbox (click)="$event.stopPropagation()" |
|
|
|
[fxShow]="!readonly(image)" |
|
|
|
(change)="$event ? dataSource.selection.toggle(image) : null" |
|
|
|
[checked]="dataSource.selection.isSelected(image)"> |
|
|
|
</mat-checkbox> |
|
|
|
@ -139,19 +148,19 @@ |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="createdTime"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 200px; min-width: 200px;"> {{ 'image.created-time' | translate }} </mat-header-cell> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 160px; min-width: 160px;"> {{ 'image.created-time' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let image"> |
|
|
|
{{ image.createdTime | date:'yyyy-MM-dd HH:mm:ss' }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="resolution"> |
|
|
|
<mat-header-cell *matHeaderCellDef style="width: 160px; min-width: 160px;"> {{ 'image.resolution' | translate }} </mat-header-cell> |
|
|
|
<mat-header-cell *matHeaderCellDef style="width: 80px; min-width: 80px;"> {{ 'image.resolution' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let image"> |
|
|
|
{{ image.descriptor.width }}x{{ image.descriptor.height }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="size"> |
|
|
|
<mat-header-cell *matHeaderCellDef style="width: 160px; min-width: 160px;"> {{ 'image.size' | translate }} </mat-header-cell> |
|
|
|
<mat-header-cell *matHeaderCellDef style="width: 80px; min-width: 80px;"> {{ 'image.size' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let image"> |
|
|
|
{{ image.descriptor.size | fileSize }} |
|
|
|
</mat-cell> |
|
|
|
@ -163,10 +172,10 @@ |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="actions" stickyEnd> |
|
|
|
<mat-header-cell *matHeaderCellDef style="min-width: 192px; max-width: 192px; width: 192px"> |
|
|
|
<mat-header-cell *matHeaderCellDef [ngStyle.gt-md]="{ minWidth: '192px', maxWidth: '192px', width: '192px' }"> |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let image"> |
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="end"> |
|
|
|
<mat-cell *matCellDef="let image" [ngStyle.gt-md]="{ minWidth: '192px', maxWidth: '192px', width: '192px' }"> |
|
|
|
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end"> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
matTooltip="{{ 'image.download-image' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
@ -180,7 +189,7 @@ |
|
|
|
<tb-icon>mdi:file-export</tb-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
matTooltip="{{ 'image.edit-image' | translate }}" |
|
|
|
matTooltip="{{ (readonly(image) ? 'image.image-details' : 'image.edit-image') | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="editImage($event, image)"> |
|
|
|
<mat-icon>edit</mat-icon> |
|
|
|
@ -192,6 +201,40 @@ |
|
|
|
<mat-icon>delete</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div fxHide fxShow.lt-lg> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="$event.stopPropagation()" |
|
|
|
[matMenuTriggerFor]="cellActionsMenu"> |
|
|
|
<mat-icon class="material-icons">more_vert</mat-icon> |
|
|
|
</button> |
|
|
|
<mat-menu #cellActionsMenu="matMenu" xPosition="before"> |
|
|
|
<button mat-menu-item |
|
|
|
[disabled]="isLoading$ | async" |
|
|
|
(click)="downloadImage($event, image)"> |
|
|
|
<mat-icon>file_download</mat-icon> |
|
|
|
<span translate>image.download-image</span> |
|
|
|
</button> |
|
|
|
<button mat-menu-item |
|
|
|
[disabled]="isLoading$ | async" |
|
|
|
(click)="exportImage($event, image)"> |
|
|
|
<tb-icon matMenuItemIcon>mdi:file-export</tb-icon> |
|
|
|
<span translate>image.export-image</span> |
|
|
|
</button> |
|
|
|
<button mat-menu-item |
|
|
|
[disabled]="isLoading$ | async" |
|
|
|
(click)="editImage($event, image)"> |
|
|
|
<mat-icon>edit</mat-icon> |
|
|
|
<span>{{ (readonly(image) ? 'image.image-details' : 'image.edit-image') | translate }}</span> |
|
|
|
</button> |
|
|
|
<button mat-menu-item |
|
|
|
[disabled]="isLoading$ | async" |
|
|
|
[fxShow]="!readonly(image)" |
|
|
|
(click)="deleteImage($event, image)"> |
|
|
|
<mat-icon>delete</mat-icon> |
|
|
|
<span translate>image.delete-image</span> |
|
|
|
</button> |
|
|
|
</mat-menu> |
|
|
|
</div> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<mat-header-row [ngClass]="{'mat-row-select': true}" *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row> |
|
|
|
@ -243,9 +286,40 @@ |
|
|
|
<div class="tb-no-data-text" translate>image.no-images</div> |
|
|
|
</div> |
|
|
|
</ng-template> |
|
|
|
<ng-template #imageCard let-item="item"> |
|
|
|
<div class="tb-image-card"> |
|
|
|
<ng-template #imageCard let-item="item" let-itemIndex="itemIndex"> |
|
|
|
<div class="tb-image-card tb-primary-fill"> |
|
|
|
<div class="tb-image-card-overlay"> |
|
|
|
<div class="tb-image-card-overlay-buttons"> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
matTooltip="{{ 'image.download-image' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="downloadImage($event, item)"> |
|
|
|
<mat-icon>file_download</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
matTooltip="{{ 'image.export-image' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="exportImage($event, item)"> |
|
|
|
<tb-icon>mdi:file-export</tb-icon> |
|
|
|
</button> |
|
|
|
<button *ngIf="!readonly(item)" |
|
|
|
mat-icon-button [disabled]="(isLoading$ | async)" |
|
|
|
matTooltip="{{ 'image.delete-image' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="deleteImage($event, item, itemIndex)"> |
|
|
|
<mat-icon>delete</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="tb-image-preview-container"> |
|
|
|
<div class="tb-image-preview-overlay"> |
|
|
|
<button |
|
|
|
mat-flat-button |
|
|
|
color="primary" |
|
|
|
(click)="editImage($event, item, itemIndex)"> |
|
|
|
{{ (readonly(item) ? 'image.image-details' : 'image.edit-image') | translate }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div class="tb-image-preview-spacer"></div> |
|
|
|
<img class="tb-image-preview" [src]="item.link | image: {preview: true} | async" alt="{{ item.title }}"> |
|
|
|
</div> |
|
|
|
|