Replace helpers with descriptions in admin configuration

This commit is contained in:
Rigel Kent 2020-03-10 21:46:15 +01:00
parent ac940348cd
commit 9b3078581f
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
2 changed files with 57 additions and 46 deletions

View File

@ -486,6 +486,9 @@
<div class="form-row mt-5"> <!-- twitter grid --> <div class="form-row mt-5"> <!-- twitter grid -->
<div class="form-group col-12 col-lg-4 col-xl-3"> <div class="form-group col-12 col-lg-4 col-xl-3">
<div i18n class="inner-form-title">TWITTER</div> <div i18n class="inner-form-title">TWITTER</div>
<div i18n class="inner-form-description">
Optional. If any, provide the Twitter account representing your instance to improve link previews.
</div>
</div> </div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
@ -496,12 +499,6 @@
<div class="form-group"> <div class="form-group">
<label i18n for="signupLimit">Your Twitter username</label> <label i18n for="signupLimit">Your Twitter username</label>
<my-help>
<ng-template ptTemplate="customHtml">
<ng-container i18n>Indicates the Twitter account for the website or platform on which the content was published.</ng-container>
</ng-template>
</my-help>
<input <input
type="text" id="servicesTwitterUsername" type="text" id="servicesTwitterUsername"
formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }"
@ -542,6 +539,10 @@
<div class="form-row mt-5"> <!-- transcoding grid --> <div class="form-row mt-5"> <!-- transcoding grid -->
<div class="form-group col-12 col-lg-4 col-xl-3"> <div class="form-group col-12 col-lg-4 col-xl-3">
<div i18n class="inner-form-title">TRANSCODING</div> <div i18n class="inner-form-title">TRANSCODING</div>
<div i18n class="inner-form-description">
Process uploaded videos so that they are in a streamable form that any device can play. Though costly in
resources, this is a critical part of PeerTube, so tread carefully.
</div>
</div> </div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
@ -565,9 +566,9 @@
inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions"
i18n-labelText labelText="Allow additional extensions" i18n-labelText labelText="Allow additional extensions"
> >
<ng-template ptTemplate="help"> <ng-container ngProjectAs="description">
<ng-container i18n>Allow your users to upload .mkv, .mov, .avi and .flv videos</ng-container> <span i18n>Allow your users to upload .mkv, .mov, .avi and .flv videos.</span>
</ng-template> </ng-container>
</my-peertube-checkbox> </my-peertube-checkbox>
</div> </div>
@ -576,9 +577,9 @@
inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles" inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles"
i18n-labelText labelText="Allow audio files upload" i18n-labelText labelText="Allow audio files upload"
> >
<ng-template ptTemplate="help"> <ng-container ngProjectAs="description">
<ng-container i18n>Allow your users to upload audio files that will be merged with the preview file on upload</ng-container> <span i18n>Allow your users to upload audio files that will be merged with the preview file on upload.</span>
</ng-template> </ng-container>
</my-peertube-checkbox> </my-peertube-checkbox>
</div> </div>
@ -627,6 +628,12 @@
</div> </div>
</ng-container> </ng-container>
</ng-container>
</my-peertube-checkbox>
</div>
<div class="form-group">
<div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
<label i18n for="transcodingThreads">Transcoding threads</label> <label i18n for="transcodingThreads">Transcoding threads</label>
<div class="peertube-select-container"> <div class="peertube-select-container">
@ -639,11 +646,18 @@
<div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
</div> </div>
</div>
<div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
<label i18n for="transcodingThreads">Resolutions to generate</label>
<div class="ml-2 mt-2 d-flex flex-column">
<ng-container formGroupName="resolutions"> <ng-container formGroupName="resolutions">
<div class="form-group" *ngFor="let resolution of resolutions" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> <div class="form-group" *ngFor="let resolution of resolutions">
<my-peertube-checkbox <my-peertube-checkbox
[inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
i18n-labelText labelText="Resolution {{resolution.label}} enabled" labelText="{{resolution.label}}"
> >
<ng-template *ngIf="resolution.description" ptTemplate="help"> <ng-template *ngIf="resolution.description" ptTemplate="help">
<div [innerHTML]="resolution.description"></div> <div [innerHTML]="resolution.description"></div>
@ -651,9 +665,8 @@
</my-peertube-checkbox> </my-peertube-checkbox>
</div> </div>
</ng-container> </ng-container>
</div>
</ng-container>
</my-peertube-checkbox>
</div> </div>
</ng-container> </ng-container>
@ -663,13 +676,9 @@
<div class="form-row mt-4"> <!-- cache grid --> <div class="form-row mt-4"> <!-- cache grid -->
<div class="form-group col-12 col-lg-4 col-xl-3"> <div class="form-group col-12 col-lg-4 col-xl-3">
<div class="inner-form-title"> <div i18n class="inner-form-title">CACHE</div>
<ng-container i18n>CACHE</ng-container> <div i18n class="inner-form-description">
<my-help> Some files are not federated, and fetched when necessary. Define their caching policies.
<ng-template ptTemplate="customHtml">
<ng-container i18n>Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them.</ng-container>
</ng-template>
</my-help>
</div> </div>
</div> </div>
@ -701,6 +710,9 @@
<div class="form-row mt-4"> <!-- cache grid --> <div class="form-row mt-4"> <!-- cache grid -->
<div class="form-group col-12 col-lg-4 col-xl-3"> <div class="form-group col-12 col-lg-4 col-xl-3">
<div i18n class="inner-form-title">CUSTOMIZATIONS</div> <div i18n class="inner-form-title">CUSTOMIZATIONS</div>
<div i18n class="inner-form-description">
Slight modifications to your PeerTube instance for when creating a plugin or theme is overkill.
</div>
</div> </div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">

View File

@ -4,10 +4,9 @@ import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular
import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core'
import { is18nPath } from '../../../shared/models/i18n' import { is18nPath } from '../../../shared/models/i18n'
import { ScreenService } from '@app/shared/misc/screen.service' import { ScreenService } from '@app/shared/misc/screen.service'
import { debounceTime, filter, map, pairwise } from 'rxjs/operators' import { filter, map, pairwise } from 'rxjs/operators'
import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import { I18n } from '@ngx-translate/i18n-polyfill' import { I18n } from '@ngx-translate/i18n-polyfill'
import { fromEvent } from 'rxjs'
import { PlatformLocation, ViewportScroller } from '@angular/common' import { PlatformLocation, ViewportScroller } from '@angular/common'
import { PluginService } from '@app/core/plugins/plugin.service' import { PluginService } from '@app/core/plugins/plugin.service'
import { HooksService } from '@app/core/plugins/hooks.service' import { HooksService } from '@app/core/plugins/hooks.service'