diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-05-03 16:24:12 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-04 15:01:44 +0200 |
commit | 801d957155d574bda984206021cdd1fe58ef56b9 (patch) | |
tree | c0c110179e2cd66c9e34ee85c132f16b8730480e /client/src/app | |
parent | 0db536f1e00e2f0c019b5ea3807f1d9125ff4f1d (diff) | |
download | PeerTube-801d957155d574bda984206021cdd1fe58ef56b9.tar.gz PeerTube-801d957155d574bda984206021cdd1fe58ef56b9.tar.zst PeerTube-801d957155d574bda984206021cdd1fe58ef56b9.zip |
Move abuse-list details into its own component
Diffstat (limited to 'client/src/app')
4 files changed, 96 insertions, 74 deletions
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index 16273f6d8..d04313c0a 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts | |||
@@ -29,6 +29,7 @@ import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | |||
29 | import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component' | 29 | import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component' |
30 | import { ChartModule } from 'primeng/chart' | 30 | import { ChartModule } from 'primeng/chart' |
31 | import { BatchDomainsModalComponent } from './config/shared/batch-domains-modal.component' | 31 | import { BatchDomainsModalComponent } from './config/shared/batch-domains-modal.component' |
32 | import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' | ||
32 | 33 | ||
33 | @NgModule({ | 34 | @NgModule({ |
34 | imports: [ | 35 | imports: [ |
@@ -60,6 +61,7 @@ import { BatchDomainsModalComponent } from './config/shared/batch-domains-modal. | |||
60 | ModerationComponent, | 61 | ModerationComponent, |
61 | VideoBlacklistListComponent, | 62 | VideoBlacklistListComponent, |
62 | VideoAbuseListComponent, | 63 | VideoAbuseListComponent, |
64 | VideoAbuseDetailsComponent, | ||
63 | VideoAutoBlacklistListComponent, | 65 | VideoAutoBlacklistListComponent, |
64 | ModerationCommentModalComponent, | 66 | ModerationCommentModalComponent, |
65 | InstanceServerBlocklistComponent, | 67 | InstanceServerBlocklistComponent, |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.html b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.html new file mode 100644 index 000000000..704d43ac4 --- /dev/null +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.html | |||
@@ -0,0 +1,77 @@ | |||
1 | <div class="d-flex moderation-expanded"> | ||
2 | <!-- report left part (report details) --> | ||
3 | <div class="col-8"> | ||
4 | |||
5 | <!-- report metadata --> | ||
6 | <div class="d-flex"> | ||
7 | <span class="col-3 moderation-expanded-label" i18n>Reporter</span> | ||
8 | <span class="col-9 moderation-expanded-text"> | ||
9 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:"' + videoAbuse.reporterAccount.displayName + '"' }" class="chip"> | ||
10 | <img | ||
11 | class="avatar" | ||
12 | [src]="videoAbuse.reporterAccount.avatar.path" | ||
13 | (error)="switchToDefaultAvatar($event)" | ||
14 | alt="Avatar" | ||
15 | > | ||
16 | <div> | ||
17 | <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span> | ||
18 | </div> | ||
19 | </a> | ||
20 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' + videoAbuse.reporterAccount.displayName + '"' }" class="ml-auto text-muted video-details-links" i18n> | ||
21 | {videoAbuse.countReportsForReporter, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReporter }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span> | ||
22 | </a> | ||
23 | </span> | ||
24 | </div> | ||
25 | |||
26 | <div class="d-flex"> | ||
27 | <span class="col-3 moderation-expanded-label" i18n>Reportee</span> | ||
28 | <span class="col-9 moderation-expanded-text"> | ||
29 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' +videoAbuse.video.channel.ownerAccount.displayName + '"' }" class="chip"> | ||
30 | <img | ||
31 | class="avatar" | ||
32 | [src]="videoAbuse.video.channel.ownerAccount?.avatar.path" | ||
33 | (error)="switchToDefaultAvatar($event)" | ||
34 | alt="Avatar" | ||
35 | > | ||
36 | <div> | ||
37 | <span class="text-muted">{{ videoAbuse.video.channel.ownerAccount ? createByString(videoAbuse.video.channel.ownerAccount) : '' }}</span> | ||
38 | </div> | ||
39 | </a> | ||
40 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' +videoAbuse.video.channel.ownerAccount.displayName + '"' }" class="ml-auto text-muted video-details-links" i18n> | ||
41 | {videoAbuse.countReportsForReportee, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReportee }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span> | ||
42 | </a> | ||
43 | </span> | ||
44 | </div> | ||
45 | |||
46 | <div class="d-flex" *ngIf="videoAbuse.updatedAt"> | ||
47 | <span class="col-3 moderation-expanded-label" i18n>Updated</span> | ||
48 | <time class="col-9 moderation-expanded-text video-details-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time> | ||
49 | </div> | ||
50 | |||
51 | <!-- report text --> | ||
52 | <div class="mt-3 d-flex"> | ||
53 | <span class="col-3 moderation-expanded-label"> | ||
54 | <ng-container i18n>Report</ng-container> | ||
55 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': '#' + videoAbuse.id }" class="ml-1 text-muted">#{{ videoAbuse.id }}</a> | ||
56 | </span> | ||
57 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span> | ||
58 | </div> | ||
59 | |||
60 | <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment"> | ||
61 | <span class="col-3 moderation-expanded-label" i18n>Note</span> | ||
62 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span> | ||
63 | </div> | ||
64 | |||
65 | </div> | ||
66 | |||
67 | <!-- report right part (video details) --> | ||
68 | <div class="col-4"> | ||
69 | <div class="screenratio"> | ||
70 | <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted"> | ||
71 | <span i18n *ngIf="videoAbuse.video.deleted">The video was deleted</span> | ||
72 | <span i18n *ngIf="!videoAbuse.video.deleted">The video was blacklisted</span> | ||
73 | </div> | ||
74 | <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div> | ||
75 | </div> | ||
76 | </div> | ||
77 | </div> \ No newline at end of file | ||
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts new file mode 100644 index 000000000..5481915b9 --- /dev/null +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts | |||
@@ -0,0 +1,16 @@ | |||
1 | import { Component, ViewEncapsulation, Input } from '@angular/core' | ||
2 | import { VideoAbuse } from '../../../../../../shared' | ||
3 | import { Account } from '@app/shared/account/account.model' | ||
4 | |||
5 | @Component({ | ||
6 | selector: 'my-video-abuse-details', | ||
7 | templateUrl: './video-abuse-details.component.html', | ||
8 | styleUrls: [ '../moderation.component.scss' ] | ||
9 | }) | ||
10 | export class VideoAbuseDetailsComponent { | ||
11 | @Input() videoAbuse: VideoAbuse | ||
12 | |||
13 | createByString (account: Account) { | ||
14 | return Account.CREATE_BY_STRING(account.name, account.host) | ||
15 | } | ||
16 | } | ||
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html index bf73f9169..2e7b60e2f 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html | |||
@@ -133,80 +133,7 @@ | |||
133 | <ng-template pTemplate="rowexpansion" let-videoAbuse> | 133 | <ng-template pTemplate="rowexpansion" let-videoAbuse> |
134 | <tr> | 134 | <tr> |
135 | <td class="expand-cell" colspan="6"> | 135 | <td class="expand-cell" colspan="6"> |
136 | <div class="d-flex moderation-expanded"> | 136 | <my-video-abuse-details [videoAbuse]="videoAbuse"></my-video-abuse-details> |
137 | <!-- report left part (report details) --> | ||
138 | <div class="col-8"> | ||
139 | |||
140 | <!-- report metadata --> | ||
141 | <div class="d-flex"> | ||
142 | <span class="col-3 moderation-expanded-label" i18n>Reporter</span> | ||
143 | <span class="col-9 moderation-expanded-text"> | ||
144 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:"' + videoAbuse.reporterAccount.displayName + '"' }" class="chip"> | ||
145 | <img | ||
146 | class="avatar" | ||
147 | [src]="videoAbuse.reporterAccount.avatar.path" | ||
148 | (error)="switchToDefaultAvatar($event)" | ||
149 | alt="Avatar" | ||
150 | > | ||
151 | <div> | ||
152 | <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span> | ||
153 | </div> | ||
154 | </a> | ||
155 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' + videoAbuse.reporterAccount.displayName + '"' }" class="ml-auto text-muted video-details-links" i18n> | ||
156 | {videoAbuse.countReportsForReporter, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReporter }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span> | ||
157 | </a> | ||
158 | </span> | ||
159 | </div> | ||
160 | |||
161 | <div class="d-flex"> | ||
162 | <span class="col-3 moderation-expanded-label" i18n>Reportee</span> | ||
163 | <span class="col-9 moderation-expanded-text"> | ||
164 | <div class="chip"> | ||
165 | <img | ||
166 | class="avatar" | ||
167 | [src]="videoAbuse.video.channel.ownerAccount?.avatar.path" | ||
168 | (error)="switchToDefaultAvatar($event)" | ||
169 | alt="Avatar" | ||
170 | > | ||
171 | <div> | ||
172 | <span class="text-muted">{{ videoAbuse.video.channel.ownerAccount ? createByString(videoAbuse.video.channel.ownerAccount) : '' }}</span> | ||
173 | </div> | ||
174 | </div> | ||
175 | <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' +videoAbuse.video.channel.ownerAccount.displayName + '"' }" class="ml-auto text-muted video-details-links" i18n> | ||
176 | {videoAbuse.countReportsForReportee, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReportee }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span> | ||
177 | </a> | ||
178 | </span> | ||
179 | </div> | ||
180 | |||
181 | <div class="d-flex"> | ||
182 | <span class="col-3 moderation-expanded-label" i18n>Updated</span> | ||
183 | <time class="col-9 moderation-expanded-text video-details-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time> | ||
184 | </div> | ||
185 | |||
186 | <!-- report text --> | ||
187 | <div class="mt-3 d-flex"> | ||
188 | <span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span> | ||
189 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span> | ||
190 | </div> | ||
191 | |||
192 | <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment"> | ||
193 | <span class="col-3 moderation-expanded-label" i18n>Note</span> | ||
194 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span> | ||
195 | </div> | ||
196 | |||
197 | </div> | ||
198 | |||
199 | <!-- report right part (video details) --> | ||
200 | <div class="col-4"> | ||
201 | <div class="screenratio"> | ||
202 | <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted"> | ||
203 | <span i18n *ngIf="videoAbuse.video.deleted">The video was deleted</span> | ||
204 | <span i18n *ngIf="!videoAbuse.video.deleted">The video was blacklisted</span> | ||
205 | </div> | ||
206 | <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div> | ||
207 | </div> | ||
208 | </div> | ||
209 | </div> | ||
210 | </td> | 137 | </td> |
211 | </tr> | 138 | </tr> |
212 | </ng-template> | 139 | </ng-template> |