]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/video-add.component.html
Begin admin design
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / video-add.component.html
index 3bf4101f4afd763bbfd172d36a9ccf56d7c447f5..a6f2bf6f28e50146e2b8858bd7a7d6f528a63dc8 100644 (file)
-<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">
-        <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></option>
-          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
-        </select>
+<div class="margin-content">
+  <div class="title-page title-page-single">
+    Upload your video
+  </div>
 
-        <div *ngIf="formErrors.channelId" class="alert alert-danger">
-          {{ formErrors.channelId }}
-        </div>
-      </div>
+  <div *ngIf="error" class="alert alert-danger">{{ error }}</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="!isUploadingVideo" class="upload-video-container">
+    <div class="upload-video">
+      <div class="icon icon-upload"></div>
 
-        <div *ngIf="formErrors.category" class="alert alert-danger">
-          {{ formErrors.category }}
-        </div>
+      <div class="button-file">
+        <span>Select the file to upload</span>
+        <input #videofileInput type="file" name="videofile" id="videofile" (change)="fileChange()" />
       </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 [(ngModel)]="firstStepPrivacyId">
+          <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
         </select>
-
-        <div *ngIf="formErrors.licence" class="alert alert-danger">
-          {{ formErrors.licence }}
-        </div>
       </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 [(ngModel)]="firstStepChannelId">
+          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
         </select>
-
-        <div *ngIf="formErrors.language" class="alert alert-danger">
-          {{ formErrors.language }}
-        </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>
+  </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>
+  <p-progressBar
+      *ngIf="isUploadingVideo" [value]="videoUploadPercents"
+      [ngClass]="{ processing: videoUploadPercents === 100 && videoUploaded === false }"
+  ></p-progressBar>
 
-      <div *ngIf="formErrors.videofile" class="alert alert-danger">
-        {{ formErrors.videofile }}
-      </div>
+  <!-- Hidden because we need to load the component -->
+  <form [hidden]="!isUploadingVideo" novalidate [formGroup]="form">
+    <my-video-edit
+        [form]="form" [formErrors]="formErrors"
+        [validationMessages]="validationMessages" [videoPrivacies]="videoPrivacies"
+    ></my-video-edit>
 
-      <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]="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 class="submit-container">
+      <div *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
 
-      <div class="form-group">
-        <input
-          type="button" value="Upload" class="btn btn-default form-control"
-          (click)="upload()"
-        >
+      <div class="submit-button" (click)="updateSecondStep()" [ngClass]="{ disabled: !form.valid || videoUploaded !== true }">
+        <span class="icon icon-validate"></span>
+        <input type="button" value="Publish" />
       </div>
-    </form>
-  </div>
+    </div>
+  </form>
 </div>