aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-abuse-list
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-abuse-list')
-rw-r--r--client/src/app/shared/shared-abuse-list/abuse-details.component.html4
-rw-r--r--client/src/app/shared/shared-abuse-list/abuse-list-table.component.html40
-rw-r--r--client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts18
-rw-r--r--client/src/app/shared/shared-abuse-list/processed-abuse.model.ts4
-rw-r--r--client/src/app/shared/shared-abuse-list/shared-abuse-list.module.ts6
5 files changed, 22 insertions, 50 deletions
diff --git a/client/src/app/shared/shared-abuse-list/abuse-details.component.html b/client/src/app/shared/shared-abuse-list/abuse-details.component.html
index 2f0bc5ae5..a1a4586f0 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-details.component.html
+++ b/client/src/app/shared/shared-abuse-list/abuse-details.component.html
@@ -85,9 +85,9 @@
85 85
86 <!-- report right part (video/comment details) --> 86 <!-- report right part (video/comment details) -->
87 <div class="right"> 87 <div class="right">
88 <div *ngIf="abuse.video" class="screenratio"> 88 <div *ngIf="abuse.video">
89 <div *ngIf="abuse.video.deleted" i18n>The video was deleted</div> 89 <div *ngIf="abuse.video.deleted" i18n>The video was deleted</div>
90 <div *ngIf="!abuse.video.deleted" [innerHTML]="abuse.embedHtml"></div> 90 <my-embed *ngIf="!abuse.video.deleted" [video]="abuse.video"></my-embed>
91 </div> 91 </div>
92 92
93 <div *ngIf="abuse.comment" class="comment-html"> 93 <div *ngIf="abuse.comment" class="comment-html">
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
index 4bf83316b..d957eaeab 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
@@ -30,9 +30,7 @@
30 <ng-template pTemplate="body" let-expanded="expanded" let-abuse> 30 <ng-template pTemplate="body" let-expanded="expanded" let-abuse>
31 <tr> 31 <tr>
32 <td class="expand-cell c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> 32 <td class="expand-cell c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
33 <span class="expander"> 33 <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
34 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
35 </span>
36 </td> 34 </td>
37 35
38 <td class="action-cell"> 36 <td class="action-cell">
@@ -61,28 +59,20 @@
61 <ng-container *ngIf="abuse.video"> 59 <ng-container *ngIf="abuse.video">
62 60
63 <td *ngIf="!abuse.video.deleted"> 61 <td *ngIf="!abuse.video.deleted">
64 <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer"> 62 <my-video-cell [video]="abuse.video">
65 <div class="table-video"> 63 <span image>
66 <div class="table-video-image"> 64 <span
67 <img [src]="abuse.video.thumbnailPath"> 65 class="table-video-image-label" *ngIf="abuse.count > 1"
68 <span 66 i18n-title title="This video has been reported multiple times."
69 class="table-video-image-label" *ngIf="abuse.count > 1" 67 >
70 i18n-title title="This video has been reported multiple times." 68 {{ abuse.nth }}/{{ abuse.count }}
71 > 69 </span>
72 {{ abuse.nth }}/{{ abuse.count }} 70 </span>
73 </span> 71
74 </div> 72 <span name>
75 73 <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span>
76 <div class="table-video-text"> 74 </span>
77 <div> 75 </my-video-cell>
78 <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
79 <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span>
80 {{ abuse.video.name }}
81 </div>
82 <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
83 </div>
84 </div>
85 </a>
86 </td> 76 </td>
87 77
88 <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse"> 78 <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse">
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
index 297993e39..10f5861b9 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts
@@ -1,8 +1,6 @@
1import * as debug from 'debug' 1import * as debug from 'debug'
2import truncate from 'lodash-es/truncate' 2import truncate from 'lodash-es/truncate'
3import { SortMeta } from 'primeng/api' 3import { SortMeta } from 'primeng/api'
4import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
5import { environment } from 'src/environments/environment'
6import { Component, Input, OnInit, ViewChild } from '@angular/core' 4import { Component, Input, OnInit, ViewChild } from '@angular/core'
7import { DomSanitizer } from '@angular/platform-browser' 5import { DomSanitizer } from '@angular/platform-browser'
8import { ActivatedRoute, Router } from '@angular/router' 6import { ActivatedRoute, Router } from '@angular/router'
@@ -10,7 +8,6 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable }
10import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main' 8import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main'
11import { AbuseService, BlocklistService, VideoBlockService } from '@app/shared/shared-moderation' 9import { AbuseService, BlocklistService, VideoBlockService } from '@app/shared/shared-moderation'
12import { VideoCommentService } from '@app/shared/shared-video-comment' 10import { VideoCommentService } from '@app/shared/shared-video-comment'
13import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
14import { AbuseState, AdminAbuse } from '@shared/models' 11import { AbuseState, AdminAbuse } from '@shared/models'
15import { AdvancedInputFilter } from '../shared-forms' 12import { AdvancedInputFilter } from '../shared-forms'
16import { AbuseMessageModalComponent } from './abuse-message-modal.component' 13import { AbuseMessageModalComponent } from './abuse-message-modal.component'
@@ -133,19 +130,6 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
133 return '/a/' + abuse.flaggedAccount.nameWithHost 130 return '/a/' + abuse.flaggedAccount.nameWithHost
134 } 131 }
135 132
136 getVideoEmbed (abuse: AdminAbuse) {
137 return buildVideoOrPlaylistEmbed(
138 decorateVideoLink({
139 url: buildVideoEmbedLink(abuse.video, environment.originServerUrl),
140 title: false,
141 warningTitle: false,
142 startTime: abuse.video.startAt,
143 stopTime: abuse.video.endAt
144 }),
145 abuse.video.name
146 )
147 }
148
149 async removeAbuse (abuse: AdminAbuse) { 133 async removeAbuse (abuse: AdminAbuse) {
150 const res = await this.confirmService.confirm($localize`Do you really want to delete this abuse report?`, $localize`Delete`) 134 const res = await this.confirmService.confirm($localize`Do you really want to delete this abuse report?`, $localize`Delete`)
151 if (res === false) return 135 if (res === false) return
@@ -220,8 +204,6 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
220 } 204 }
221 205
222 if (abuse.video) { 206 if (abuse.video) {
223 abuse.embedHtml = this.sanitizer.bypassSecurityTrustHtml(this.getVideoEmbed(abuse))
224
225 if (abuse.video.channel?.ownerAccount) { 207 if (abuse.video.channel?.ownerAccount) {
226 abuse.video.channel.ownerAccount = new Account(abuse.video.channel.ownerAccount) 208 abuse.video.channel.ownerAccount = new Account(abuse.video.channel.ownerAccount)
227 } 209 }
diff --git a/client/src/app/shared/shared-abuse-list/processed-abuse.model.ts b/client/src/app/shared/shared-abuse-list/processed-abuse.model.ts
index 194d52a33..b9a9bd889 100644
--- a/client/src/app/shared/shared-abuse-list/processed-abuse.model.ts
+++ b/client/src/app/shared/shared-abuse-list/processed-abuse.model.ts
@@ -1,13 +1,11 @@
1import { SafeHtml } from '@angular/platform-browser'
2import { AdminAbuse } from '@shared/models'
3import { Account } from '@app/shared/shared-main' 1import { Account } from '@app/shared/shared-main'
2import { AdminAbuse } from '@shared/models'
4 3
5// Don't use an abuse model because we need external services to compute some properties 4// Don't use an abuse model because we need external services to compute some properties
6// And this model is only used in this component 5// And this model is only used in this component
7export type ProcessedAbuse = AdminAbuse & { 6export type ProcessedAbuse = AdminAbuse & {
8 moderationCommentHtml?: string 7 moderationCommentHtml?: string
9 reasonHtml?: string 8 reasonHtml?: string
10 embedHtml?: SafeHtml
11 updatedAt?: Date 9 updatedAt?: Date
12 10
13 // override bare server-side definitions with rich client-side definitions 11 // override bare server-side definitions with rich client-side definitions
diff --git a/client/src/app/shared/shared-abuse-list/shared-abuse-list.module.ts b/client/src/app/shared/shared-abuse-list/shared-abuse-list.module.ts
index 8f3830a17..eeda27fa6 100644
--- a/client/src/app/shared/shared-abuse-list/shared-abuse-list.module.ts
+++ b/client/src/app/shared/shared-abuse-list/shared-abuse-list.module.ts
@@ -1,16 +1,17 @@
1 1
2import { TableModule } from 'primeng/table' 2import { TableModule } from 'primeng/table'
3import { NgModule } from '@angular/core' 3import { NgModule } from '@angular/core'
4import { SharedActorImageModule } from '../shared-actor-image/shared-actor-image.module'
4import { SharedFormModule } from '../shared-forms/shared-form.module' 5import { SharedFormModule } from '../shared-forms/shared-form.module'
5import { SharedGlobalIconModule } from '../shared-icons' 6import { SharedGlobalIconModule } from '../shared-icons'
6import { SharedMainModule } from '../shared-main/shared-main.module' 7import { SharedMainModule } from '../shared-main/shared-main.module'
7import { SharedModerationModule } from '../shared-moderation' 8import { SharedModerationModule } from '../shared-moderation'
9import { SharedTablesModule } from '../shared-tables'
8import { SharedVideoCommentModule } from '../shared-video-comment' 10import { SharedVideoCommentModule } from '../shared-video-comment'
9import { AbuseDetailsComponent } from './abuse-details.component' 11import { AbuseDetailsComponent } from './abuse-details.component'
10import { AbuseListTableComponent } from './abuse-list-table.component' 12import { AbuseListTableComponent } from './abuse-list-table.component'
11import { AbuseMessageModalComponent } from './abuse-message-modal.component' 13import { AbuseMessageModalComponent } from './abuse-message-modal.component'
12import { ModerationCommentModalComponent } from './moderation-comment-modal.component' 14import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
13import { SharedActorImageModule } from '../shared-actor-image/shared-actor-image.module'
14 15
15@NgModule({ 16@NgModule({
16 imports: [ 17 imports: [
@@ -21,7 +22,8 @@ import { SharedActorImageModule } from '../shared-actor-image/shared-actor-image
21 SharedModerationModule, 22 SharedModerationModule,
22 SharedGlobalIconModule, 23 SharedGlobalIconModule,
23 SharedVideoCommentModule, 24 SharedVideoCommentModule,
24 SharedActorImageModule 25 SharedActorImageModule,
26 SharedTablesModule
25 ], 27 ],
26 28
27 declarations: [ 29 declarations: [