2016-03-14 12:50:19 +00:00
|
|
|
<h3>Upload a video</h3>
|
|
|
|
|
2016-06-04 18:37:38 +00:00
|
|
|
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
|
|
|
|
2016-10-17 19:14:13 +00:00
|
|
|
<form novalidate [formGroup]="form">
|
2016-03-14 12:50:19 +00:00
|
|
|
<div class="form-group">
|
2016-06-07 20:34:02 +00:00
|
|
|
<label for="name">Name</label>
|
2016-03-14 12:50:19 +00:00
|
|
|
<input
|
2016-09-09 20:16:51 +00:00
|
|
|
type="text" class="form-control" id="name"
|
|
|
|
formControlName="name"
|
2016-03-14 12:50:19 +00:00
|
|
|
>
|
2016-09-09 20:16:51 +00:00
|
|
|
<div *ngIf="formErrors.name" class="alert alert-danger">
|
|
|
|
{{ formErrors.name }}
|
2016-03-14 12:50:19 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-03-16 19:59:56 +00:00
|
|
|
<div class="form-group">
|
2016-06-07 20:34:02 +00:00
|
|
|
<label for="tags">Tags</label>
|
|
|
|
<input
|
2016-09-09 20:16:51 +00:00
|
|
|
type="text" class="form-control" id="currentTag"
|
|
|
|
formControlName="currentTag" (keyup)="onTagKeyPress($event)"
|
2016-06-07 20:34:02 +00:00
|
|
|
>
|
2016-09-09 20:16:51 +00:00
|
|
|
<div *ngIf="formErrors.currentTag" class="alert alert-danger">
|
|
|
|
{{ formErrors.currentTag }}
|
2016-06-07 20:34:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tags">
|
2016-09-09 20:16:51 +00:00
|
|
|
<div class="label label-primary tag" *ngFor="let tag of tags">
|
2016-06-07 20:34:02 +00:00
|
|
|
{{ tag }}
|
|
|
|
<span class="remove" (click)="removeTag(tag)">x</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="videofile">File</label>
|
|
|
|
<div class="btn btn-default btn-file" [ngClass]="{ 'disabled': filename !== null }" >
|
2016-03-16 19:59:56 +00:00
|
|
|
<span>Select the video...</span>
|
2016-06-07 20:34:02 +00:00
|
|
|
<input
|
|
|
|
type="file" name="videofile" id="videofile"
|
|
|
|
ng2FileSelect [uploader]="uploader" [disabled]="filename !== null"
|
|
|
|
>
|
2016-03-16 19:59:56 +00:00
|
|
|
</div>
|
2016-06-07 20:34:02 +00:00
|
|
|
</div>
|
2016-03-14 12:50:19 +00:00
|
|
|
|
2016-06-07 20:34:02 +00:00
|
|
|
<div class="file-to-upload">
|
|
|
|
<div class="file" *ngIf="uploader.queue.length > 0">
|
|
|
|
<span class="filename">{{ filename }}</span>
|
|
|
|
<span class="glyphicon glyphicon-remove" (click)="removeFile()"></span>
|
|
|
|
</div>
|
2016-03-16 19:59:56 +00:00
|
|
|
</div>
|
2016-03-14 12:50:19 +00:00
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="description">Description</label>
|
|
|
|
<textarea
|
2016-09-09 20:16:51 +00:00
|
|
|
id="description" class="form-control" placeholder="Description..."
|
|
|
|
formControlName="description"
|
2016-03-14 12:50:19 +00:00
|
|
|
>
|
|
|
|
</textarea>
|
2016-09-09 20:16:51 +00:00
|
|
|
<div *ngIf="formErrors.description" class="alert alert-danger">
|
|
|
|
{{ formErrors.description }}
|
2016-03-14 12:50:19 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-06-07 20:34:02 +00:00
|
|
|
<div class="progress">
|
|
|
|
<progressbar [value]="uploader.progress" max="100"></progressbar>
|
2016-03-14 12:50:19 +00:00
|
|
|
</div>
|
|
|
|
|
2016-06-07 20:34:02 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<input
|
2016-10-17 19:14:13 +00:00
|
|
|
type="button" value="Upload" class="btn btn-default form-control"
|
|
|
|
[title]="getInvalidFieldsTitle()" [disabled]="!form.valid || tags.length === 0 || filename === null"
|
|
|
|
(click)="upload()"
|
2016-06-07 20:34:02 +00:00
|
|
|
>
|
|
|
|
</div>
|
2016-03-14 12:50:19 +00:00
|
|
|
</form>
|