]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-edit/video-update.component.html
Improve real world script
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-edit / video-update.component.html
index 2e10d5bf7a4d872f55c42733aacd3178c118717d..7f4faf21bb0e0cec179ce4c741e0b31db37fa8f4 100644 (file)
-<h3>Update {{ video?.name }}</h3>
+<div class="row">
+  <div class="content-padding">
 
-<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
+  <h3>Update {{ video?.name }}</h3>
 
-<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 *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>
 
-  <div class="form-group">
-    <label for="nsfw">NSFW</label>
-    <input
-      type="checkbox" id="nsfw"
-      formControlName="nsfw"
-    >
-  </div>
+    <div class="form-group">
+      <label for="nsfw">NSFW</label>
+      <input
+        type="checkbox" id="nsfw"
+        formControlName="nsfw"
+      >
+    </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 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 *ngIf="formErrors.category" class="alert alert-danger">
+        {{ formErrors.category }}
+      </div>
     </div>
-  </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 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="formErrors.licence" class="alert alert-danger">
-      {{ formErrors.licence }}
+      <div *ngIf="formErrors.licence" class="alert alert-danger">
+        {{ formErrors.licence }}
+      </div>
     </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>
+    <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 *ngIf="formErrors.language" class="alert alert-danger">
+        {{ formErrors.language }}
+      </div>
     </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 class="form-group">
+      <label for="tags" 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="3" modelAsStrings="true"
+      ></tag-input>
     </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 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>
-
-  <div *ngIf="tagsError" class="alert alert-danger">
-    {{ tagsError }}
-  </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 class="form-group">
+      <input
+        type="button" value="Update" class="btn btn-default form-control"
+        (click)="update()"
+      >
     </div>
+  </form>
   </div>
-
-  <div class="form-group">
-    <input
-      type="button" value="Update" class="btn btn-default form-control"
-      (click)="update()"
-    >
-  </div>
-</form>
+</div>