/
upload.component.html
56 lines (54 loc) · 2.35 KB
/
upload.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<div class="form-container">
<form [formGroup]="form">
<div dspDragDrop *ngIf="isLoading || !file" (click)="fileInput.click()" (fileDropped)="addFile($event)"
class="dd-container">
<input hidden type="file" (change)="addFile($event)" #fileInput />
<mat-icon *ngIf="!isLoading" class="upload-icon">
cloud_upload
</mat-icon>
<dsp-progress-indicator *ngIf="isLoading"></dsp-progress-indicator>
<p class="title">Upload file<br>
<span class="mat-body-1">The following file types are supported:<br>
<span *ngFor="let item of allowedFileTypes; let last = last">{{ item | split: '/':1 }}<span
*ngIf="!last">, </span></span>
</span>
</p>
<div class="bottom-line">
Drag and drop or click to upload
</div>
</div>
<ng-container *ngIf="!isLoading && file">
<div *ngIf="thumbnailUrl" class="thumbnail">
<img src="{{ thumbnailUrl }}" alt="thumbnail" />
<button mat-button class="delete-file" title="delete file" (click)="deleteAttachment()">
<mat-icon>close</mat-icon>
</button>
</div>
<div class="files-list">
<table>
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Last Modified Date</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ file.name }}</td>
<td>{{ convertBytes(file.size) }}</td>
<td>{{ convertDate(file.lastModified) }}</td>
<td>
<button mat-icon-button class="delete-file" title="delete file"
(click)="deleteAttachment()">
<mat-icon>delete</mat-icon>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</ng-container>
</form>
</div>