|
1 | | -<h2 mat-dialog-title>Post Attachment?</h2> |
2 | | -<mat-dialog-content> |
3 | | - <p>This attachment is ready to post as a task comment.</p> |
| 1 | +<div (keydown.enter)="$event.preventDefault(); $event.stopPropagation()"> |
| 2 | + <h2 mat-dialog-title>Post Attachment?</h2> |
| 3 | + <mat-dialog-content> |
| 4 | + <p>This attachment is ready to post as a task comment.</p> |
4 | 5 |
|
5 | | - <div |
6 | | - class="mx-auto flex min-h-[180px] w-full max-w-[520px] items-center justify-center overflow-hidden rounded-xl bg-black/5" |
7 | | - > |
8 | | - @if (isImage) { |
9 | | - <img |
10 | | - class="aspect-square w-full max-w-[520px] object-contain object-center" |
11 | | - [alt]="file.name" |
12 | | - [src]="previewUrl" |
13 | | - /> |
14 | | - } @else if (isPdf) { |
15 | | - <div class="flex items-center gap-2 p-3"> |
16 | | - <mat-icon class="size-5 text-[2rem]">picture_as_pdf</mat-icon> |
17 | | - <div class="flex flex-col gap-px break-all"> |
18 | | - <strong>{{ file.name }}</strong> |
19 | | - <span>PDF document</span> |
20 | | - </div> |
21 | | - </div> |
22 | | - } @else if (isAudio) { |
23 | | - <div class="w-full p-3"> |
24 | | - <div class="flex items-center gap-2"> |
25 | | - <mat-icon class="size-5 text-[2rem]">audio_file</mat-icon> |
| 6 | + <div |
| 7 | + class="mx-auto flex min-h-[180px] w-full max-w-[520px] items-center justify-center overflow-hidden rounded-xl bg-black/5" |
| 8 | + > |
| 9 | + @if (isImage) { |
| 10 | + <img |
| 11 | + class="aspect-square w-full max-w-[520px] object-contain object-center" |
| 12 | + [alt]="file.name" |
| 13 | + [src]="previewUrl" |
| 14 | + /> |
| 15 | + } @else if (isPdf) { |
| 16 | + <div class="flex items-center gap-2 p-3"> |
| 17 | + <mat-icon class="size-5 text-[2rem]">picture_as_pdf</mat-icon> |
26 | 18 | <div class="flex flex-col gap-px break-all"> |
27 | 19 | <strong>{{ file.name }}</strong> |
28 | | - <span>{{ file.type || 'Audio file' }}</span> |
| 20 | + <span>PDF document</span> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + } @else if (isAudio) { |
| 24 | + <div class="w-full p-3"> |
| 25 | + <div class="flex items-center gap-2"> |
| 26 | + <mat-icon class="size-5 text-[2rem]">audio_file</mat-icon> |
| 27 | + <div class="flex flex-col gap-px break-all"> |
| 28 | + <strong>{{ file.name }}</strong> |
| 29 | + <span>{{ file.type || 'Audio file' }}</span> |
| 30 | + </div> |
29 | 31 | </div> |
| 32 | + <audio class="mt-2.5 w-full" controls [src]="previewUrl"></audio> |
30 | 33 | </div> |
31 | | - <audio class="mt-2.5 w-full" controls [src]="previewUrl"></audio> |
32 | | - </div> |
33 | | - } @else { |
34 | | - <div class="flex items-center gap-2 p-3"> |
35 | | - <mat-icon class="size-5 text-[2rem]">attach_file</mat-icon> |
36 | | - <div class="flex flex-col gap-px break-all"> |
37 | | - <strong>{{ file.name }}</strong> |
38 | | - <span>{{ file.type || 'Attachment' }}</span> |
| 34 | + } @else { |
| 35 | + <div class="flex items-center gap-2 p-3"> |
| 36 | + <mat-icon class="size-5 text-[2rem]">attach_file</mat-icon> |
| 37 | + <div class="flex flex-col gap-px break-all"> |
| 38 | + <strong>{{ file.name }}</strong> |
| 39 | + <span>{{ file.type || 'Attachment' }}</span> |
| 40 | + </div> |
39 | 41 | </div> |
40 | | - </div> |
41 | | - } |
42 | | - </div> |
| 42 | + } |
| 43 | + </div> |
43 | 44 |
|
44 | | - <p class="mt-2 text-base break-all opacity-80"> |
45 | | - {{ file.name }} |
46 | | - @if (file.size) { |
47 | | - <span>({{ formatFileSize(file.size) }})</span> |
48 | | - } |
49 | | - </p> |
50 | | -</mat-dialog-content> |
| 45 | + <p class="mt-2 text-base break-all opacity-80"> |
| 46 | + {{ file.name }} |
| 47 | + @if (file.size) { |
| 48 | + <span>({{ formatFileSize(file.size) }})</span> |
| 49 | + } |
| 50 | + </p> |
| 51 | + </mat-dialog-content> |
51 | 52 |
|
52 | | -<mat-dialog-actions align="end"> |
53 | | - <button mat-button (click)="dismiss(false)">Cancel</button> |
54 | | - <button color="primary" mat-raised-button (click)="dismiss(true)">Post Attachment</button> |
55 | | -</mat-dialog-actions> |
| 53 | + <mat-dialog-actions align="end"> |
| 54 | + <button mat-button type="button" (click)="dismiss(false)">Cancel</button> |
| 55 | + <button color="primary" mat-raised-button type="button" (click)="dismiss(true)"> |
| 56 | + Post Attachment |
| 57 | + </button> |
| 58 | + </mat-dialog-actions> |
| 59 | +</div> |
0 commit comments