--- /dev/null
+<span *ngIf="value === true" class="glyphicon glyphicon-ok"></span>
+<span *ngIf="value === false" class="glyphicon glyphicon-remove"></span>
+
--- /dev/null
+@import '_variables';
+@import '_mixins';
+
+.glyphicon-ok {
+ color: $green;
+}
+
+.glyphicon-remove {
+ color: $red;
+}
--- /dev/null
+import { Component, Input } from '@angular/core'
+
+@Component({
+ selector: 'my-feature-boolean',
+ templateUrl: './feature-boolean.component.html',
+ styleUrls: [ './feature-boolean.component.scss' ]
+})
+export class FeatureBooleanComponent {
+ @Input() value: boolean
+}
<div class="feature-table">
- <table class="table">
+ <table class="table" *ngIf="config">
<tr>
- <td i18n class="label">Default NSFW/sensitive videos policy (can be redefined by the users)</td>
+ <td i18n class="label">
+ <div>Default NSFW/sensitive videos policy</div>
+ <div class="more-info">can be redefined by the users</div>
+ </td>
<td class="value">{{ buildNSFWLabel() }}</td>
</tr>
- <tr *ngFor="let feature of features">
- <td class="label">{{ feature.label }}</td>
+ <tr>
+ <td i18n class="label">User registration allowed</td>
<td>
- <span *ngIf="feature.value === true" class="glyphicon glyphicon-ok"></span>
- <span *ngIf="feature.value === false" class="glyphicon glyphicon-remove"></span>
+ <my-feature-boolean [value]="config.signup.allowed"></my-feature-boolean>
</td>
</tr>
<tr>
- <td i18n class="label">Video quota</td>
+ <td i18n class="label" colspan="2">Video uploads</td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">Transcoding in multiple resolutions</td>
+ <td>
+ <my-feature-boolean [value]="config.transcoding.enabledResolutions.length !== 0"></my-feature-boolean>
+ </td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">Video uploads</td>
+ <td>
+ <span *ngIf="config.autoBlacklist.videos.ofUsers.enabled">Requires manual validation by moderators</span>
+ <span *ngIf="!config.autoBlacklist.videos.ofUsers.enabled">Automatically published</span>
+ </td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">Video quota</td>
<td class="value">
<ng-container *ngIf="initialUserVideoQuota !== -1">
</ng-container>
</td>
</tr>
+
+ <tr>
+ <td i18n class="label" colspan="2">Import</td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">HTTP import (YouTube, Vimeo, direct URL...)</td>
+ <td>
+ <my-feature-boolean [value]="config.import.videos.http.enabled"></my-feature-boolean>
+ </td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">Torrent import</td>
+ <td>
+ <my-feature-boolean [value]="config.import.videos.torrent.enabled"></my-feature-boolean>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td i18n class="label" colspan="2">Player</td>
+ </tr>
+
+ <tr>
+ <td i18n class="sub-label">P2P enabled</td>
+ <td>
+ <my-feature-boolean [value]="config.tracker.enabled"></my-feature-boolean>
+ </td>
+ </tr>
</table>
</div>
font-size: 14px;
color: var(--mainForegroundColor);
- .label {
- font-weight: $font-semibold;
+ .label,
+ .sub-label {
min-width: 330px;
- }
- .glyphicon-ok {
- color: $green;
+ &.label {
+ font-weight: $font-semibold;
+ }
+
+ &.sub-label {
+ padding-left: 30px;
+ }
+
+ .more-info {
+ font-style: italic;
+ font-weight: initial;
+ font-size: 14px
+ }
}
- .glyphicon-remove {
- color: $red;
+ td {
+ vertical-align: middle;
}
}
+
+
import { Component, OnInit } from '@angular/core'
import { ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
+import { ServerConfig } from '@shared/models'
@Component({
selector: 'my-instance-features-table',
styleUrls: [ './instance-features-table.component.scss' ]
})
export class InstanceFeaturesTableComponent implements OnInit {
- features: { label: string, value?: boolean }[] = []
quotaHelpIndication = ''
+ config: ServerConfig
constructor (
private i18n: I18n,
ngOnInit () {
this.serverService.configLoaded
.subscribe(() => {
- this.buildFeatures()
+ this.config = this.serverService.getConfig()
this.buildQuotaHelpIndication()
})
}
if (policy === 'display') return this.i18n('Displayed')
}
- private buildFeatures () {
- const config = this.serverService.getConfig()
-
- this.features = [
- {
- label: this.i18n('User registration allowed'),
- value: config.signup.allowed
- },
- {
- label: this.i18n('Video uploads require manual validation by moderators'),
- value: config.autoBlacklist.videos.ofUsers.enabled
- },
- {
- label: this.i18n('Transcode your videos in multiple resolutions'),
- value: config.transcoding.enabledResolutions.length !== 0
- },
- {
- label: this.i18n('HTTP import (YouTube, Vimeo, direct URL...)'),
- value: config.import.videos.http.enabled
- },
- {
- label: this.i18n('Torrent import'),
- value: config.import.videos.torrent.enabled
- },
- {
- label: this.i18n('P2P enabled'),
- value: config.tracker.enabled
- }
- ]
- }
-
private getApproximateTime (seconds: number) {
const hours = Math.floor(seconds / 3600)
let pluralSuffix = ''
import { ClipboardModule } from 'ngx-clipboard'
import { FollowService } from '@app/shared/instance/follow.service'
import { MultiSelectModule } from 'primeng/multiselect'
+import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.component'
@NgModule({
imports: [
SubscribeButtonComponent,
RemoteSubscribeComponent,
InstanceFeaturesTableComponent,
+ FeatureBooleanComponent,
UserBanModalComponent,
UserModerationDropdownComponent,
TopMenuDropdownComponent,