Lazy load all routes
[oweals/peertube.git] / client / src / app / +videos / +video-edit / video-add-components / video-upload.component.html
1 <div *ngIf="!isUploadingVideo" class="upload-video-container" dragDrop (fileDropped)="setVideoFile($event)">
2   <div class="first-step-block">
3     <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
4
5     <div class="button-file form-control" [ngbTooltip]="'(extensions: ' + videoExtensions + ')'">
6       <span i18n>Select the file to upload</span>
7       <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus />
8     </div>
9
10     <div class="form-group form-group-channel">
11       <label i18n for="first-step-channel">Channel</label>
12       <div class="peertube-select-container">
13         <select id="first-step-channel" [(ngModel)]="firstStepChannelId" class="form-control">
14           <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
15         </select>
16       </div>
17     </div>
18
19     <div class="form-group">
20       <label i18n for="first-step-privacy">Privacy</label>
21       <div class="peertube-select-container">
22         <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId" class="form-control">
23           <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
24           <option i18n [value]="SPECIAL_SCHEDULED_PRIVACY">Scheduled</option>
25         </select>
26       </div>
27     </div>
28
29     <ng-container *ngIf="isUploadingAudioFile">
30       <div  class="form-group audio-preview">
31         <label i18n for="previewfileUpload">Video background image</label>
32
33         <div i18n class="audio-image-info">
34           Image that will be merged with your audio file.
35           <br />
36           The chosen image will be definitive and cannot be modified.
37         </div>
38
39         <my-preview-upload
40           i18n-inputLabel inputLabel="Edit" inputName="previewfileUpload" [(ngModel)]="previewfileUpload"
41           previewWidth="360px" previewHeight="200px"
42         ></my-preview-upload>
43       </div>
44
45       <div class="form-group upload-audio-button">
46         <my-button className="orange-button" i18n-label [label]="getAudioUploadLabel()" icon="upload" (click)="uploadFirstStep(true)"></my-button>
47       </div>
48     </ng-container>
49   </div>
50 </div>
51
52 <div *ngIf="isUploadingVideo && !error" class="upload-progress-cancel">
53   <div class="progress" i18n-title title="Total video quota">
54     <div class="progress-bar" role="progressbar" [style]="{ width: videoUploadPercents + '%' }" [attr.aria-valuenow]="videoUploadPercents" aria-valuemin="0" [attr.aria-valuemax]="100">
55       <span *ngIf="videoUploadPercents === 100 && videoUploaded === false" i18n>Processing…</span>
56       <span *ngIf="videoUploadPercents !== 100 || videoUploaded">{{ videoUploadPercents }}%</span>
57     </div>
58   </div>
59   <input *ngIf="videoUploaded === false" type="button" value="Cancel" (click)="cancelUpload()" />
60 </div>
61
62 <div *ngIf="error" class="alert alert-danger">
63   <div i18n>Sorry, but something went wrong</div>
64   {{ error }}
65 </div>
66
67 <div *ngIf="videoUploaded && !error" class="alert alert-info" i18n>
68   Congratulations! Your video is now available in your private library.
69 </div>
70
71 <!-- Hidden because we want to load the component -->
72 <form [hidden]="!isUploadingVideo" novalidate [formGroup]="form" class="mb-3">
73   <my-video-edit
74     [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
75     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
76     [waitTranscodingEnabled]="waitTranscodingEnabled"
77   ></my-video-edit>
78
79   <div class="submit-container">
80     <div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
81
82     <div class="submit-button"
83        (click)="updateSecondStep()"
84        [ngClass]="{ disabled: isPublishingButtonDisabled() }"
85     >
86       <my-global-icon iconName="validate" aria-hidden="true"></my-global-icon>
87       <input [disabled]="isPublishingButtonDisabled()" type="button" i18n-value value="Publish" />
88     </div>
89   </div>
90 </form>