diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-27 11:42:05 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-10-29 11:48:21 +0200 |
commit | 33f6dce136ca6e969fe374efa099bee3f2a3599d (patch) | |
tree | 7a0d6228bab085944015a01267ad31aa1ec6082e /client/src/app/shared/shared-moderation | |
parent | 00004f7f6b966a975498612117212b5373f4103c (diff) | |
download | PeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.tar.gz PeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.tar.zst PeerTube-33f6dce136ca6e969fe374efa099bee3f2a3599d.zip |
Add videos list admin component
Diffstat (limited to 'client/src/app/shared/shared-moderation')
4 files changed, 2 insertions, 106 deletions
diff --git a/client/src/app/shared/shared-moderation/moderation.scss b/client/src/app/shared/shared-moderation/moderation.scss index 815e2791f..eaf5a8250 100644 --- a/client/src/app/shared/shared-moderation/moderation.scss +++ b/client/src/app/shared/shared-moderation/moderation.scss | |||
@@ -40,14 +40,6 @@ | |||
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
43 | .screenratio { | ||
44 | @include block-ratio($selector: 'div, ::ng-deep iframe') { | ||
45 | width: 100% !important; | ||
46 | height: 100% !important; | ||
47 | left: 0; | ||
48 | }; | ||
49 | } | ||
50 | |||
51 | .chip { | 43 | .chip { |
52 | @include chip; | 44 | @include chip; |
53 | } | 45 | } |
@@ -58,13 +50,6 @@ my-action-dropdown.show { | |||
58 | } | 50 | } |
59 | } | 51 | } |
60 | 52 | ||
61 | .table-video-link { | ||
62 | @include disable-outline; | ||
63 | |||
64 | position: relative; | ||
65 | top: 3px; | ||
66 | } | ||
67 | |||
68 | .table-comment-link, | 53 | .table-comment-link, |
69 | .table-account-link { | 54 | .table-account-link { |
70 | @include disable-outline; | 55 | @include disable-outline; |
@@ -81,68 +66,6 @@ my-action-dropdown.show { | |||
81 | flex-direction: column; | 66 | flex-direction: column; |
82 | } | 67 | } |
83 | 68 | ||
84 | .table-video { | ||
85 | display: inline-flex; | ||
86 | |||
87 | .table-video-image { | ||
88 | $image-height: 45px; | ||
89 | |||
90 | @include miniature-thumbnail; | ||
91 | @include margin-right(0.5rem); | ||
92 | |||
93 | height: $image-height; | ||
94 | width: #{math.div(16, 9) * $image-height}; | ||
95 | border-radius: 2px; | ||
96 | border: 0; | ||
97 | background: transparent; | ||
98 | display: inline-flex; | ||
99 | justify-content: center; | ||
100 | position: relative; | ||
101 | |||
102 | img { | ||
103 | height: 100%; | ||
104 | width: 100%; | ||
105 | border-radius: 2px; | ||
106 | } | ||
107 | |||
108 | span { | ||
109 | color: pvar(--inputPlaceholderColor); | ||
110 | } | ||
111 | |||
112 | .table-video-image-label { | ||
113 | @include static-thumbnail-overlay; | ||
114 | position: absolute; | ||
115 | border-radius: 3px; | ||
116 | font-size: 10px; | ||
117 | padding: 0 3px; | ||
118 | line-height: 1.3; | ||
119 | bottom: 2px; | ||
120 | right: 2px; | ||
121 | } | ||
122 | } | ||
123 | |||
124 | .table-video-text { | ||
125 | display: inline-flex; | ||
126 | flex-direction: column; | ||
127 | justify-content: center; | ||
128 | font-size: 90%; | ||
129 | color: pvar(--mainForegroundColor); | ||
130 | line-height: 1rem; | ||
131 | |||
132 | div .glyphicon { | ||
133 | @include margin-left(0.1rem); | ||
134 | |||
135 | font-size: 80%; | ||
136 | color: #808080; | ||
137 | } | ||
138 | |||
139 | div + div { | ||
140 | color: var(--greyForegroundColor); | ||
141 | font-size: 11px; | ||
142 | } | ||
143 | } | ||
144 | } | ||
145 | |||
146 | my-abuse-details { | 69 | my-abuse-details { |
147 | width: 100%; | 70 | width: 100%; |
148 | } | 71 | } |
diff --git a/client/src/app/shared/shared-moderation/report-modals/report.component.scss b/client/src/app/shared/shared-moderation/report-modals/report.component.scss index 06e50ac2d..76ec0a6ed 100644 --- a/client/src/app/shared/shared-moderation/report-modals/report.component.scss +++ b/client/src/app/shared/shared-moderation/report-modals/report.component.scss | |||
@@ -19,9 +19,3 @@ textarea { | |||
19 | @include margin-left(10px); | 19 | @include margin-left(10px); |
20 | } | 20 | } |
21 | } | 21 | } |
22 | |||
23 | .screenratio { | ||
24 | @include block-ratio($selector: 'div, ::ng-deep iframe') { | ||
25 | left: 0; | ||
26 | }; | ||
27 | } | ||
diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.html b/client/src/app/shared/shared-moderation/report-modals/video-report.component.html index 1aae64bff..afac108fc 100644 --- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.html +++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.html | |||
@@ -35,9 +35,7 @@ | |||
35 | <div class="col-7"> | 35 | <div class="col-7"> |
36 | <div class="row justify-content-center"> | 36 | <div class="row justify-content-center"> |
37 | <div class="col-12 col-lg-9 mb-2"> | 37 | <div class="col-12 col-lg-9 mb-2"> |
38 | <div class="screenratio"> | 38 | <my-embed [video]="video"></my-embed> |
39 | <div [innerHTML]="embedHtml"></div> | ||
40 | </div> | ||
41 | </div> | 39 | </div> |
42 | </div> | 40 | </div> |
43 | 41 | ||
diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts index 278d60ac6..38dd92910 100644 --- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { mapValues, pickBy } from 'lodash-es' | 1 | import { mapValues, pickBy } from 'lodash-es' |
2 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' | ||
3 | import { Component, Input, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, Input, OnInit, ViewChild } from '@angular/core' |
4 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 3 | import { DomSanitizer } from '@angular/platform-browser' |
5 | import { Notifier } from '@app/core' | 4 | import { Notifier } from '@app/core' |
6 | import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' | 5 | import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' |
7 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 6 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
8 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 7 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
9 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 8 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
10 | import { decorateVideoLink } from '@shared/core-utils' | ||
11 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' | 9 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' |
12 | import { AbusePredefinedReasonsString } from '@shared/models' | 10 | import { AbusePredefinedReasonsString } from '@shared/models' |
13 | import { Video } from '../../shared-main' | 11 | import { Video } from '../../shared-main' |
@@ -25,7 +23,6 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
25 | 23 | ||
26 | error: string = null | 24 | error: string = null |
27 | predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [] | 25 | predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [] |
28 | embedHtml: SafeHtml | ||
29 | 26 | ||
30 | private openedModal: NgbModalRef | 27 | private openedModal: NgbModalRef |
31 | 28 | ||
@@ -55,20 +52,6 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
55 | return this.form.get('timestamp').value | 52 | return this.form.get('timestamp').value |
56 | } | 53 | } |
57 | 54 | ||
58 | getVideoEmbed () { | ||
59 | return this.sanitizer.bypassSecurityTrustHtml( | ||
60 | buildVideoOrPlaylistEmbed( | ||
61 | decorateVideoLink({ | ||
62 | url: this.video.embedUrl, | ||
63 | title: false, | ||
64 | warningTitle: false | ||
65 | }), | ||
66 | |||
67 | this.video.name | ||
68 | ) | ||
69 | ) | ||
70 | } | ||
71 | |||
72 | ngOnInit () { | 55 | ngOnInit () { |
73 | this.buildForm({ | 56 | this.buildForm({ |
74 | reason: ABUSE_REASON_VALIDATOR, | 57 | reason: ABUSE_REASON_VALIDATOR, |
@@ -82,8 +65,6 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
82 | }) | 65 | }) |
83 | 66 | ||
84 | this.predefinedReasons = this.abuseService.getPrefefinedReasons('video') | 67 | this.predefinedReasons = this.abuseService.getPrefefinedReasons('video') |
85 | |||
86 | this.embedHtml = this.getVideoEmbed() | ||
87 | } | 68 | } |
88 | 69 | ||
89 | show () { | 70 | show () { |