diff options
Diffstat (limited to 'client/src/app')
12 files changed, 52 insertions, 24 deletions
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index b8a957d1c..746549555 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -52,6 +52,14 @@ export class AdminComponent implements OnInit { | |||
52 | }) | 52 | }) |
53 | } | 53 | } |
54 | 54 | ||
55 | if (this.hasVideoCommentsRight()) { | ||
56 | overviewItems.children.push({ | ||
57 | label: $localize`Comments`, | ||
58 | routerLink: '/admin/comments', | ||
59 | iconName: 'message-circle' | ||
60 | }) | ||
61 | } | ||
62 | |||
55 | if (overviewItems.children.length !== 0) { | 63 | if (overviewItems.children.length !== 0) { |
56 | this.menuEntries.push(overviewItems) | 64 | this.menuEntries.push(overviewItems) |
57 | } | 65 | } |
@@ -104,14 +112,6 @@ export class AdminComponent implements OnInit { | |||
104 | }) | 112 | }) |
105 | } | 113 | } |
106 | 114 | ||
107 | if (this.hasVideoCommentsRight()) { | ||
108 | moderationItems.children.push({ | ||
109 | label: $localize`Video comments`, | ||
110 | routerLink: '/admin/moderation/video-comments/list', | ||
111 | iconName: 'message-circle' | ||
112 | }) | ||
113 | } | ||
114 | |||
115 | if (this.hasAccountsBlocklistRight()) { | 115 | if (this.hasAccountsBlocklistRight()) { |
116 | moderationItems.children.push({ | 116 | moderationItems.children.push({ |
117 | label: $localize`Muted accounts`, | 117 | label: $localize`Muted accounts`, |
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index c672fa280..366e29883 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts | |||
@@ -32,13 +32,13 @@ import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbo | |||
32 | import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component' | 32 | import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component' |
33 | import { AbuseListComponent, VideoBlockListComponent } from './moderation' | 33 | import { AbuseListComponent, VideoBlockListComponent } from './moderation' |
34 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' | 34 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' |
35 | import { VideoCommentListComponent } from './moderation/video-comment-list' | ||
36 | import { | 35 | import { |
37 | UserCreateComponent, | 36 | UserCreateComponent, |
38 | UserListComponent, | 37 | UserListComponent, |
39 | UserPasswordComponent, | 38 | UserPasswordComponent, |
40 | UserUpdateComponent, | 39 | UserUpdateComponent, |
41 | VideoAdminService, | 40 | VideoAdminService, |
41 | VideoCommentListComponent, | ||
42 | VideoListComponent | 42 | VideoListComponent |
43 | } from './overview' | 43 | } from './overview' |
44 | import { | 44 | import { |
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts index 5c39ff366..1ad301039 100644 --- a/client/src/app/+admin/moderation/moderation.routes.ts +++ b/client/src/app/+admin/moderation/moderation.routes.ts | |||
@@ -2,7 +2,6 @@ import { Routes } from '@angular/router' | |||
2 | import { AbuseListComponent } from '@app/+admin/moderation/abuse-list' | 2 | import { AbuseListComponent } from '@app/+admin/moderation/abuse-list' |
3 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' | 3 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' |
4 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' | 4 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' |
5 | import { VideoCommentListComponent } from './video-comment-list' | ||
6 | import { UserRightGuard } from '@app/core' | 5 | import { UserRightGuard } from '@app/core' |
7 | import { UserRight } from '@shared/models' | 6 | import { UserRight } from '@shared/models' |
8 | 7 | ||
@@ -69,6 +68,7 @@ export const ModerationRoutes: Routes = [ | |||
69 | } | 68 | } |
70 | }, | 69 | }, |
71 | 70 | ||
71 | // We move this component in admin overview pages | ||
72 | { | 72 | { |
73 | path: 'video-comments', | 73 | path: 'video-comments', |
74 | redirectTo: 'video-comments/list', | 74 | redirectTo: 'video-comments/list', |
@@ -76,14 +76,8 @@ export const ModerationRoutes: Routes = [ | |||
76 | }, | 76 | }, |
77 | { | 77 | { |
78 | path: 'video-comments/list', | 78 | path: 'video-comments/list', |
79 | component: VideoCommentListComponent, | 79 | redirectTo: '/admin/comments/list', |
80 | canActivate: [ UserRightGuard ], | 80 | pathMatch: 'full' |
81 | data: { | ||
82 | userRight: UserRight.SEE_ALL_COMMENTS, | ||
83 | meta: { | ||
84 | title: $localize`Video comments` | ||
85 | } | ||
86 | } | ||
87 | }, | 81 | }, |
88 | 82 | ||
89 | { | 83 | { |
diff --git a/client/src/app/+admin/moderation/video-comment-list/index.ts b/client/src/app/+admin/overview/comments/index.ts index eb08b4177..c487f7a81 100644 --- a/client/src/app/+admin/moderation/video-comment-list/index.ts +++ b/client/src/app/+admin/overview/comments/index.ts | |||
@@ -1 +1,2 @@ | |||
1 | export * from './video-comment-list.component' | 1 | export * from './video-comment-list.component' |
2 | export * from './video-comment.routes' | ||
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html b/client/src/app/+admin/overview/comments/video-comment-list.component.html index 0dbbbe1cc..0dbbbe1cc 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html +++ b/client/src/app/+admin/overview/comments/video-comment-list.component.html | |||
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.scss b/client/src/app/+admin/overview/comments/video-comment-list.component.scss index 3cf7b8db6..3cf7b8db6 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.scss +++ b/client/src/app/+admin/overview/comments/video-comment-list.component.scss | |||
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts b/client/src/app/+admin/overview/comments/video-comment-list.component.ts index 25fe65133..25fe65133 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts +++ b/client/src/app/+admin/overview/comments/video-comment-list.component.ts | |||
diff --git a/client/src/app/+admin/overview/comments/video-comment.routes.ts b/client/src/app/+admin/overview/comments/video-comment.routes.ts new file mode 100644 index 000000000..f0bd440ad --- /dev/null +++ b/client/src/app/+admin/overview/comments/video-comment.routes.ts | |||
@@ -0,0 +1,30 @@ | |||
1 | import { Routes } from '@angular/router' | ||
2 | import { UserRightGuard } from '@app/core' | ||
3 | import { UserRight } from '@shared/models' | ||
4 | import { VideoCommentListComponent } from './video-comment-list.component' | ||
5 | |||
6 | export const commentRoutes: Routes = [ | ||
7 | { | ||
8 | path: 'comments', | ||
9 | canActivate: [ UserRightGuard ], | ||
10 | data: { | ||
11 | userRight: UserRight.SEE_ALL_COMMENTS | ||
12 | }, | ||
13 | children: [ | ||
14 | { | ||
15 | path: '', | ||
16 | redirectTo: 'list', | ||
17 | pathMatch: 'full' | ||
18 | }, | ||
19 | { | ||
20 | path: 'list', | ||
21 | component: VideoCommentListComponent, | ||
22 | data: { | ||
23 | meta: { | ||
24 | title: $localize`Comments list` | ||
25 | } | ||
26 | } | ||
27 | } | ||
28 | ] | ||
29 | } | ||
30 | ] | ||
diff --git a/client/src/app/+admin/overview/index.ts b/client/src/app/+admin/overview/index.ts index a9c46893f..111360734 100644 --- a/client/src/app/+admin/overview/index.ts +++ b/client/src/app/+admin/overview/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './comments' | ||
1 | export * from './users' | 2 | export * from './users' |
2 | export * from './videos' | 3 | export * from './videos' |
3 | export * from './overview.routes' | 4 | export * from './overview.routes' |
diff --git a/client/src/app/+admin/overview/overview.routes.ts b/client/src/app/+admin/overview/overview.routes.ts index 1e6686d16..72d6835d7 100644 --- a/client/src/app/+admin/overview/overview.routes.ts +++ b/client/src/app/+admin/overview/overview.routes.ts | |||
@@ -1,8 +1,10 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UsersRoutes } from './users' | 2 | import { commentRoutes } from './comments' |
3 | import { VideosRoutes } from './videos' | 3 | import { usersRoutes } from './users' |
4 | import { videosRoutes } from './videos' | ||
4 | 5 | ||
5 | export const OverviewRoutes: Routes = [ | 6 | export const OverviewRoutes: Routes = [ |
6 | ...UsersRoutes, | 7 | ...commentRoutes, |
7 | ...VideosRoutes | 8 | ...usersRoutes, |
9 | ...videosRoutes | ||
8 | ] | 10 | ] |
diff --git a/client/src/app/+admin/overview/users/users.routes.ts b/client/src/app/+admin/overview/users/users.routes.ts index 8b63f5bc7..c9724e5fb 100644 --- a/client/src/app/+admin/overview/users/users.routes.ts +++ b/client/src/app/+admin/overview/users/users.routes.ts | |||
@@ -4,7 +4,7 @@ import { UserRight } from '@shared/models' | |||
4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' | 4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' |
5 | import { UserListComponent } from './user-list' | 5 | import { UserListComponent } from './user-list' |
6 | 6 | ||
7 | export const UsersRoutes: Routes = [ | 7 | export const usersRoutes: Routes = [ |
8 | { | 8 | { |
9 | path: 'users', | 9 | path: 'users', |
10 | canActivate: [ UserRightGuard ], | 10 | canActivate: [ UserRightGuard ], |
diff --git a/client/src/app/+admin/overview/videos/video.routes.ts b/client/src/app/+admin/overview/videos/video.routes.ts index 984df7b82..01cb5b497 100644 --- a/client/src/app/+admin/overview/videos/video.routes.ts +++ b/client/src/app/+admin/overview/videos/video.routes.ts | |||
@@ -3,7 +3,7 @@ import { UserRightGuard } from '@app/core' | |||
3 | import { UserRight } from '@shared/models' | 3 | import { UserRight } from '@shared/models' |
4 | import { VideoListComponent } from './video-list.component' | 4 | import { VideoListComponent } from './video-list.component' |
5 | 5 | ||
6 | export const VideosRoutes: Routes = [ | 6 | export const videosRoutes: Routes = [ |
7 | { | 7 | { |
8 | path: 'videos', | 8 | path: 'videos', |
9 | canActivate: [ UserRightGuard ], | 9 | canActivate: [ UserRightGuard ], |