]>
Commit | Line | Data |
---|---|---|
1 | <h3>Upload a video</h3> | |
2 | ||
3 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> | |
4 | ||
5 | <form novalidate [formGroup]="form"> | |
6 | <div class="form-group"> | |
7 | <label for="name">Name</label> | |
8 | <input | |
9 | type="text" class="form-control" id="name" | |
10 | formControlName="name" | |
11 | > | |
12 | <div *ngIf="formErrors.name" class="alert alert-danger"> | |
13 | {{ formErrors.name }} | |
14 | </div> | |
15 | </div> | |
16 | ||
17 | <div class="form-group"> | |
18 | <label for="category">Category</label> | |
19 | <select class="form-control" id="category" formControlName="category"> | |
20 | <option></option> | |
21 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> | |
22 | </select> | |
23 | ||
24 | <div *ngIf="formErrors.category" class="alert alert-danger"> | |
25 | {{ formErrors.category }} | |
26 | </div> | |
27 | </div> | |
28 | ||
29 | <div class="form-group"> | |
30 | <label for="licence">Licence</label> | |
31 | <select class="form-control" id="licence" formControlName="licence"> | |
32 | <option></option> | |
33 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> | |
34 | </select> | |
35 | ||
36 | <div *ngIf="formErrors.licence" class="alert alert-danger"> | |
37 | {{ formErrors.licence }} | |
38 | </div> | |
39 | </div> | |
40 | ||
41 | <div class="form-group"> | |
42 | <label for="tags">Tags</label> <span class="little-information">(press enter to add the tag)</span> | |
43 | <input | |
44 | type="text" class="form-control" id="currentTag" | |
45 | formControlName="currentTag" (keyup)="onTagKeyPress($event)" | |
46 | > | |
47 | <div *ngIf="formErrors.currentTag" class="alert alert-danger"> | |
48 | {{ formErrors.currentTag }} | |
49 | </div> | |
50 | </div> | |
51 | ||
52 | <div class="tags"> | |
53 | <div class="label label-primary tag" *ngFor="let tag of tags"> | |
54 | {{ tag }} | |
55 | <span class="remove" (click)="removeTag(tag)">x</span> | |
56 | </div> | |
57 | </div> | |
58 | ||
59 | <div *ngIf="tagsError" class="alert alert-danger"> | |
60 | {{ tagsError }} | |
61 | </div> | |
62 | ||
63 | <div class="form-group"> | |
64 | <label for="videofile">File</label> | |
65 | <div class="btn btn-default btn-file" [ngClass]="{ 'disabled': filename !== null }" > | |
66 | <span>Select the video...</span> | |
67 | <input | |
68 | type="file" name="videofile" id="videofile" | |
69 | ng2FileSelect [uploader]="uploader" [disabled]="filename !== null" | |
70 | (change)="fileChanged()" | |
71 | > | |
72 | </div> | |
73 | </div> | |
74 | ||
75 | <div class="file-to-upload"> | |
76 | <div class="file" *ngIf="uploader.queue.length > 0"> | |
77 | <span class="filename">{{ filename }}</span> | |
78 | <span class="glyphicon glyphicon-remove" (click)="removeFile()"></span> | |
79 | </div> | |
80 | </div> | |
81 | ||
82 | <div *ngIf="fileError" class="alert alert-danger"> | |
83 | {{ fileError }} | |
84 | </div> | |
85 | ||
86 | <div class="form-group"> | |
87 | <label for="description">Description</label> | |
88 | <textarea | |
89 | id="description" class="form-control" placeholder="Description..." | |
90 | formControlName="description" | |
91 | > | |
92 | </textarea> | |
93 | <div *ngIf="formErrors.description" class="alert alert-danger"> | |
94 | {{ formErrors.description }} | |
95 | </div> | |
96 | </div> | |
97 | ||
98 | <div class="progress"> | |
99 | <progressbar [value]="uploader.progress" max="100"></progressbar> | |
100 | </div> | |
101 | ||
102 | <div class="form-group"> | |
103 | <input | |
104 | type="button" value="Upload" class="btn btn-default form-control" | |
105 | (click)="upload()" | |
106 | > | |
107 | </div> | |
108 | </form> |