aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/shared/video-edit.component.html
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-08-05 00:50:07 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-11 09:03:39 +0200
commit02c01341f4dae30ec6b81fcb644952393d73c4a8 (patch)
treeaca3f2b118bb123457fd38724be68fe877504c75 /client/src/app/+videos/+video-edit/shared/video-edit.component.html
parent766d13b4470de02d3d7bec94188260b89a356399 (diff)
downloadPeerTube-02c01341f4dae30ec6b81fcb644952393d73c4a8.tar.gz
PeerTube-02c01341f4dae30ec6b81fcb644952393d73c4a8.tar.zst
PeerTube-02c01341f4dae30ec6b81fcb644952393d73c4a8.zip
add ng-select for templatable select options
- create select-tags component to replace ngx-chips - create select-options to factorize option selection in forms - create select-channel to simplify channel selection - refactor tags validation
Diffstat (limited to 'client/src/app/+videos/+video-edit/shared/video-edit.component.html')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.html59
1 files changed, 21 insertions, 38 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
index 4d3b84626..ae3413e79 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
@@ -28,11 +28,10 @@
28 </ng-template> 28 </ng-template>
29 </my-help> 29 </my-help>
30 30
31 <tag-input 31 <my-select-tags labelForId="label-tags" formControlName="tags"></my-select-tags>
32 [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" 32 <div *ngIf="formErrors.tags" class="form-error">
33 i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a new tag" 33 {{ formErrors.tags }}
34 formControlName="tags" [maxItems]="5" [modelAsStrings]="true" 34 </div>
35 ></tag-input>
36 </div> 35 </div>
37 36
38 <div class="form-group"> 37 <div class="form-group">
@@ -56,22 +55,15 @@
56 55
57 <div class="col-video-edit"> 56 <div class="col-video-edit">
58 <div class="form-group"> 57 <div class="form-group">
59 <label i18n>Channel</label> 58 <label i18n for="channel">Channel</label>
60 <div class="peertube-select-container"> 59 <my-select-channel labelForId="channel" [items]="userVideoChannels" formControlName="channelId"></my-select-channel>
61 <select formControlName="channelId" class="form-control">
62 <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
63 </select>
64 </div>
65 </div> 60 </div>
66 61
67 <div class="form-group"> 62 <div class="form-group">
68 <label i18n for="category">Category</label> 63 <label i18n for="category">Category</label>
69 <div class="peertube-select-container"> 64 <my-select-options
70 <select id="category" formControlName="category" class="form-control"> 65 labelForId="category" [items]="videoCategories" formControlName="category" [clearable]="true"
71 <option></option> 66 ></my-select-options>
72 <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
73 </select>
74 </div>
75 67
76 <div *ngIf="formErrors.category" class="form-error"> 68 <div *ngIf="formErrors.category" class="form-error">
77 {{ formErrors.category }} 69 {{ formErrors.category }}
@@ -80,12 +72,9 @@
80 72
81 <div class="form-group"> 73 <div class="form-group">
82 <label i18n for="licence">Licence</label> 74 <label i18n for="licence">Licence</label>
83 <div class="peertube-select-container"> 75 <my-select-options
84 <select id="licence" formControlName="licence" class="form-control"> 76 labelForId="licence" [items]="videoLicences" formControlName="licence" [clearable]="true"
85 <option></option> 77 ></my-select-options>
86 <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
87 </select>
88 </div>
89 78
90 <div *ngIf="formErrors.licence" class="form-error"> 79 <div *ngIf="formErrors.licence" class="form-error">
91 {{ formErrors.licence }} 80 {{ formErrors.licence }}
@@ -94,12 +83,10 @@
94 83
95 <div class="form-group"> 84 <div class="form-group">
96 <label i18n for="language">Language</label> 85 <label i18n for="language">Language</label>
97 <div class="peertube-select-container"> 86 <my-select-options
98 <select id="language" formControlName="language" class="form-control"> 87 labelForId="language" [items]="videoLanguages" formControlName="language"
99 <option></option> 88 [clearable]="true" [searchable]="true" [groupBy]="'group'"
100 <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> 89 ></my-select-options>
101 </select>
102 </div>
103 90
104 <div *ngIf="formErrors.language" class="form-error"> 91 <div *ngIf="formErrors.language" class="form-error">
105 {{ formErrors.language }} 92 {{ formErrors.language }}
@@ -108,13 +95,9 @@
108 95
109 <div class="form-group"> 96 <div class="form-group">
110 <label i18n for="privacy">Privacy</label> 97 <label i18n for="privacy">Privacy</label>
111 <div class="peertube-select-container"> 98 <my-select-options
112 <select id="privacy" formControlName="privacy" class="form-control"> 99 labelForId="privacy" [items]="videoPrivacies" formControlName="privacy" [clearable]="false"
113 <option></option> 100 ></my-select-options>
114 <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
115 <option *ngIf="schedulePublicationPossible" [value]="SPECIAL_SCHEDULED_PRIVACY">Scheduled</option>
116 </select>
117 </div>
118 101
119 <div *ngIf="formErrors.privacy" class="form-error"> 102 <div *ngIf="formErrors.privacy" class="form-error">
120 {{ formErrors.privacy }} 103 {{ formErrors.privacy }}
@@ -136,7 +119,7 @@
136 119
137 <my-peertube-checkbox inputName="nsfw" formControlName="nsfw" helpPlacement="bottom-right"> 120 <my-peertube-checkbox inputName="nsfw" formControlName="nsfw" helpPlacement="bottom-right">
138 <ng-template ptTemplate="label"> 121 <ng-template ptTemplate="label">
139 <ng-container i18n>This video contains mature or explicit content</ng-container> 122 <ng-container i18n>Contains sensitive content</ng-container>
140 </ng-template> 123 </ng-template>
141 124
142 <ng-template ptTemplate="help"> 125 <ng-template ptTemplate="help">
@@ -146,7 +129,7 @@
146 129
147 <my-peertube-checkbox *ngIf="waitTranscodingEnabled" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right"> 130 <my-peertube-checkbox *ngIf="waitTranscodingEnabled" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right">
148 <ng-template ptTemplate="label"> 131 <ng-template ptTemplate="label">
149 <ng-container i18n>Wait transcoding before publishing the video</ng-container> 132 <ng-container i18n>Publish after transcoding</ng-container>
150 </ng-template> 133 </ng-template>
151 134
152 <ng-template ptTemplate="help"> 135 <ng-template ptTemplate="help">