diff options
Diffstat (limited to 'client/src/app/videos/video-add/video-add.component.html')
-rw-r--r-- | client/src/app/videos/video-add/video-add.component.html | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/client/src/app/videos/video-add/video-add.component.html b/client/src/app/videos/video-add/video-add.component.html index cbe274e8a..6b2eb9377 100644 --- a/client/src/app/videos/video-add/video-add.component.html +++ b/client/src/app/videos/video-add/video-add.component.html | |||
@@ -2,42 +2,74 @@ | |||
2 | 2 | ||
3 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> | 3 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
4 | 4 | ||
5 | <form (ngSubmit)="uploadFile()" #videoForm="ngForm"> | 5 | <form novalidate (ngSubmit)="upload()" [ngFormModel]="videoForm"> |
6 | <div class="form-group"> | 6 | <div class="form-group"> |
7 | <label for="name">Video name</label> | 7 | <label for="name">Name</label> |
8 | <input | 8 | <input |
9 | type="text" class="form-control" name="name" id="name" required | 9 | type="text" class="form-control" name="name" id="name" |
10 | ngControl="name" #name="ngForm" | 10 | ngControl="name" #name="ngForm" [(ngModel)]="video.name" |
11 | > | 11 | > |
12 | <div [hidden]="name.valid || name.pristine" class="alert alert-danger"> | 12 | <div [hidden]="name.valid || name.pristine" class="alert alert-warning"> |
13 | Name is required | 13 | A name is required and should be between 3 and 50 characters long |
14 | </div> | 14 | </div> |
15 | </div> | 15 | </div> |
16 | 16 | ||
17 | <div class="form-group"> | 17 | <div class="form-group"> |
18 | <div class="btn btn-default btn-file"> | 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"> | ||
24 | A tag should be between 2 and 10 characters long | ||
25 | </div> | ||
26 | </div> | ||
27 | |||
28 | <div class="tags"> | ||
29 | <div class="label label-info tag" *ngFor="let tag of video.tags"> | ||
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 }" > | ||
19 | <span>Select the video...</span> | 38 | <span>Select the video...</span> |
20 | <input type="file" name="videofile" id="videofile"> | 39 | <input |
40 | type="file" name="videofile" id="videofile" | ||
41 | ng2FileSelect [uploader]="uploader" [disabled]="filename !== null" | ||
42 | > | ||
21 | </div> | 43 | </div> |
44 | </div> | ||
22 | 45 | ||
23 | <span *ngIf="fileToUpload">{{ fileToUpload.name }}</span> | 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> | ||
24 | </div> | 51 | </div> |
25 | 52 | ||
26 | <div class="form-group"> | 53 | <div class="form-group"> |
27 | <label for="description">Description</label> | 54 | <label for="description">Description</label> |
28 | <textarea | 55 | <textarea |
29 | name="description" id="description" class="form-control" placeholder="Description..." required | 56 | name="description" id="description" class="form-control" placeholder="Description..." |
30 | ngControl="description" #description="ngForm" | 57 | ngControl="description" #description="ngForm" [(ngModel)]="video.description" |
31 | > | 58 | > |
32 | </textarea> | 59 | </textarea> |
33 | <div [hidden]="description.valid || description.pristine" class="alert alert-danger"> | 60 | <div [hidden]="description.valid || description.pristine" class="alert alert-warning"> |
34 | A description is required | 61 | A description is required and should be between 3 and 250 characters long |
35 | </div> | 62 | </div> |
36 | </div> | 63 | </div> |
37 | 64 | ||
38 | <div id="progress" *ngIf="progressBar.max !== 0"> | 65 | <div class="progress"> |
39 | <progressbar [value]="progressBar.value" [max]="progressBar.max">{{ progressBar.value | bytes }} / {{ progressBar.max | bytes }}</progressbar> | 66 | <progressbar [value]="uploader.progress" max="100"></progressbar> |
40 | </div> | 67 | </div> |
41 | 68 | ||
42 | <input type="submit" value="Upload" class="btn btn-default" [disabled]="!videoForm.form.valid || !fileToUpload"> | 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> | ||
43 | </form> | 75 | </form> |