Regroup abuse and blacklisted videos inside "moderation"
This commit is contained in:
parent
65b247ddc7
commit
614d1ae928
|
@ -8,8 +8,7 @@ import { AdminComponent } from './admin.component'
|
||||||
import { FollowsRoutes } from './follows'
|
import { FollowsRoutes } from './follows'
|
||||||
import { JobsRoutes } from './jobs/job.routes'
|
import { JobsRoutes } from './jobs/job.routes'
|
||||||
import { UsersRoutes } from './users'
|
import { UsersRoutes } from './users'
|
||||||
import { VideoAbusesRoutes } from './video-abuses'
|
import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
|
||||||
import { VideoBlacklistRoutes } from './video-blacklist'
|
|
||||||
|
|
||||||
const adminRoutes: Routes = [
|
const adminRoutes: Routes = [
|
||||||
{
|
{
|
||||||
|
@ -25,8 +24,7 @@ const adminRoutes: Routes = [
|
||||||
},
|
},
|
||||||
...FollowsRoutes,
|
...FollowsRoutes,
|
||||||
...UsersRoutes,
|
...UsersRoutes,
|
||||||
...VideoAbusesRoutes,
|
...ModerationRoutes,
|
||||||
...VideoBlacklistRoutes,
|
|
||||||
...JobsRoutes,
|
...JobsRoutes,
|
||||||
...ConfigRoutes
|
...ConfigRoutes
|
||||||
]
|
]
|
||||||
|
|
|
@ -8,12 +8,8 @@
|
||||||
Manage follows
|
Manage follows
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a i18n *ngIf="hasVideoAbusesRight()" routerLink="/admin/video-abuses" routerLinkActive="active" class="title-page">
|
<a i18n *ngIf="hasVideoAbusesRight() || hasVideoBlacklistRight()" routerLink="/admin/moderation" routerLinkActive="active" class="title-page">
|
||||||
Video abuses
|
Moderation
|
||||||
</a>
|
|
||||||
|
|
||||||
<a i18n *ngIf="hasVideoBlacklistRight()" routerLink="/admin/video-blacklist" routerLinkActive="active" class="title-page">
|
|
||||||
Video blacklist
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a i18n *ngIf="hasJobsRight()" routerLink="/admin/jobs" routerLinkActive="active" class="title-page">
|
<a i18n *ngIf="hasJobsRight()" routerLink="/admin/jobs" routerLinkActive="active" class="title-page">
|
||||||
|
|
|
@ -11,9 +11,9 @@ import { JobsComponent } from './jobs/job.component'
|
||||||
import { JobsListComponent } from './jobs/jobs-list/jobs-list.component'
|
import { JobsListComponent } from './jobs/jobs-list/jobs-list.component'
|
||||||
import { JobService } from './jobs/shared/job.service'
|
import { JobService } from './jobs/shared/job.service'
|
||||||
import { UserCreateComponent, UserListComponent, UsersComponent, UserService, UserUpdateComponent } from './users'
|
import { UserCreateComponent, UserListComponent, UsersComponent, UserService, UserUpdateComponent } from './users'
|
||||||
import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoAbusesComponent } from './video-abuses'
|
import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlacklistListComponent } from './moderation'
|
||||||
import { VideoBlacklistComponent, VideoBlacklistListComponent } from './video-blacklist'
|
|
||||||
import { UserBanModalComponent } from '@app/+admin/users/user-list/user-ban-modal.component'
|
import { UserBanModalComponent } from '@app/+admin/users/user-list/user-ban-modal.component'
|
||||||
|
import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -36,10 +36,8 @@ import { UserBanModalComponent } from '@app/+admin/users/user-list/user-ban-moda
|
||||||
UserListComponent,
|
UserListComponent,
|
||||||
UserBanModalComponent,
|
UserBanModalComponent,
|
||||||
|
|
||||||
VideoBlacklistComponent,
|
ModerationComponent,
|
||||||
VideoBlacklistListComponent,
|
VideoBlacklistListComponent,
|
||||||
|
|
||||||
VideoAbusesComponent,
|
|
||||||
VideoAbuseListComponent,
|
VideoAbuseListComponent,
|
||||||
ModerationCommentModalComponent,
|
ModerationCommentModalComponent,
|
||||||
|
|
||||||
|
|
4
client/src/app/+admin/moderation/index.ts
Normal file
4
client/src/app/+admin/moderation/index.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export * from './video-abuse-list'
|
||||||
|
export * from './video-blacklist-list'
|
||||||
|
export * from './moderation.component'
|
||||||
|
export * from './moderation.routes'
|
11
client/src/app/+admin/moderation/moderation.component.html
Normal file
11
client/src/app/+admin/moderation/moderation.component.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
|
@ -0,0 +1,4 @@
|
||||||
|
.form-sub-title {
|
||||||
|
flex-grow: 0;
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
19
client/src/app/+admin/moderation/moderation.component.ts
Normal file
19
client/src/app/+admin/moderation/moderation.component.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
42
client/src/app/+admin/moderation/moderation.routes.ts
Normal file
42
client/src/app/+admin/moderation/moderation.routes.ts
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
|
@ -4,7 +4,7 @@ import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '..
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
|
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'
|
import { VideoAbuse } from '../../../../../../shared/models/videos'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
|
@ -1,7 +1,3 @@
|
||||||
<div class="admin-sub-header">
|
|
||||||
<div i18n class="form-sub-title">Video abuses list</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p-table
|
<p-table
|
||||||
[value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
[value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
|
@ -1,5 +1,5 @@
|
||||||
@import '_variables';
|
@import 'variables';
|
||||||
@import '_mixins';
|
@import 'mixins';
|
||||||
|
|
||||||
.moderation-comment-label {
|
.moderation-comment-label {
|
||||||
font-weight: $font-semibold;
|
font-weight: $font-semibold;
|
|
@ -1,14 +1,14 @@
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core'
|
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 { NotificationsService } from 'angular2-notifications'
|
||||||
import { SortMeta } from 'primeng/components/common/sortmeta'
|
import { SortMeta } from 'primeng/components/common/sortmeta'
|
||||||
import { VideoAbuse, VideoAbuseState } from '../../../../../../shared'
|
import { VideoAbuse, VideoAbuseState } from '../../../../../../shared'
|
||||||
import { RestPagination, RestTable, VideoAbuseService } from '../../../shared'
|
import { RestPagination, RestTable, VideoAbuseService } from '../../../shared'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
|
import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
|
||||||
import { ConfirmService } from '@app/core'
|
import { ConfirmService } from '../../../core/index'
|
||||||
import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
|
import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
|
||||||
import { Video } from '@app/shared/video/video.model'
|
import { Video } from '../../../shared/video/video.model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-video-abuse-list',
|
selector: 'my-video-abuse-list',
|
|
@ -1,7 +1,3 @@
|
||||||
<div class="admin-sub-header">
|
|
||||||
<div i18n class="form-sub-title">Blacklisted videos</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p-table
|
<p-table
|
||||||
[value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
[value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
||||||
|
@ -41,7 +37,7 @@
|
||||||
|
|
||||||
<ng-template pTemplate="rowexpansion" let-videoBlacklist>
|
<ng-template pTemplate="rowexpansion" let-videoBlacklist>
|
||||||
<tr class="blacklist-reason">
|
<tr class="blacklist-reason">
|
||||||
<td colspan="6">
|
<td colspan="7">
|
||||||
<span i18n class="blacklist-reason-label">Blacklist reason:</span>
|
<span i18n class="blacklist-reason-label">Blacklist reason:</span>
|
||||||
{{ videoBlacklist.reason }}
|
{{ videoBlacklist.reason }}
|
||||||
</td>
|
</td>
|
|
@ -1,5 +1,5 @@
|
||||||
@import '_variables';
|
@import 'variables';
|
||||||
@import '_mixins';
|
@import 'mixins';
|
||||||
|
|
||||||
.blacklist-reason-label {
|
.blacklist-reason-label {
|
||||||
font-weight: $font-semibold;
|
font-weight: $font-semibold;
|
|
@ -5,8 +5,8 @@ import { ConfirmService } from '../../../core'
|
||||||
import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared'
|
import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared'
|
||||||
import { VideoBlacklist } from '../../../../../../shared'
|
import { VideoBlacklist } from '../../../../../../shared'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
|
import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
|
||||||
import { Video } from '@app/shared/video/video.model'
|
import { Video } from '../../../shared/video/video.model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-video-blacklist-list',
|
selector: 'my-video-blacklist-list',
|
|
@ -1,3 +0,0 @@
|
||||||
export * from './video-abuse-list'
|
|
||||||
export * from './video-abuses.component'
|
|
||||||
export * from './video-abuses.routes'
|
|
|
@ -1,8 +0,0 @@
|
||||||
import { Component } from '@angular/core'
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: '<router-outlet></router-outlet>'
|
|
||||||
})
|
|
||||||
|
|
||||||
export class VideoAbusesComponent {
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
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'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,3 +0,0 @@
|
||||||
export * from './video-blacklist-list'
|
|
||||||
export * from './video-blacklist.component'
|
|
||||||
export * from './video-blacklist.routes'
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { Component } from '@angular/core'
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: '<router-outlet></router-outlet>'
|
|
||||||
})
|
|
||||||
export class VideoBlacklistComponent {
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
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'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
Loading…
Reference in New Issue
Block a user