]>
Commit | Line | Data |
---|---|---|
dc8bc31b C |
1 | <h3>Upload a video</h3> |
2 | ||
1cdb5c0f C |
3 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
4 | ||
e822fdae | 5 | <form novalidate (ngSubmit)="upload()" [ngFormModel]="videoForm"> |
dc8bc31b | 6 | <div class="form-group"> |
e822fdae | 7 | <label for="name">Name</label> |
dc8bc31b | 8 | <input |
e822fdae C |
9 | type="text" class="form-control" name="name" id="name" |
10 | ngControl="name" #name="ngForm" [(ngModel)]="video.name" | |
dc8bc31b | 11 | > |
e822fdae C |
12 | <div [hidden]="name.valid || name.pristine" class="alert alert-warning"> |
13 | A name is required and should be between 3 and 50 characters long | |
dc8bc31b C |
14 | </div> |
15 | </div> | |
16 | ||
763bed9b | 17 | <div class="form-group"> |
e822fdae C |
18 | <label for="tags">Tags</label> |
19 | <input | |
20 | type="text" class="form-control" name="tags" id="tags" | |
21 | ngControl="tags" #tags="ngForm" [disabled]="isTagsInputDisabled" (keyup)="onTagKeyPress($event)" [(ngModel)]="currentTag" | |
22 | > | |
23 | <div [hidden]="tags.valid || tags.pristine" class="alert alert-warning"> | |
00a44645 | 24 | A tag should be between 2 and 10 characters (alphanumeric) long |
e822fdae C |
25 | </div> |
26 | </div> | |
27 | ||
28 | <div class="tags"> | |
00a44645 | 29 | <div class="label label-primary tag" *ngFor="let tag of video.tags"> |
e822fdae C |
30 | {{ tag }} |
31 | <span class="remove" (click)="removeTag(tag)">x</span> | |
32 | </div> | |
33 | </div> | |
34 | ||
35 | <div class="form-group"> | |
36 | <label for="videofile">File</label> | |
37 | <div class="btn btn-default btn-file" [ngClass]="{ 'disabled': filename !== null }" > | |
763bed9b | 38 | <span>Select the video...</span> |
e822fdae C |
39 | <input |
40 | type="file" name="videofile" id="videofile" | |
41 | ng2FileSelect [uploader]="uploader" [disabled]="filename !== null" | |
42 | > | |
763bed9b | 43 | </div> |
e822fdae | 44 | </div> |
dc8bc31b | 45 | |
e822fdae C |
46 | <div class="file-to-upload"> |
47 | <div class="file" *ngIf="uploader.queue.length > 0"> | |
48 | <span class="filename">{{ filename }}</span> | |
49 | <span class="glyphicon glyphicon-remove" (click)="removeFile()"></span> | |
50 | </div> | |
763bed9b | 51 | </div> |
dc8bc31b C |
52 | |
53 | <div class="form-group"> | |
54 | <label for="description">Description</label> | |
55 | <textarea | |
e822fdae C |
56 | name="description" id="description" class="form-control" placeholder="Description..." |
57 | ngControl="description" #description="ngForm" [(ngModel)]="video.description" | |
dc8bc31b C |
58 | > |
59 | </textarea> | |
e822fdae C |
60 | <div [hidden]="description.valid || description.pristine" class="alert alert-warning"> |
61 | A description is required and should be between 3 and 250 characters long | |
dc8bc31b C |
62 | </div> |
63 | </div> | |
64 | ||
e822fdae C |
65 | <div class="progress"> |
66 | <progressbar [value]="uploader.progress" max="100"></progressbar> | |
dc8bc31b C |
67 | </div> |
68 | ||
e822fdae C |
69 | <div class="form-group"> |
70 | <input | |
71 | type="submit" value="Upload" class="btn btn-default form-control" [title]="getInvalidFieldsTitle()" | |
72 | [disabled]="!videoForm.valid || video.tags.length === 0 || filename === null" | |
73 | > | |
74 | </div> | |
dc8bc31b | 75 | </form> |