|
5 | 5 | <mat-icon>help</mat-icon> |
6 | 6 | </a> |
7 | 7 | <span class="spacer"></span> |
8 | | - <mat-button-toggle-group |
9 | | - hideSingleSelectionIndicator="true" |
10 | | - (change)="settingsStore.setAssetLayout($event.value)" |
11 | | - [value]="settingsStore.assetLayout()"> |
12 | | - <mat-button-toggle value="list" matTooltip="List Layout"> |
13 | | - <mat-icon>view_list</mat-icon> |
14 | | - </mat-button-toggle> |
15 | | - <mat-button-toggle value="grid" matTooltip="Grid Layout"> |
16 | | - <mat-icon>grid_view</mat-icon> |
17 | | - </mat-button-toggle> |
18 | | - </mat-button-toggle-group> |
19 | | - @if ('ASSET_CREATE' | canUserPerform | async) { |
20 | | - <button mat-stroked-button color="primary" (click)="fileInput.click()"> |
21 | | - <mat-icon>upload_file</mat-icon> |
22 | | - Upload Assets |
23 | | - </button> |
24 | | - <input hidden type="file" multiple #fileInput (change)="onFileUpload($event)" /> |
25 | | - |
26 | | - <button mat-stroked-button color="primary" (click)="openAddFolderDialog()"> |
27 | | - <mat-icon>add</mat-icon> |
28 | | - Create Folder |
29 | | - </button> |
30 | | - } |
31 | | - |
32 | | - @if (['ASSET_IMPORT', 'ASSET_EXPORT'] | canUserPerform | async) { |
33 | | - <button mat-icon-button [matMenuTriggerFor]="extraMenu"> |
34 | | - <mat-icon>more_vert</mat-icon> |
35 | | - </button> |
36 | | - } |
| 8 | + <div class="actions"> |
| 9 | + @if (fileUploadQueue().length > 0) { |
| 10 | + <ll-icon [animate]="true" start="save" end="progress_activity" [matBadge]="fileUploadQueue().length" /> |
| 11 | + } |
| 12 | + <mat-button-toggle-group |
| 13 | + hideSingleSelectionIndicator="true" |
| 14 | + (change)="settingsStore.setAssetLayout($event.value)" |
| 15 | + [value]="settingsStore.assetLayout()"> |
| 16 | + <mat-button-toggle value="list" matTooltip="List Layout"> |
| 17 | + <mat-icon>view_list</mat-icon> |
| 18 | + </mat-button-toggle> |
| 19 | + <mat-button-toggle value="grid" matTooltip="Grid Layout"> |
| 20 | + <mat-icon>grid_view</mat-icon> |
| 21 | + </mat-button-toggle> |
| 22 | + </mat-button-toggle-group> |
| 23 | + @if ('ASSET_CREATE' | canUserPerform | async) { |
| 24 | + <button mat-stroked-button color="primary" (click)="fileInput.click()"> |
| 25 | + <mat-icon>upload_file</mat-icon> |
| 26 | + Upload Assets |
| 27 | + </button> |
| 28 | + <input hidden type="file" multiple #fileInput (change)="onFileUpload($event)" /> |
37 | 29 |
|
38 | | - <mat-menu #extraMenu="matMenu"> |
39 | | - @if ('ASSET_IMPORT' | canUserPerform | async) { |
40 | | - <button mat-menu-item (click)="openImportDialog()"> |
41 | | - <mat-icon>cloud_upload</mat-icon> |
42 | | - <span>Import</span> |
| 30 | + <button mat-stroked-button color="primary" (click)="openAddFolderDialog()"> |
| 31 | + <mat-icon>add</mat-icon> |
| 32 | + Create Folder |
43 | 33 | </button> |
44 | 34 | } |
45 | | - @if ('ASSET_EXPORT' | canUserPerform | async) { |
46 | | - <button mat-menu-item (click)="openExportDialog()"> |
47 | | - <mat-icon>cloud_download</mat-icon> |
48 | | - <span>Export</span> |
| 35 | + |
| 36 | + @if (['ASSET_IMPORT', 'ASSET_EXPORT'] | canUserPerform | async) { |
| 37 | + <button mat-icon-button [matMenuTriggerFor]="extraMenu"> |
| 38 | + <mat-icon>more_vert</mat-icon> |
49 | 39 | </button> |
50 | 40 | } |
51 | | - </mat-menu> |
| 41 | + |
| 42 | + <mat-menu #extraMenu="matMenu"> |
| 43 | + @if ('ASSET_IMPORT' | canUserPerform | async) { |
| 44 | + <button mat-menu-item (click)="openImportDialog()"> |
| 45 | + <mat-icon>cloud_upload</mat-icon> |
| 46 | + <span>Import</span> |
| 47 | + </button> |
| 48 | + } |
| 49 | + @if ('ASSET_EXPORT' | canUserPerform | async) { |
| 50 | + <button mat-menu-item (click)="openExportDialog()"> |
| 51 | + <mat-icon>cloud_download</mat-icon> |
| 52 | + <span>Export</span> |
| 53 | + </button> |
| 54 | + } |
| 55 | + </mat-menu> |
| 56 | + </div> |
52 | 57 | </mat-toolbar-row> |
53 | 58 | </mat-toolbar> |
54 | 59 | @if (isLoading()) { |
|
131 | 136 | </mat-cell> |
132 | 137 | </ng-container> |
133 | 138 | <ng-container matColumnDef="size"> |
134 | | - <mat-header-cell *matHeaderCellDef mat-sort-header="size"> Size</mat-header-cell> |
135 | | - <mat-cell *matCellDef="let element"> {{ element.size | digitalStore }}</mat-cell> |
| 139 | + <mat-header-cell *matHeaderCellDef mat-sort-header="size"> File Size</mat-header-cell> |
| 140 | + <mat-cell *matCellDef="let element"> |
| 141 | + @if (element.size) { |
| 142 | + {{ element.size | digitalStore }} |
| 143 | + } @else { |
| 144 | + <mat-icon>remove</mat-icon> |
| 145 | + } |
| 146 | + </mat-cell> |
136 | 147 | </ng-container> |
137 | 148 | <ng-container matColumnDef="type"> |
138 | 149 | <mat-header-cell *matHeaderCellDef mat-sort-header="type"> Type</mat-header-cell> |
139 | | - <mat-cell *matCellDef="let element"> {{ element.type }}</mat-cell> |
| 150 | + <mat-cell *matCellDef="let element"> |
| 151 | + @if (element.kind === 'FILE') { |
| 152 | + @if (element.type) { |
| 153 | + {{ element.type }} |
| 154 | + } @else { |
| 155 | + unknown |
| 156 | + } |
| 157 | + } @else { |
| 158 | + Folder |
| 159 | + } |
| 160 | + </mat-cell> |
140 | 161 | </ng-container> |
141 | 162 | <ng-container matColumnDef="createdAt"> |
142 | 163 | <mat-header-cell *matHeaderCellDef mat-sort-header="createdAt"> Created At</mat-header-cell> |
|
244 | 265 | </mat-card-header> |
245 | 266 | <mat-card-content> |
246 | 267 | @if (item.kind === 'FILE') { |
| 268 | + @if (item.size; as size) { |
| 269 | + <p>{{ size | digitalStore }}</p> |
| 270 | + } |
247 | 271 | @if (item.metadata; as metadata) { |
248 | 272 | @if (metadata.width && metadata.height) { |
249 | 273 | <code class="fw-light"> W{{ metadata.width }} x H{{ metadata.height }} </code> |
250 | 274 | } |
251 | 275 | } |
252 | | - @if (item.size; as size) { |
253 | | - <p>{{ size | digitalStore }}</p> |
254 | | - } |
255 | 276 | } |
256 | 277 | <p [matTooltip]="item.updatedAt?.toDate() | date: 'medium'"> |
257 | 278 | {{ item.updatedAt?.toDate() | date: 'mediumDate' }} |
258 | 279 | </p> |
259 | 280 | </mat-card-content> |
260 | 281 | <span class="spacer"></span> |
261 | | - <mat-card-actions> |
| 282 | + <mat-card-actions align="end"> |
262 | 283 | <button |
263 | 284 | mat-icon-button |
264 | 285 | (click)="onDownload($event, item)" |
|
288 | 309 | </mat-card-actions> |
289 | 310 | </mat-card> |
290 | 311 | } @empty { |
291 | | - <div class="text-center align-middle"> |
| 312 | + <div class="basis-full text-center align-middle"> |
292 | 313 | <br /> |
293 | 314 | <br /> |
294 | 315 | Drag and Drop a file here or use the "Upload Asset" button |
|
301 | 322 | } |
302 | 323 | </div> |
303 | 324 | <mat-paginator class="mat-paginator-sticky"></mat-paginator> |
304 | | - @if (fileUploadQueue.length > 0) { |
| 325 | + @if (false || fileUploadQueue().length > 0) { |
305 | 326 | <div class="file-progress-upload"> |
306 | 327 | <mat-card> |
307 | 328 | <mat-card-header> |
|
310 | 331 | <mat-card-content> |
311 | 332 | <mat-divider></mat-divider> |
312 | 333 | <mat-list role="list"> |
313 | | - @for (file of fileUploadQueue; track file.name; let idx = $index) { |
| 334 | + @for (file of fileUploadQueue(); track file.name; let idx = $index) { |
314 | 335 | <mat-list-item role="listitem"> |
315 | 336 | {{ file.name.length < 30 ? file.name : file.name.slice(0, 27).concat('...') }} |
316 | 337 | @if (idx === 0) { |
|
0 commit comments