aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html81
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss5
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts2
-rw-r--r--client/src/app/search/search.component.html2
-rw-r--r--client/src/app/shared/forms/peertube-checkbox.component.html55
-rw-r--r--client/src/app/shared/forms/peertube-checkbox.component.scss10
6 files changed, 105 insertions, 50 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
index ac0447d25..f61593677 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
@@ -165,7 +165,7 @@
165 165
166 <div class="form-group"> 166 <div class="form-group">
167 <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label> 167 <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label>
168 <div class="label-small-info">With you own funds? With users donations? Advertising?</div> 168 <div class="label-small-info">With your own funds? With users donations? Advertising?</div>
169 169
170 <textarea 170 <textarea
171 id="instanceBusinessModel" formControlName="businessModel" class="small" 171 id="instanceBusinessModel" formControlName="businessModel" class="small"
@@ -233,23 +233,23 @@
233 <my-peertube-checkbox 233 <my-peertube-checkbox
234 inputName="signupEnabled" formControlName="enabled" 234 inputName="signupEnabled" formControlName="enabled"
235 i18n-labelText labelText="Signup enabled" 235 i18n-labelText labelText="Signup enabled"
236 ></my-peertube-checkbox>
237 </div>
238
239 <div class="form-group">
240 <my-peertube-checkbox *ngIf="isSignupEnabled()"
241 inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification"
242 i18n-labelText labelText="Signup requires email verification"
243 ></my-peertube-checkbox>
244 </div>
245
246 <div *ngIf="isSignupEnabled()" class="form-group">
247 <label i18n for="signupLimit">Signup limit</label>
248 <input
249 type="text" id="signupLimit"
250 formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
251 > 236 >
252 <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div> 237 <ng-container ngProjectAs="extra">
238 <my-peertube-checkbox [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }"
239 inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification"
240 i18n-labelText labelText="Signup requires email verification"
241 ></my-peertube-checkbox>
242
243 <div [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }" class="mt-3">
244 <label i18n for="signupLimit">Signup limit</label>
245 <input
246 type="text" id="signupLimit"
247 formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
248 >
249 <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div>
250 </div>
251 </ng-container>
252 </my-peertube-checkbox>
253 </div> 253 </div>
254 </ng-container> 254 </ng-container>
255 255
@@ -291,14 +291,14 @@
291 <div class="form-group" formGroupName="http"> 291 <div class="form-group" formGroupName="http">
292 <my-peertube-checkbox 292 <my-peertube-checkbox
293 inputName="importVideosHttpEnabled" formControlName="enabled" 293 inputName="importVideosHttpEnabled" formControlName="enabled"
294 i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled" 294 i18n-labelText labelText="Allow import with HTTP URL (i.e. YouTube)"
295 ></my-peertube-checkbox> 295 ></my-peertube-checkbox>
296 </div> 296 </div>
297 297
298 <div class="form-group" formGroupName="torrent"> 298 <div class="form-group" formGroupName="torrent">
299 <my-peertube-checkbox 299 <my-peertube-checkbox
300 inputName="importVideosTorrentEnabled" formControlName="enabled" 300 inputName="importVideosTorrentEnabled" formControlName="enabled"
301 i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled" 301 i18n-labelText labelText="Allow import with a torrent file or a magnet URI"
302 ></my-peertube-checkbox> 302 ></my-peertube-checkbox>
303 </div> 303 </div>
304 304
@@ -315,8 +315,12 @@
315 <div class="form-group"> 315 <div class="form-group">
316 <my-peertube-checkbox 316 <my-peertube-checkbox
317 inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled" 317 inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled"
318 i18n-labelText labelText="New videos of users automatically blacklisted enabled" 318 i18n-labelText labelText="Blacklist new videos automatically"
319 ></my-peertube-checkbox> 319 >
320 <ng-container ngProjectAs="description">
321 <span i18n>Videos of regular users will stay private until a moderator reviews them. Can be overriden per user.</span>
322 </ng-container>
323 </my-peertube-checkbox>
320 </div> 324 </div>
321 325
322 </ng-container> 326 </ng-container>
@@ -339,7 +343,7 @@
339 <div class="form-group"> 343 <div class="form-group">
340 <my-peertube-checkbox 344 <my-peertube-checkbox
341 inputName="followersInstanceManualApproval" formControlName="manualApproval" 345 inputName="followersInstanceManualApproval" formControlName="manualApproval"
342 i18n-labelText labelText="Manually approve new instance follower" 346 i18n-labelText labelText="Manually approve new instance followers"
343 ></my-peertube-checkbox> 347 ></my-peertube-checkbox>
344 </div> 348 </div>
345 </ng-container> 349 </ng-container>
@@ -355,7 +359,11 @@
355 <my-peertube-checkbox 359 <my-peertube-checkbox
356 inputName="followingsInstanceAutoFollowBackEnabled" formControlName="enabled" 360 inputName="followingsInstanceAutoFollowBackEnabled" formControlName="enabled"
357 i18n-labelText labelText="Automatically follow other instances that follow you" 361 i18n-labelText labelText="Automatically follow other instances that follow you"
358 ></my-peertube-checkbox> 362 >
363 <ng-container ngProjectAs="description">
364 <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</span>
365 </ng-container>
366 </my-peertube-checkbox>
359 </div> 367 </div>
360 </ng-container> 368 </ng-container>
361 369
@@ -363,17 +371,24 @@
363 <div class="form-group"> 371 <div class="form-group">
364 <my-peertube-checkbox 372 <my-peertube-checkbox
365 inputName="followingsInstanceAutoFollowIndexEnabled" formControlName="enabled" 373 inputName="followingsInstanceAutoFollowIndexEnabled" formControlName="enabled"
366 i18n-labelText labelText="Automatically follow instance of the public index (below)" 374 i18n-labelText labelText="Automatically follow instances of the public index"
367 ></my-peertube-checkbox> 375 [(ngModel)]="isAutoFollowIndexEnabled"
368 </div>
369
370 <div class="form-group">
371 <label i18n for="followingsInstanceAutoFollowIndexUrl">Index URL</label>
372 <input
373 type="text" id="followingsInstanceAutoFollowIndexUrl"
374 formControlName="indexUrl" [ngClass]="{ 'input-error': formErrors['followings.instance.autoFollowIndex.indexUrl'] }"
375 > 376 >
376 <div *ngIf="formErrors.followings.instance.autoFollowIndex.indexUrl" class="form-error">{{ formErrors.followings.instance.autoFollowIndex.indexUrl }}</div> 377 <ng-container ngProjectAs="description">
378 <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</span>
379 </ng-container>
380
381 <ng-container ngProjectAs="extra">
382 <div [ngClass]="{ 'disabled-checkbox-extra': !isAutoFollowIndexEnabled }">
383 <label i18n for="followingsInstanceAutoFollowIndexUrl">Index URL</label>
384 <input
385 type="text" id="followingsInstanceAutoFollowIndexUrl"
386 formControlName="indexUrl" [ngClass]="{ 'input-error': formErrors['followings.instance.autoFollowIndex.indexUrl'] }"
387 >
388 <div *ngIf="formErrors.followings.instance.autoFollowIndex.indexUrl" class="form-error">{{ formErrors.followings.instance.autoFollowIndex.indexUrl }}</div>
389 </div>
390 </ng-container>
391 </my-peertube-checkbox>
377 </div> 392 </div>
378 393
379 </ng-container> 394 </ng-container>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
index 2b4d0da2c..60d608028 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
@@ -53,3 +53,8 @@ textarea {
53 font-style: italic; 53 font-style: italic;
54 margin-bottom: 10px; 54 margin-bottom: 10px;
55} 55}
56
57.disabled-checkbox-extra {
58 opacity: .5;
59 pointer-events: none;
60}
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 49bb4db0e..1bc907b73 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -24,6 +24,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
24 languageItems: SelectItem[] = [] 24 languageItems: SelectItem[] = []
25 categoryItems: SelectItem[] = [] 25 categoryItems: SelectItem[] = []
26 26
27 isAutoFollowIndexEnabled = false
28
27 private serverConfig: ServerConfig 29 private serverConfig: ServerConfig
28 30
29 constructor ( 31 constructor (
diff --git a/client/src/app/search/search.component.html b/client/src/app/search/search.component.html
index 496ee970a..a4a1d41b3 100644
--- a/client/src/app/search/search.component.html
+++ b/client/src/app/search/search.component.html
@@ -2,7 +2,7 @@
2 <div class="results-header"> 2 <div class="results-header">
3 <div class="first-line"> 3 <div class="first-line">
4 <div class="results-counter" *ngIf="pagination.totalItems"> 4 <div class="results-counter" *ngIf="pagination.totalItems">
5 <span i18n>{{ pagination.totalItems | myNumberFormatter }} results</span> 5 <span i18n>{{ pagination.totalItems | myNumberFormatter }} {pagination.totalItems, plural, =1 {result} other {results}}</span>
6 <span *ngIf="currentSearch" i18n> 6 <span *ngIf="currentSearch" i18n>
7 for <span class="search-value">{{ currentSearch }}</span> 7 for <span class="search-value">{{ currentSearch }}</span>
8 </span> 8 </span>
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.html b/client/src/app/shared/forms/peertube-checkbox.component.html
index 1c0114d97..c740d852c 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.html
+++ b/client/src/app/shared/forms/peertube-checkbox.component.html
@@ -1,18 +1,43 @@
1<div class="root"> 1<div class="root flex-column">
2 <label class="form-group-checkbox"> 2 <div class="d-flex">
3 <input type="checkbox" [(ngModel)]="checked" (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="disabled" /> 3 <label class="form-group-checkbox">
4 <span role="checkbox" [attr.aria-checked]="checked"></span> 4 <input
5 <span *ngIf="labelText">{{ labelText }}</span> 5 type="checkbox"
6 <span *ngIf="!labelText && labelInnerHTML" [innerHTML]="labelInnerHTML"></span> 6 [(ngModel)]="checked"
7 (ngModelChange)="onModelChange()"
8 [id]="inputName"
9 [disabled]="disabled"
10 />
11 <span role="checkbox" [attr.aria-checked]="checked"></span>
12 <span *ngIf="labelText">{{ labelText }}</span>
13 <span
14 *ngIf="!labelText && labelInnerHTML"
15 [innerHTML]="labelInnerHTML"
16 ></span>
7 17
8 <span *ngIf="labelTemplate"> 18 <span *ngIf="labelTemplate">
9 <ng-container *ngTemplateOutlet="labelTemplate"></ng-container> 19 <ng-container *ngTemplateOutlet="labelTemplate"></ng-container>
10 </span> 20 </span>
11 </label> 21 </label>
22
23 <my-help
24 *ngIf="helpTemplate"
25 [tooltipPlacement]="helpPlacement"
26 helpType="custom"
27 >
28 <ng-template ptTemplate="customHtml">
29 <ng-template *ngTemplateOutlet="helpTemplate"></ng-template>
30 </ng-template>
31 </my-help>
32 </div>
12 33
13 <my-help *ngIf="helpTemplate" [tooltipPlacement]="helpPlacement" helpType="custom"> 34 <div class="ml-4 d-flex flex-column">
14 <ng-template ptTemplate="customHtml"> 35 <small class="wrapper mt-2 text-muted">
15 <ng-template *ngTemplateOutlet="helpTemplate"></ng-template> 36 <ng-content select="description"></ng-content>
16 </ng-template> 37 </small>
17 </my-help> 38
39 <span class="wrapper mt-3">
40 <ng-content select="extra"></ng-content>
41 </span>
42 </div>
18</div> 43</div>
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.scss b/client/src/app/shared/forms/peertube-checkbox.component.scss
index 3b467d49d..3120509b3 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.scss
+++ b/client/src/app/shared/forms/peertube-checkbox.component.scss
@@ -26,4 +26,12 @@
26 position: relative; 26 position: relative;
27 top: 2px; 27 top: 2px;
28 } 28 }
29} 29
30 small {
31 font-size: 90%;
32 }
33
34 .wrapper:empty {
35 display: none;
36 }
37} \ No newline at end of file