diff --git a/client/src/app/+admin/moderation/moderation.component.scss b/client/src/app/+admin/moderation/moderation.component.scss
index 404eb050488f..76f3b6150ee2 100644
--- a/client/src/app/+admin/moderation/moderation.component.scss
+++ b/client/src/app/+admin/moderation/moderation.component.scss
@@ -46,6 +46,20 @@
}
}
+p-calendar {
+ display: block;
+
+ ::ng-deep {
+ .ui-widget-content {
+ min-width: 400px;
+ }
+
+ input {
+ @include peertube-input-text(100%);
+ }
+ }
+}
+
.screenratio {
div {
@include miniature-thumbnail;
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
index 453a282d1c8e..a29fadca85c6 100644
--- 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
@@ -57,6 +57,15 @@
+
Note
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
index d9cb19845f03..c12d0065d314 100644
--- 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
@@ -1,7 +1,8 @@
import { Component, Input } from '@angular/core'
-import { Account } from '@app/shared/account/account.model'
import { Actor } from '@app/shared/actor/actor.model'
+import { VideoAbusePredefinedReasons } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model'
import { ProcessedVideoAbuse } from './video-abuse-list.component'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-video-abuse-details',
@@ -11,6 +12,27 @@ import { ProcessedVideoAbuse } from './video-abuse-list.component'
export class VideoAbuseDetailsComponent {
@Input() videoAbuse: ProcessedVideoAbuse
+ private predefinedReasonsTranslations: { [key: number]: string }
+
+ constructor (
+ private i18n: I18n
+ ) {
+ this.predefinedReasonsTranslations = {
+ [VideoAbusePredefinedReasons.VIOLENT_OR_REPULSIVE]: this.i18n('Violent or Repulsive'),
+ [VideoAbusePredefinedReasons.HATEFUL_OR_ABUSIVE]: this.i18n('Hateful or Abusive'),
+ [VideoAbusePredefinedReasons.SPAM_OR_MISLEADING]: this.i18n('Spam or Misleading'),
+ [VideoAbusePredefinedReasons.PRIVACY]: this.i18n('Privacy'),
+ [VideoAbusePredefinedReasons.RIGHTS]: this.i18n('Rights'),
+ [VideoAbusePredefinedReasons.SERVER_RULES]: this.i18n('Server rules'),
+ [VideoAbusePredefinedReasons.THUMBNAILS]: this.i18n('Thumbnails'),
+ [VideoAbusePredefinedReasons.CAPTIONS]: this.i18n('Captions')
+ }
+ }
+
+ get predefinedReasons () {
+ return this.videoAbuse.predefinedReasons.map(r => this.predefinedReasonsTranslations[r])
+ }
+
switchToDefaultAvatar ($event: Event) {
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
}
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
index a36acc2abdaf..86ad40dee903 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
@@ -11,13 +11,13 @@ import { ModerationCommentModalComponent } from './moderation-comment-modal.comp
import { Video } from '../../../shared/video/video.model'
import { MarkdownService } from '@app/shared/renderer'
import { Actor } from '@app/shared/actor/actor.model'
-import { buildVideoLink, buildVideoEmbed } from 'src/assets/player/utils'
-import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
+import { buildVideoEmbed } from 'src/assets/player/utils'
import { DomSanitizer } from '@angular/platform-browser'
import { BlocklistService } from '@app/shared/blocklist'
import { VideoService } from '@app/shared/video/video.service'
import { ActivatedRoute, Params, Router } from '@angular/router'
import { filter } from 'rxjs/operators'
+import { environment } from 'src/environments/environment'
export type ProcessedVideoAbuse = VideoAbuse & {
moderationCommentHtml?: string,
@@ -259,12 +259,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV
}
getVideoEmbed (videoAbuse: VideoAbuse) {
- const absoluteAPIUrl = getAbsoluteAPIUrl()
- const embedUrl = buildVideoLink({
- baseUrl: absoluteAPIUrl + '/videos/embed/' + videoAbuse.video.uuid,
- warningTitle: false
- })
- return buildVideoEmbed(embedUrl)
+ return buildVideoEmbed(`${environment.embedUrl}/videos/embed/${videoAbuse.video.uuid}`)
}
switchToDefaultAvatar ($event: Event) {
diff --git a/client/src/app/shared/video-abuse/index.ts b/client/src/app/shared/video-abuse/index.ts
index 92cbfb5f9040..0c3a48d83b70 100644
--- a/client/src/app/shared/video-abuse/index.ts
+++ b/client/src/app/shared/video-abuse/index.ts
@@ -1 +1,2 @@
export * from './video-abuse.service'
+export * from './video-abuse-predefined-reasons.model'
diff --git a/client/src/app/shared/video-abuse/video-abuse-predefined-reasons.model.ts b/client/src/app/shared/video-abuse/video-abuse-predefined-reasons.model.ts
new file mode 100644
index 000000000000..5969f48cea89
--- /dev/null
+++ b/client/src/app/shared/video-abuse/video-abuse-predefined-reasons.model.ts
@@ -0,0 +1,14 @@
+export enum PredefinedReasons {
+ violentOrRepulsive = 'violentOrRepulsive',
+ hatefulOrAbusive = 'hatefulOrAbusive',
+ spamOrMisleading = 'spamOrMisleading',
+ privacy = 'privacy',
+ rights = 'rights',
+ serverRules = 'serverRules',
+ thumbnails = 'thumbnails',
+ captions = 'captions'
+}
+
+export type VideoAbusePredefinedReasons = {
+ [key in PredefinedReasons]?: boolean
+}
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts
index 700a30239654..a8f31a96597f 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/video-abuse/video-abuse.service.ts
@@ -6,6 +6,7 @@ import { Observable } from 'rxjs'
import { ResultList, VideoAbuse, VideoAbuseUpdate, VideoAbuseState } from '../../../../../shared'
import { environment } from '../../../environments/environment'
import { RestExtractor, RestPagination, RestService } from '../rest'
+import { VideoAbusePredefinedReasons } from './video-abuse-predefined-reasons.model'
@Injectable()
export class VideoAbuseService {
@@ -63,9 +64,11 @@ export class VideoAbuseService {
)
}
- reportVideo (id: number, reason: string) {
- const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + id + '/abuse'
- const body = { reason }
+ reportVideo (parameters: { id: number, reason: string, predefinedReasons?: VideoAbusePredefinedReasons, timestamp: any }) {
+ const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + parameters.id + '/abuse'
+
+ delete parameters.id
+ const body = { ...parameters }
return this.authHttp.post(url, body)
.pipe(
diff --git a/client/src/app/shared/video/modals/video-block.component.html b/client/src/app/shared/video/modals/video-block.component.html
index a8dd30b5ea1f..5e73d66c5014 100644
--- a/client/src/app/shared/video/modals/video-block.component.html
+++ b/client/src/app/shared/video/modals/video-block.component.html
@@ -1,6 +1,6 @@
@@ -9,7 +9,7 @@ Blocklist video