X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fadmin.component.ts;h=dd92ed2caffaed20564d9d331ab116e800ac3d21;hb=1fd61899eaea245a5844e33e21f04b2562f16e5e;hp=4345d1945e6567aa6462ee39f2fb5a0399d9258d;hpb=ec903c010ecc54ec2acad0bf2cf10e7fbf6a0fa2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 4345d1945..dd92ed2ca 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit } from '@angular/core' -import { AuthService } from '@app/core' +import { AuthService, ScreenService } from '@app/core' import { ListOverflowItem } from '@app/shared/shared-main' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { UserRight } from '@shared/models' import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component' +import { UserRight } from '@shared/models' @Component({ templateUrl: './admin.component.html', @@ -15,25 +14,29 @@ export class AdminComponent implements OnInit { constructor ( private auth: AuthService, - private i18n: I18n - ) {} + private screen: ScreenService + ) { } + + get isBroadcastMessageDisplayed () { + return this.screen.isBroadcastMessageDisplayed + } ngOnInit () { const federationItems: TopMenuDropdownParam = { - label: this.i18n('Federation'), + label: $localize`Federation`, children: [ { - label: this.i18n('Instances you follow'), + label: $localize`Instances you follow`, routerLink: '/admin/follows/following-list', iconName: 'following' }, { - label: this.i18n('Instances following you'), + label: $localize`Instances following you`, routerLink: '/admin/follows/followers-list', iconName: 'follower' }, { - label: this.i18n('Video redundancies'), + label: $localize`Video redundancies`, routerLink: '/admin/follows/video-redundancies-list', iconName: 'videos' } @@ -41,45 +44,64 @@ export class AdminComponent implements OnInit { } const moderationItems: TopMenuDropdownParam = { - label: this.i18n('Moderation'), + label: $localize`Moderation`, children: [] } if (this.hasAbusesRight()) { moderationItems.children.push({ - label: this.i18n('Reports'), + label: $localize`Reports`, routerLink: '/admin/moderation/abuses/list', iconName: 'flag' }) } if (this.hasVideoBlocklistRight()) { moderationItems.children.push({ - label: this.i18n('Video blocks'), + label: $localize`Video blocks`, routerLink: '/admin/moderation/video-blocks/list', iconName: 'cross' }) } + if (this.hasVideoCommentsRight()) { + moderationItems.children.push({ + label: $localize`Video comments`, + routerLink: '/admin/moderation/video-comments/list', + iconName: 'message-circle' + }) + } if (this.hasAccountsBlocklistRight()) { moderationItems.children.push({ - label: this.i18n('Muted accounts'), + label: $localize`Muted accounts`, routerLink: '/admin/moderation/blocklist/accounts', - iconName: 'user' + iconName: 'user-x' }) } if (this.hasServersBlocklistRight()) { moderationItems.children.push({ - label: this.i18n('Muted servers'), + label: $localize`Muted servers`, routerLink: '/admin/moderation/blocklist/servers', - iconName: 'server' + iconName: 'peertube-x' }) } - if (this.hasUsersRight()) this.menuEntries.push({ label: this.i18n('Users'), routerLink: '/admin/users' }) + if (this.hasUsersRight()) { + this.menuEntries.push({ label: $localize`Users`, routerLink: '/admin/users' }) + } + if (this.hasServerFollowRight()) this.menuEntries.push(federationItems) if (this.hasAbusesRight() || this.hasVideoBlocklistRight()) this.menuEntries.push(moderationItems) - if (this.hasConfigRight()) this.menuEntries.push({ label: this.i18n('Configuration'), routerLink: '/admin/config' }) - if (this.hasPluginsRight()) this.menuEntries.push({ label: this.i18n('Plugins/Themes'), routerLink: '/admin/plugins' }) - if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) this.menuEntries.push({ label: this.i18n('System'), routerLink: '/admin/system' }) + + if (this.hasConfigRight()) { + this.menuEntries.push({ label: $localize`Configuration`, routerLink: '/admin/config' }) + } + + if (this.hasPluginsRight()) { + this.menuEntries.push({ label: $localize`Plugins/Themes`, routerLink: '/admin/plugins' }) + } + + if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) { + this.menuEntries.push({ label: $localize`System`, routerLink: '/admin/system' }) + } } hasUsersRight () { @@ -125,4 +147,8 @@ export class AdminComponent implements OnInit { hasDebugRight () { return this.auth.getUser().hasRight(UserRight.MANAGE_DEBUG) } + + hasVideoCommentsRight () { + return this.auth.getUser().hasRight(UserRight.SEE_ALL_COMMENTS) + } }