diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-02 16:30:33 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-06 15:08:58 +0200 |
commit | 71ab65d02f359000f9ca6a00f163d66d56a33955 (patch) | |
tree | 0fb0460b05b90f151a8a24f1dc3a82c6c5697546 /client/src/app | |
parent | a3b5e78af3696f807e54bc4b11e559bbd9b6ba1e (diff) | |
download | PeerTube-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')
7 files changed, 59 insertions, 34 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' | |||
7 | import { VideoBlockService } from '@app/shared/shared-moderation' | 7 | import { VideoBlockService } from '@app/shared/shared-moderation' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 8 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | 9 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' |
10 | import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' | ||
11 | import { environment } from 'src/environments/environment' | ||
12 | import { 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 | }) |
16 | export class VideoBlockListComponent extends RestTable implements OnInit, AfterViewInit { | 19 | export 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 | ||
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 431fdf5aa..fb8366f4c 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 | |||
@@ -96,12 +96,8 @@ | |||
96 | <!-- report right part (video/comment details) --> | 96 | <!-- report right part (video/comment details) --> |
97 | <div class="col-4"> | 97 | <div class="col-4"> |
98 | <div *ngIf="abuse.video" class="screenratio"> | 98 | <div *ngIf="abuse.video" class="screenratio"> |
99 | <div> | 99 | <div *ngIf="abuse.video.deleted" i18n>The video was deleted</div> |
100 | <span i18n *ngIf="abuse.video.deleted">The video was deleted</span> | 100 | <div *ngIf="!abuse.video.deleted" [innerHTML]="abuse.embedHtml"></div> |
101 | <span i18n *ngIf="!abuse.video.deleted">The video was blocked</span> | ||
102 | </div> | ||
103 | |||
104 | <div *ngIf="!abuse.video.deleted && !abuse.video.blacklisted" [innerHTML]="abuse.embedHtml"></div> | ||
105 | </div> | 101 | </div> |
106 | 102 | ||
107 | <div *ngIf="abuse.comment" class="comment-html"> | 103 | <div *ngIf="abuse.comment" class="comment-html"> |
diff --git a/client/src/app/shared/shared-abuse-list/abuse-details.component.scss b/client/src/app/shared/shared-abuse-list/abuse-details.component.scss index d83eb974d..8f8f3ac2e 100644 --- a/client/src/app/shared/shared-abuse-list/abuse-details.component.scss +++ b/client/src/app/shared/shared-abuse-list/abuse-details.component.scss | |||
@@ -2,23 +2,6 @@ | |||
2 | @import 'mixins'; | 2 | @import 'mixins'; |
3 | @import 'miniature'; | 3 | @import 'miniature'; |
4 | 4 | ||
5 | .screenratio { | ||
6 | div { | ||
7 | @include miniature-thumbnail; | ||
8 | |||
9 | display: inline-flex; | ||
10 | justify-content: center; | ||
11 | align-items: center; | ||
12 | color: pvar(--inputPlaceholderColor); | ||
13 | } | ||
14 | |||
15 | @include large-screen-ratio($selector: 'div, ::ng-deep iframe') { | ||
16 | width: 100% !important; | ||
17 | height: 100% !important; | ||
18 | left: 0; | ||
19 | }; | ||
20 | } | ||
21 | |||
22 | .comment-html { | 5 | .comment-html { |
23 | background-color: #ececec; | 6 | background-color: #ececec; |
24 | padding: 10px; | 7 | padding: 10px; |
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 d90b93fff..d8fe8b2d3 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 | |||
@@ -175,7 +175,7 @@ | |||
175 | 175 | ||
176 | <ng-template pTemplate="rowexpansion" let-abuse> | 176 | <ng-template pTemplate="rowexpansion" let-abuse> |
177 | <tr> | 177 | <tr> |
178 | <td class="expand-cell" colspan="6"> | 178 | <td class="expand-cell" colspan="8"> |
179 | <my-abuse-details [abuse]="abuse" [baseRoute]="baseRoute" [isAdminView]="isAdminView()"></my-abuse-details> | 179 | <my-abuse-details [abuse]="abuse" [baseRoute]="baseRoute" [isAdminView]="isAdminView()"></my-abuse-details> |
180 | </td> | 180 | </td> |
181 | </tr> | 181 | </tr> |
diff --git a/client/src/app/shared/shared-main/feeds/feed.component.html b/client/src/app/shared/shared-main/feeds/feed.component.html index 6b8013a9b..13883fd9b 100644 --- a/client/src/app/shared/shared-main/feeds/feed.component.html +++ b/client/src/app/shared/shared-main/feeds/feed.component.html | |||
@@ -1,6 +1,6 @@ | |||
1 | <div class="video-feed"> | 1 | <div class="video-feed"> |
2 | <my-global-icon | 2 | <my-global-icon |
3 | *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="left auto" | 3 | *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto" |
4 | class="icon-syndication" role="button" iconName="syndication" | 4 | class="icon-syndication" role="button" iconName="syndication" |
5 | > | 5 | > |
6 | </my-global-icon> | 6 | </my-global-icon> |
diff --git a/client/src/app/shared/shared-moderation/moderation.scss b/client/src/app/shared/shared-moderation/moderation.scss index 260346dc5..c9f0d0c42 100644 --- a/client/src/app/shared/shared-moderation/moderation.scss +++ b/client/src/app/shared/shared-moderation/moderation.scss | |||
@@ -22,6 +22,23 @@ | |||
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | .screenratio { | ||
26 | div { | ||
27 | @include miniature-thumbnail; | ||
28 | |||
29 | display: inline-flex; | ||
30 | justify-content: center; | ||
31 | align-items: center; | ||
32 | color: pvar(--inputPlaceholderColor); | ||
33 | } | ||
34 | |||
35 | @include large-screen-ratio($selector: 'div, ::ng-deep iframe') { | ||
36 | width: 100% !important; | ||
37 | height: 100% !important; | ||
38 | left: 0; | ||
39 | }; | ||
40 | } | ||
41 | |||
25 | .input-group { | 42 | .input-group { |
26 | @include peertube-input-group(300px); | 43 | @include peertube-input-group(300px); |
27 | 44 | ||