aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-02 16:30:33 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-06 15:08:58 +0200
commit71ab65d02f359000f9ca6a00f163d66d56a33955 (patch)
tree0fb0460b05b90f151a8a24f1dc3a82c6c5697546 /client/src/app/+admin/moderation
parenta3b5e78af3696f807e54bc4b11e559bbd9b6ba1e (diff)
downloadPeerTube-71ab65d02f359000f9ca6a00f163d66d56a33955.tar.gz
PeerTube-71ab65d02f359000f9ca6a00f163d66d56a33955.tar.zst
PeerTube-71ab65d02f359000f9ca6a00f163d66d56a33955.zip
decouple video abuse details from embed, add embed to block list details
Diffstat (limited to 'client/src/app/+admin/moderation')
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.html24
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts23
2 files changed, 38 insertions, 9 deletions
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
index 278e68a96..d39aacb76 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
@@ -57,12 +57,12 @@
57 </td> 57 </td>
58 58
59 <td> 59 <td>
60 <a [href]="getVideoUrl(videoBlock)" class="video-table-video-link" [title]="videoBlock.video.name" target="_blank" rel="noopener noreferrer"> 60 <a [href]="getVideoUrl(videoBlock)" class="table-video-link" [title]="videoBlock.video.name" target="_blank" rel="noopener noreferrer">
61 <div class="video-table-video"> 61 <div class="table-video">
62 <div class="video-table-video-image"> 62 <div class="table-video-image">
63 <img [src]="videoBlock.video.thumbnailPath"> 63 <img [src]="videoBlock.video.thumbnailPath">
64 </div> 64 </div>
65 <div class="video-table-video-text"> 65 <div class="table-video-text">
66 <div> 66 <div>
67 <my-global-icon i18n-title title="The video was blocked due to automatic blocking of new videos" *ngIf="videoBlock.type == 2" iconName="robot"></my-global-icon> 67 <my-global-icon i18n-title title="The video was blocked due to automatic blocking of new videos" *ngIf="videoBlock.type == 2" iconName="robot"></my-global-icon>
68 {{ videoBlock.video.name }} 68 {{ videoBlock.video.name }}
@@ -97,8 +97,20 @@
97 <tr> 97 <tr>
98 <td class="expand-cell" colspan="6"> 98 <td class="expand-cell" colspan="6">
99 <div class="d-flex moderation-expanded"> 99 <div class="d-flex moderation-expanded">
100 <span class="col-2 moderation-expanded-label" i18n>Block reason:</span> 100
101 <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span> 101 <!-- block right part (block details) -->
102 <div class="col-8">
103 <span class="col-3 moderation-expanded-label" i18n>Block reason:</span>
104 <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
105 </div>
106
107 <!-- block right part (video embed) -->
108 <div class="col-4">
109 <div class="screenratio">
110 <div [innerHTML]="videoBlock.embedHtml"></div>
111 </div>
112 </div>
113
102 </div> 114 </div>
103 </td> 115 </td>
104 </tr> 116 </tr>
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index dfdf65c19..e94c293ca 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -7,14 +7,17 @@ import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
7import { VideoBlockService } from '@app/shared/shared-moderation' 7import { VideoBlockService } from '@app/shared/shared-moderation'
8import { I18n } from '@ngx-translate/i18n-polyfill' 8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoBlacklist, VideoBlacklistType } from '@shared/models' 9import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
10import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils'
11import { environment } from 'src/environments/environment'
12import { DomSanitizer } from '@angular/platform-browser'
10 13
11@Component({ 14@Component({
12 selector: 'my-video-block-list', 15 selector: 'my-video-block-list',
13 templateUrl: './video-block-list.component.html', 16 templateUrl: './video-block-list.component.html',
14 styleUrls: [ '../../../shared/shared-moderation/moderation.scss', './video-block-list.component.scss' ] 17 styleUrls: [ '../../../shared/shared-moderation/moderation.scss', '../../../shared/shared-abuse-list/abuse-list-table.component.scss', './video-block-list.component.scss' ]
15}) 18})
16export class VideoBlockListComponent extends RestTable implements OnInit, AfterViewInit { 19export class VideoBlockListComponent extends RestTable implements OnInit, AfterViewInit {
17 blocklist: (VideoBlacklist & { reasonHtml?: string })[] = [] 20 blocklist: (VideoBlacklist & { reasonHtml?: string, embedHtml?: string })[] = []
18 totalRecords = 0 21 totalRecords = 0
19 sort: SortMeta = { field: 'createdAt', order: -1 } 22 sort: SortMeta = { field: 'createdAt', order: -1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 } 23 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
@@ -28,6 +31,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
28 private confirmService: ConfirmService, 31 private confirmService: ConfirmService,
29 private videoBlocklistService: VideoBlockService, 32 private videoBlocklistService: VideoBlockService,
30 private markdownRenderer: MarkdownService, 33 private markdownRenderer: MarkdownService,
34 private sanitizer: DomSanitizer,
31 private videoService: VideoService, 35 private videoService: VideoService,
32 private route: ActivatedRoute, 36 private route: ActivatedRoute,
33 private router: Router, 37 private router: Router,
@@ -171,6 +175,16 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
171 ) 175 )
172 } 176 }
173 177
178 getVideoEmbed (entry: VideoBlacklist) {
179 return buildVideoEmbed(
180 buildVideoLink({
181 baseUrl: `${environment.embedUrl}/videos/embed/${entry.video.uuid}`,
182 title: false,
183 warningTitle: false
184 })
185 )
186 }
187
174 protected loadData () { 188 protected loadData () {
175 this.videoBlocklistService.listBlocks({ 189 this.videoBlocklistService.listBlocks({
176 pagination: this.pagination, 190 pagination: this.pagination,
@@ -184,7 +198,10 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
184 this.blocklist = resultList.data 198 this.blocklist = resultList.data
185 199
186 for (const element of this.blocklist) { 200 for (const element of this.blocklist) {
187 Object.assign(element, { reasonHtml: await this.toHtml(element.reason) }) 201 Object.assign(element, {
202 reasonHtml: await this.toHtml(element.reason),
203 embedHtml: this.sanitizer.bypassSecurityTrustHtml(this.getVideoEmbed(element))
204 })
188 } 205 }
189 }, 206 },
190 207