blob: b6be0d78298fff8dd7a5f7a528b0a3c469bda841 (
plain) (
tree)
|
|
<h3>Upload a video</h3>
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
<form novalidate [formGroup]="form">
<div class="form-group">
<label for="name">Name</label>
<input
type="text" class="form-control" id="name"
formControlName="name"
>
<div *ngIf="formErrors.name" class="alert alert-danger">
{{ formErrors.name }}
</div>
</div>
<div class="form-group">
<label for="tags">Tags</label> <span class="little-information">(press enter to add the tag)</span>
<input
type="text" class="form-control" id="currentTag"
formControlName="currentTag" (keyup)="onTagKeyPress($event)"
>
<div *ngIf="formErrors.currentTag" class="alert alert-danger">
{{ formErrors.currentTag }}
</div>
</div>
<div class="tags">
<div class="label label-primary tag" *ngFor="let tag of tags">
{{ tag }}
<span class="remove" (click)="removeTag(tag)">x</span>
</div>
</div>
<div *ngIf="tagsError" class="alert alert-danger">
{{ tagsError }}
</div>
<div class="form-group">
<label for="videofile">File</label>
<div class="btn btn-default btn-file" [ngClass]="{ 'disabled': filename !== null }" >
<span>Select the video...</span>
<input
type="file" name="videofile" id="videofile"
ng2FileSelect [uploader]="uploader" [disabled]="filename !== null"
(change)="fileChanged()"
>
</div>
</div>
<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>
</div>
<div *ngIf="fileError" class="alert alert-danger">
{{ fileError }}
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea
id="description" class="form-control" placeholder="Description..."
formControlName="description"
>
</textarea>
<div *ngIf="formErrors.description" class="alert alert-danger">
{{ formErrors.description }}
</div>
</div>
<div class="progress">
<progressbar [value]="uploader.progress" max="100"></progressbar>
</div>
<div class="form-group">
<input
type="button" value="Upload" class="btn btn-default form-control"
(click)="upload()"
>
</div>
</form>
|