Add information in report modal

pull/1462/head
Chocobozzz 2018-12-05 11:05:54 +01:00
parent 9c53ef67e3
commit a1b2f87613
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 25 additions and 0 deletions

View File

@ -6,6 +6,11 @@
<div class="modal-body"> <div class="modal-body">
<div i18n class="information">
Your report will be sent to moderators of {{ currentHost }}.
<ng-container *ngIf="isRemoteVideo()"> It will be forwarded to origin instance {{ originHost }} too.</ng-container>
</div>
<form novalidate [formGroup]="form" (ngSubmit)="report()"> <form novalidate [formGroup]="form" (ngSubmit)="report()">
<div class="form-group"> <div class="form-group">
<textarea i18n-placeholder placeholder="Reason..." formControlName="reason" [ngClass]="{ 'input-error': formErrors['reason'] }"> <textarea i18n-placeholder placeholder="Reason..." formControlName="reason" [ngClass]="{ 'input-error': formErrors['reason'] }">

View File

@ -1,6 +1,10 @@
@import 'variables'; @import 'variables';
@import 'mixins'; @import 'mixins';
.information {
margin-bottom: 20px;
}
textarea { textarea {
@include peertube-textarea(100%, 100px); @include peertube-textarea(100%, 100px);
} }

View File

@ -33,6 +33,18 @@ export class VideoReportComponent extends FormReactive implements OnInit {
super() super()
} }
get currentHost () {
return window.location.host
}
get originHost () {
if (this.isRemoteVideo()) {
return this.video.account.host
}
return ''
}
ngOnInit () { ngOnInit () {
this.buildForm({ this.buildForm({
reason: this.videoAbuseValidatorsService.VIDEO_ABUSE_REASON reason: this.videoAbuseValidatorsService.VIDEO_ABUSE_REASON
@ -61,4 +73,8 @@ export class VideoReportComponent extends FormReactive implements OnInit {
err => this.notificationsService.error(this.i18n('Error'), err.message) err => this.notificationsService.error(this.i18n('Error'), err.message)
) )
} }
isRemoteVideo () {
return !this.video.isLocal
}
} }