]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
Implement contact form on server side
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-custom-config.component.html
1 <form role="form" [formGroup]="form">
2
3 <ngb-tabset class="root-tabset bootstrap">
4
5 <ngb-tab i18n-title title="Basic configuration">
6 <ng-template ngbTabContent>
7
8 <div i18n class="inner-form-title">Instance</div>
9
10 <div class="form-group">
11 <label i18n for="instanceName">Name</label>
12 <input
13 type="text" id="instanceName"
14 formControlName="instanceName" [ngClass]="{ 'input-error': formErrors['instanceName'] }"
15 >
16 <div *ngIf="formErrors.instanceName" class="form-error">
17 {{ formErrors.instanceName }}
18 </div>
19 </div>
20
21 <div class="form-group">
22 <label i18n for="instanceShortDescription">Short description</label>
23 <textarea
24 id="instanceShortDescription" formControlName="instanceShortDescription"
25 [ngClass]="{ 'input-error': formErrors['instanceShortDescription'] }"
26 ></textarea>
27 <div *ngIf="formErrors.instanceShortDescription" class="form-error">
28 {{ formErrors.instanceShortDescription }}
29 </div>
30 </div>
31
32 <div class="form-group">
33 <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help>
34 <my-markdown-textarea
35 id="instanceDescription" formControlName="instanceDescription" textareaWidth="500px" [previewColumn]="true"
36 [classes]="{ 'input-error': formErrors['instanceDescription'] }"
37 ></my-markdown-textarea>
38 <div *ngIf="formErrors.instanceDescription" class="form-error">
39 {{ formErrors.instanceDescription }}
40 </div>
41 </div>
42
43 <div class="form-group">
44 <label i18n for="instanceTerms">Terms</label><my-help helpType="markdownText"></my-help>
45 <my-markdown-textarea
46 id="instanceTerms" formControlName="instanceTerms" textareaWidth="500px" [previewColumn]="true"
47 [ngClass]="{ 'input-error': formErrors['instanceTerms'] }"
48 ></my-markdown-textarea>
49 <div *ngIf="formErrors.instanceTerms" class="form-error">
50 {{ formErrors.instanceTerms }}
51 </div>
52 </div>
53
54 <div class="form-group">
55 <label i18n for="instanceDefaultClientRoute">Default client route</label>
56 <div class="peertube-select-container">
57 <select id="instanceDefaultClientRoute" formControlName="instanceDefaultClientRoute">
58 <option i18n value="/videos/overview">Videos Overview</option>
59 <option i18n value="/videos/trending">Videos Trending</option>
60 <option i18n value="/videos/recently-added">Videos Recently Added</option>
61 <option i18n value="/videos/local">Local videos</option>
62 </select>
63 </div>
64 <div *ngIf="formErrors.instanceDefaultClientRoute" class="form-error">
65 {{ formErrors.instanceDefaultClientRoute }}
66 </div>
67 </div>
68
69 <div class="form-group">
70 <label i18n for="instanceDefaultNSFWPolicy">Policy on videos containing sensitive content</label>
71 <my-help
72 helpType="custom" i18n-customHtml
73 customHtml="With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video."
74 ></my-help>
75
76 <div class="peertube-select-container">
77 <select id="instanceDefaultNSFWPolicy" formControlName="instanceDefaultNSFWPolicy">
78 <option i18n value="do_not_list">Do not list</option>
79 <option i18n value="blur">Blur thumbnails</option>
80 <option i18n value="display">Display</option>
81 </select>
82 </div>
83 <div *ngIf="formErrors.instanceDefaultNSFWPolicy" class="form-error">
84 {{ formErrors.instanceDefaultNSFWPolicy }}
85 </div>
86 </div>
87
88 <div i18n class="inner-form-title">Signup</div>
89
90 <div class="form-group">
91 <my-peertube-checkbox
92 inputName="signupEnabled" formControlName="signupEnabled"
93 i18n-labelText labelText="Signup enabled"
94 ></my-peertube-checkbox>
95 </div>
96
97 <div class="form-group">
98 <my-peertube-checkbox *ngIf="isSignupEnabled()"
99 inputName="signupRequiresEmailVerification" formControlName="signupRequiresEmailVerification"
100 i18n-labelText labelText="Signup requires email verification"
101 ></my-peertube-checkbox>
102 </div>
103
104 <div *ngIf="isSignupEnabled()" class="form-group">
105 <label i18n for="signupLimit">Signup limit</label>
106 <input
107 type="text" id="signupLimit"
108 formControlName="signupLimit" [ngClass]="{ 'input-error': formErrors['signupLimit'] }"
109 >
110 <div *ngIf="formErrors.signupLimit" class="form-error">
111 {{ formErrors.signupLimit }}
112 </div>
113 </div>
114
115 <div i18n class="inner-form-title">Import</div>
116
117 <div class="form-group">
118 <my-peertube-checkbox
119 inputName="importVideosHttpEnabled" formControlName="importVideosHttpEnabled"
120 i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled"
121 ></my-peertube-checkbox>
122 </div>
123
124 <div class="form-group">
125 <my-peertube-checkbox
126 inputName="importVideosTorrentEnabled" formControlName="importVideosTorrentEnabled"
127 i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled"
128 ></my-peertube-checkbox>
129 </div>
130
131 <div i18n class="inner-form-title">Administrator</div>
132
133 <div class="form-group">
134 <label i18n for="adminEmail">Admin email</label>
135 <input
136 type="text" id="adminEmail"
137 formControlName="adminEmail" [ngClass]="{ 'input-error': formErrors['adminEmail'] }"
138 >
139 <div *ngIf="formErrors.adminEmail" class="form-error">
140 {{ formErrors.adminEmail }}
141 </div>
142 </div>
143
144 <div i18n class="inner-form-title">Users</div>
145
146 <div class="form-group">
147 <label i18n for="userVideoQuota">User default video quota</label>
148 <div class="peertube-select-container">
149 <select id="userVideoQuota" formControlName="userVideoQuota">
150 <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value">
151 {{ videoQuotaOption.label }}
152 </option>
153 </select>
154 </div>
155 <div *ngIf="formErrors.userVideoQuota" class="form-error">
156 {{ formErrors.userVideoQuota }}
157 </div>
158 </div>
159
160 <div class="form-group">
161 <label i18n for="userVideoQuotaDaily">User default daily upload limit</label>
162 <div class="peertube-select-container">
163 <select id="userVideoQuotaDaily" formControlName="userVideoQuotaDaily">
164 <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value">
165 {{ videoQuotaDailyOption.label }}
166 </option>
167 </select>
168 </div>
169 <div *ngIf="formErrors.userVideoQuotaDaily" class="form-error">
170 {{ formErrors.userVideoQuotaDaily }}
171 </div>
172 </div>
173 </ng-template>
174 </ngb-tab>
175
176 <ngb-tab i18n-title title="Services">
177 <ng-template ngbTabContent>
178 <div i18n class="inner-form-title">Twitter</div>
179
180 <div class="form-group">
181 <label i18n for="signupLimit">Your Twitter username</label>
182 <my-help
183 helpType="custom" i18n-customHtml
184 customHtml="Indicates the Twitter account for the website or platform on which the content was published."
185 ></my-help>
186 <input
187 type="text" id="servicesTwitterUsername"
188 formControlName="servicesTwitterUsername" [ngClass]="{ 'input-error': formErrors['servicesTwitterUsername'] }"
189 >
190 <div *ngIf="formErrors.servicesTwitterUsername" class="form-error">
191 {{ formErrors.servicesTwitterUsername }}
192 </div>
193 </div>
194
195 <div class="form-group">
196 <my-peertube-checkbox
197 inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted"
198 i18n-labelText labelText="Instance whitelisted by Twitter"
199 i18n-helpHtml helpHtml="If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
200 If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br />
201 Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a> to see if you instance is whitelisted."
202 ></my-peertube-checkbox>
203 </div>
204 </ng-template>
205 </ngb-tab>
206
207 <ngb-tab i18n-title title="Advanced configuration">
208 <ng-template ngbTabContent>
209
210 <div i18n class="inner-form-title">Transcoding</div>
211
212 <div class="form-group">
213 <my-peertube-checkbox
214 inputName="transcodingEnabled" formControlName="transcodingEnabled"
215 i18n-labelText labelText="Transcoding enabled"
216 i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!"
217 ></my-peertube-checkbox>
218 </div>
219
220 <ng-template [ngIf]="isTranscodingEnabled()">
221
222 <div class="form-group">
223 <my-peertube-checkbox
224 inputName="transcodingAllowAdditionalExtensions" formControlName="transcodingAllowAdditionalExtensions"
225 i18n-labelText labelText="Allow additional extensions"
226 i18n-helpHtml helpHtml="Allow your users to upload .mkv, .mov, .avi, .flv videos"
227 ></my-peertube-checkbox>
228 </div>
229
230 <div class="form-group">
231 <label i18n for="transcodingThreads">Transcoding threads</label>
232 <div class="peertube-select-container">
233 <select id="transcodingThreads" formControlName="transcodingThreads">
234 <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
235 {{ transcodingThreadOption.label }}
236 </option>
237 </select>
238 </div>
239 <div *ngIf="formErrors.transcodingThreads" class="form-error">
240 {{ formErrors.transcodingThreads }}
241 </div>
242 </div>
243
244 <div class="form-group" *ngFor="let resolution of resolutions">
245 <my-peertube-checkbox
246 [inputName]="getResolutionKey(resolution)" [formControlName]="getResolutionKey(resolution)"
247 i18n-labelText labelText="Resolution {{resolution}} enabled"
248 ></my-peertube-checkbox>
249 </div>
250 </ng-template>
251
252 <div i18n class="inner-form-title">
253 Cache
254
255 <my-help
256 helpType="custom" i18n-customHtml
257 customHtml="Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them."
258 ></my-help>
259 </div>
260
261 <div class="form-group">
262 <label i18n for="cachePreviewsSize">Previews cache size</label>
263 <input
264 type="text" id="cachePreviewsSize"
265 formControlName="cachePreviewsSize" [ngClass]="{ 'input-error': formErrors['cachePreviewsSize'] }"
266 >
267 <div *ngIf="formErrors.cachePreviewsSize" class="form-error">
268 {{ formErrors.cachePreviewsSize }}
269 </div>
270 </div>
271
272 <div class="form-group">
273 <label i18n for="cachePreviewsSize">Video captions cache size</label>
274 <input
275 type="text" id="cacheCaptionsSize"
276 formControlName="cacheCaptionsSize" [ngClass]="{ 'input-error': formErrors['cacheCaptionsSize'] }"
277 >
278 <div *ngIf="formErrors.cacheCaptionsSize" class="form-error">
279 {{ formErrors.cacheCaptionsSize }}
280 </div>
281 </div>
282
283 <div i18n class="inner-form-title">Customizations</div>
284
285 <div class="form-group">
286 <label i18n for="customizationJavascript">JavaScript</label>
287 <my-help
288 helpType="custom" i18n-customHtml
289 customHtml="Write directly JavaScript code.<br />Example: <pre>console.log('my instance is amazing');</pre>"
290 ></my-help>
291 <textarea
292 id="customizationJavascript" formControlName="customizationJavascript"
293 [ngClass]="{ 'input-error': formErrors['customizationJavascript'] }"
294 ></textarea>
295 <div *ngIf="formErrors.customizationJavascript" class="form-error">
296 {{ formErrors.customizationJavascript }}
297 </div>
298 </div>
299
300 <div class="form-group">
301 <label for="customizationCSS">CSS</label>
302 <my-help
303 helpType="custom"
304 i18n-customHtml
305 customHtml="
306 Write directly CSS code. Example:<br />
307 <pre>
308 body {{ '{' }}
309 background-color: red;
310 {{ '}' }}
311 </pre>
312
313 Prepend with <em>#custom-css</em> to override styles. Example:
314 <pre>
315 #custom-css .logged-in-email {{ '{' }}
316 color: red;
317 {{ '}' }}
318 </pre>
319 "
320 ></my-help>
321 <textarea
322 id="customizationCSS" formControlName="customizationCSS"
323 [ngClass]="{ 'input-error': formErrors['customizationCSS'] }"
324 ></textarea>
325 <div *ngIf="formErrors.customizationCSS" class="form-error">
326 {{ formErrors.customizationCSS }}
327 </div>
328 </div>
329 </ng-template>
330 </ngb-tab>
331 </ngb-tabset>
332
333 <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid">
334 <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span>
335 </form>