import { FollowsRoutes } from './follows'
import { JobsRoutes } from './jobs/job.routes'
import { UsersRoutes } from './users'
-import { VideoAbusesRoutes } from './video-abuses'
-import { VideoBlacklistRoutes } from './video-blacklist'
+import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
const adminRoutes: Routes = [
{
},
...FollowsRoutes,
...UsersRoutes,
- ...VideoAbusesRoutes,
- ...VideoBlacklistRoutes,
+ ...ModerationRoutes,
...JobsRoutes,
...ConfigRoutes
]
Manage follows
</a>
- <a i18n *ngIf="hasVideoAbusesRight()" routerLink="/admin/video-abuses" routerLinkActive="active" class="title-page">
- Video abuses
- </a>
-
- <a i18n *ngIf="hasVideoBlacklistRight()" routerLink="/admin/video-blacklist" routerLinkActive="active" class="title-page">
- Video blacklist
+ <a i18n *ngIf="hasVideoAbusesRight() || hasVideoBlacklistRight()" routerLink="/admin/moderation" routerLinkActive="active" class="title-page">
+ Moderation
</a>
<a i18n *ngIf="hasJobsRight()" routerLink="/admin/jobs" routerLinkActive="active" class="title-page">
import { JobsListComponent } from './jobs/jobs-list/jobs-list.component'
import { JobService } from './jobs/shared/job.service'
import { UserCreateComponent, UserListComponent, UsersComponent, UserService, UserUpdateComponent } from './users'
-import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoAbusesComponent } from './video-abuses'
-import { VideoBlacklistComponent, VideoBlacklistListComponent } from './video-blacklist'
+import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlacklistListComponent } from './moderation'
import { UserBanModalComponent } from '@app/+admin/users/user-list/user-ban-modal.component'
+import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
@NgModule({
imports: [
UserListComponent,
UserBanModalComponent,
- VideoBlacklistComponent,
+ ModerationComponent,
VideoBlacklistListComponent,
-
- VideoAbusesComponent,
VideoAbuseListComponent,
ModerationCommentModalComponent,
--- /dev/null
+export * from './video-abuse-list'
+export * from './video-blacklist-list'
+export * from './moderation.component'
+export * from './moderation.routes'
--- /dev/null
+<div class="admin-sub-header">
+ <div i18n class="form-sub-title">Moderation</div>
+
+ <div class="admin-sub-nav">
+ <a *ngIf="hasVideoAbusesRight()" i18n routerLink="video-abuses/list" routerLinkActive="active">Video abuses</a>
+
+ <a *ngIf="hasVideoBlacklistRight()" i18n routerLink="video-blacklist/list" routerLinkActive="active">Blacklisted videos</a>
+ </div>
+</div>
+
+<router-outlet></router-outlet>
\ No newline at end of file
--- /dev/null
+.form-sub-title {
+ flex-grow: 0;
+ margin-right: 30px;
+}
--- /dev/null
+import { Component } from '@angular/core'
+import { UserRight } from '../../../../../shared'
+import { AuthService } from '@app/core/auth/auth.service'
+
+@Component({
+ templateUrl: './moderation.component.html',
+ styleUrls: [ './moderation.component.scss' ]
+})
+export class ModerationComponent {
+ constructor (private auth: AuthService) {}
+
+ hasVideoAbusesRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
+ }
+
+ hasVideoBlacklistRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
+ }
+}
--- /dev/null
+import { Routes } from '@angular/router'
+import { UserRight } from '../../../../../shared'
+import { UserRightGuard } from '@app/core'
+import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list'
+import { VideoBlacklistListComponent } from '@app/+admin/moderation/video-blacklist-list'
+import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
+
+export const ModerationRoutes: Routes = [
+ {
+ path: 'moderation',
+ component: ModerationComponent,
+ children: [
+ {
+ path: '',
+ redirectTo: 'video-abuses/list',
+ pathMatch: 'full'
+ },
+ {
+ path: 'video-abuses/list',
+ component: VideoAbuseListComponent,
+ canActivate: [ UserRightGuard ],
+ data: {
+ userRight: UserRight.MANAGE_VIDEO_ABUSES,
+ meta: {
+ title: 'Video abuses list'
+ }
+ }
+ },
+ {
+ path: 'video-blacklist/list',
+ component: VideoBlacklistListComponent,
+ canActivate: [ UserRightGuard ],
+ data: {
+ userRight: UserRight.MANAGE_VIDEO_BLACKLIST,
+ meta: {
+ title: 'Blacklisted videos'
+ }
+ }
+ }
+ ]
+ }
+]
import { I18n } from '@ngx-translate/i18n-polyfill'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
-import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
+import { FormValidatorService } from '../../../shared/forms/form-validators/form-validator.service'
import { VideoAbuse } from '../../../../../../shared/models/videos'
@Component({
-<div class="admin-sub-header">
- <div i18n class="form-sub-title">Video abuses list</div>
-</div>
-
<p-table
[value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
-@import '_variables';
-@import '_mixins';
+@import 'variables';
+@import 'mixins';
.moderation-comment-label {
font-weight: $font-semibold;
import { Component, OnInit, ViewChild } from '@angular/core'
-import { Account } from '@app/shared/account/account.model'
+import { Account } from '../../../shared/account/account.model'
import { NotificationsService } from 'angular2-notifications'
import { SortMeta } from 'primeng/components/common/sortmeta'
import { VideoAbuse, VideoAbuseState } from '../../../../../../shared'
import { RestPagination, RestTable, VideoAbuseService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
-import { ConfirmService } from '@app/core'
+import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
+import { ConfirmService } from '../../../core/index'
import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
-import { Video } from '@app/shared/video/video.model'
+import { Video } from '../../../shared/video/video.model'
@Component({
selector: 'my-video-abuse-list',
-<div class="admin-sub-header">
- <div i18n class="form-sub-title">Blacklisted videos</div>
-</div>
-
<p-table
[value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
<ng-template pTemplate="rowexpansion" let-videoBlacklist>
<tr class="blacklist-reason">
- <td colspan="6">
+ <td colspan="7">
<span i18n class="blacklist-reason-label">Blacklist reason:</span>
{{ videoBlacklist.reason }}
</td>
-@import '_variables';
-@import '_mixins';
+@import 'variables';
+@import 'mixins';
.blacklist-reason-label {
font-weight: $font-semibold;
import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared'
import { VideoBlacklist } from '../../../../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
-import { Video } from '@app/shared/video/video.model'
+import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
+import { Video } from '../../../shared/video/video.model'
@Component({
selector: 'my-video-blacklist-list',
+++ /dev/null
-export * from './video-abuse-list'
-export * from './video-abuses.component'
-export * from './video-abuses.routes'
+++ /dev/null
-import { Component } from '@angular/core'
-
-@Component({
- template: '<router-outlet></router-outlet>'
-})
-
-export class VideoAbusesComponent {
-}
+++ /dev/null
-import { Routes } from '@angular/router'
-
-import { UserRightGuard } from '../../core'
-import { UserRight } from '../../../../../shared'
-import { VideoAbusesComponent } from './video-abuses.component'
-import { VideoAbuseListComponent } from './video-abuse-list'
-
-export const VideoAbusesRoutes: Routes = [
- {
- path: 'video-abuses',
- component: VideoAbusesComponent,
- canActivate: [ UserRightGuard ],
- data: {
- userRight: UserRight.MANAGE_VIDEO_ABUSES
- },
- children: [
- {
- path: '',
- redirectTo: 'list',
- pathMatch: 'full'
- },
- {
- path: 'list',
- component: VideoAbuseListComponent,
- data: {
- meta: {
- title: 'Video abuses list'
- }
- }
- }
- ]
- }
-]
+++ /dev/null
-export * from './video-blacklist-list'
-export * from './video-blacklist.component'
-export * from './video-blacklist.routes'
+++ /dev/null
-import { Component } from '@angular/core'
-
-@Component({
- template: '<router-outlet></router-outlet>'
-})
-export class VideoBlacklistComponent {
-}
+++ /dev/null
-import { Routes } from '@angular/router'
-
-import { UserRightGuard } from '../../core'
-import { UserRight } from '../../../../../shared'
-import { VideoBlacklistComponent } from './video-blacklist.component'
-import { VideoBlacklistListComponent } from './video-blacklist-list'
-
-export const VideoBlacklistRoutes: Routes = [
- {
- path: 'video-blacklist',
- component: VideoBlacklistComponent,
- canActivate: [ UserRightGuard ],
- data: {
- userRight: UserRight.MANAGE_VIDEO_BLACKLIST
- },
- children: [
- {
- path: '',
- redirectTo: 'list',
- pathMatch: 'full'
- },
- {
- path: 'list',
- component: VideoBlacklistListComponent,
- data: {
- meta: {
- title: 'Blacklisted videos'
- }
- }
- }
- ]
- }
-]