]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/video-add.component.html
Fix contributing guide concerning unit tests
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / video-add.component.html
index f8355f3dba6aa04c15e30640e3f0588016c15ae8..440556562b72bf39a53f981c5381a9bf628145bc 100644 (file)
@@ -1,45 +1,63 @@
 <div class="margin-content">
   <div class="title-page title-page-single">
-    Upload your video
+    <ng-template [ngIf]="!videoFileName">Upload your video</ng-template>
+    <ng-template [ngIf]="videoFileName">Upload {{ videoFileName }}</ng-template>
   </div>
 
-  <div *ngIf="error" class="alert alert-danger">{{ error }}</div>
-
-  <div class="upload-video-container">
+  <div *ngIf="!isUploadingVideo" class="upload-video-container">
     <div class="upload-video">
       <div class="icon icon-upload"></div>
 
       <div class="button-file">
         <span>Select the file to upload</span>
-        <input #videofileInput type="file" name="videofile" id="videofile" (change)="fileChange($event)" />
+        <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" />
       </div>
 
-      <div class="form-group">
-        <select [(ngModel)]="firstStepPrivacy">
-          <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
-        </select>
+      <div class="form-group form-group-channel">
+        <label 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">
-        <select [(ngModel)]="firstStepChannel">
-          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
-        </select>
+        <label 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>
+          </select>
+        </div>
       </div>
     </div>
+  </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>
 
-    <form *ngIf="isUploadingVideo" novalidate [formGroup]="form">
-      <my-video-edit
-          [form]="form" [formErrors]="formErrors"
-          [validationMessages]="validationMessages" [videoPrivacies]="videoPrivacies"
-      ></my-video-edit>
-
-      <div class="submit-container">
-        <div class="submit-button" [ngClass]="{ disabled: !form.valid }">
-          <span class="icon icon-validate"></span>
-          <input type="button" value="Publish" (click)="upload()" />
-        </div>
+  <!-- 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 *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" value="Publish" />
       </div>
-    </form>
-  </div>
+    </div>
+  </form>
 </div>