-<div class="row">
- <div class="content-padding">
-
- <h3>Upload a video</h3>
-
- <div *ngIf="error !== undefined" 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="privacy">Privacy</label>
- <select class="form-control" id="privacy" formControlName="privacy">
- <option></option>
- <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
- </select>
-
- <div *ngIf="formErrors.privacy" class="alert alert-danger">
- {{ formErrors.privacy }}
- </div>
- </div>
-
- <div class="form-group">
- <input
- type="checkbox" id="nsfw"
- formControlName="nsfw"
- >
- <label for="nsfw">This video contains mature or explicit content</label>
- </div>
-
- <div class="form-group">
- <label for="category">Channel</label>
- <select class="form-control" id="channelId" formControlName="channelId">
- <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
- </select>
-
- <div *ngIf="formErrors.channelId" class="alert alert-danger">
- {{ formErrors.channelId }}
- </div>
- </div>
-
- <div class="form-group">
- <label for="category">Category</label>
- <select class="form-control" id="category" formControlName="category">
- <option></option>
- <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
- </select>
-
- <div *ngIf="formErrors.category" class="alert alert-danger">
- {{ formErrors.category }}
- </div>
- </div>
+<div class="margin-content">
+ <div class="title-page title-page-single">
+ <ng-container *ngIf="!videoFileName" i18n>Upload your video</ng-container>
+ <ng-container *ngIf="videoFileName" i18n>Upload {{ videoFileName }}</ng-container>
+ </div>
- <div class="form-group">
- <label for="licence">Licence</label>
- <select class="form-control" id="licence" formControlName="licence">
- <option></option>
- <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
- </select>
+ <div *ngIf="!isUploadingVideo" class="upload-video-container">
+ <div class="upload-video">
+ <div class="icon icon-upload"></div>
- <div *ngIf="formErrors.licence" class="alert alert-danger">
- {{ formErrors.licence }}
- </div>
+ <div class="button-file">
+ <span i18n>Select the file to upload</span>
+ <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" />
</div>
- <div class="form-group">
- <label for="language">Language</label>
- <select class="form-control" id="language" formControlName="language">
- <option></option>
- <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option>
- </select>
-
- <div *ngIf="formErrors.language" class="alert alert-danger">
- {{ formErrors.language }}
+ <div class="form-group form-group-channel">
+ <label i18n for="first-step-channel">Channel</label>
+ <div class="peertube-select-container">
+ <select id="first-step-channel" [(ngModel)]="firstStepChannelId">
+ <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
+ </select>
</div>
</div>
<div class="form-group">
- <label class="label-tags">Tags</label> <span class="little-information">(press enter to add the tag)</span>
- <tag-input
- [ngModel]="tags" [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
- formControlName="tags" maxItems="5" modelAsStrings="true"
- ></tag-input>
- </div>
-
- <div class="form-group">
- <label for="videofile">File</label>
- <div class="btn btn-default btn-file">
- <span>Select the video...</span>
- <input #videofileInput type="file" name="videofile" id="videofile" (change)="fileChange($event)" />
- <input type="hidden" name="videofileHidden" formControlName="videofile"/>
- </div>
- </div>
-
- <div class="file-to-upload">
- <div class="file" *ngIf="filename">
- <span class="filename">{{ filename }}</span>
- <span class="glyphicon glyphicon-remove" (click)="removeFile()"></span>
- </div>
- </div>
-
- <div *ngIf="formErrors.videofile" class="alert alert-danger">
- {{ formErrors.videofile }}
- </div>
-
- <div class="form-group">
- <label for="description">Description</label>
- <my-video-description formControlName="description"></my-video-description>
-
- <div *ngIf="formErrors.description" class="alert alert-danger">
- {{ formErrors.description }}
+ <label i18n for="first-step-privacy">Privacy</label>
+ <div class="peertube-select-container">
+ <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId">
+ <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
+ <option [value]="SPECIAL_SCHEDULED_PRIVACY">Scheduled</option>
+ </select>
</div>
</div>
+ </div>
+ </div>
- <div class="progress">
- <progressbar [value]="progressPercent" max="100">
- <ng-template [ngIf]="progressPercent === 100">
- <span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
- Server is processing the video
- </ng-template>
- </progressbar>
- </div>
+ <div *ngIf="isUploadingVideo" class="upload-progress-cancel">
+ <p-progressBar
+ [value]="videoUploadPercents"
+ [ngClass]="{ processing: videoUploadPercents === 100 && videoUploaded === false }"
+ ></p-progressBar>
+ <input *ngIf="videoUploaded === false" type="button" value="Cancel" (click)="cancelUpload()" />
+ </div>
- <div class="form-group">
- <input
- type="button" value="Upload" class="btn btn-default form-control"
- (click)="upload()"
- >
+ <!-- Hidden because we want to load the component -->
+ <form [hidden]="!isUploadingVideo" novalidate [formGroup]="form">
+ <my-video-edit
+ [form]="form" [formErrors]="formErrors"
+ [validationMessages]="validationMessages" [videoPrivacies]="videoPrivacies" [userVideoChannels]="userVideoChannels"
+ ></my-video-edit>
+
+ <div class="submit-container">
+ <div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
+
+ <div class="submit-button"
+ (click)="updateSecondStep()"
+ [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true || videoUploaded !== true }"
+ >
+ <span class="icon icon-validate"></span>
+ <input type="button" i18n-value value="Publish" />
</div>
- </form>
- </div>
+ </div>
+ </form>
</div>