]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add information in report modal
authorChocobozzz <me@florianbigard.com>
Wed, 5 Dec 2018 10:05:54 +0000 (11:05 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 5 Dec 2018 10:05:54 +0000 (11:05 +0100)
client/src/app/videos/+video-watch/modal/video-report.component.html
client/src/app/videos/+video-watch/modal/video-report.component.scss
client/src/app/videos/+video-watch/modal/video-report.component.ts

index 8d9a492766ef9b2a26d81349aa08db7338ed9dce..733c01be011e4a42b363421ce31a45bb3320a01d 100644 (file)
@@ -6,6 +6,11 @@
 
   <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()">
       <div class="form-group">
         <textarea i18n-placeholder placeholder="Reason..." formControlName="reason" [ngClass]="{ 'input-error': formErrors['reason'] }">
index afcdb9a16f31ceb4db00a0714dd1c7059538b839..4713660a226c801f1e22f687bd3d0c3dc008a3b8 100644 (file)
@@ -1,6 +1,10 @@
 @import 'variables';
 @import 'mixins';
 
+.information {
+  margin-bottom: 20px;
+}
+
 textarea {
   @include peertube-textarea(100%, 100px);
 }
index 297afb19f45a227f838a97a596855f753c0bf118..023387984cf0e0f236e24f15cef6d06ad03fa184 100644 (file)
@@ -33,6 +33,18 @@ export class VideoReportComponent extends FormReactive implements OnInit {
     super()
   }
 
+  get currentHost () {
+    return window.location.host
+  }
+
+  get originHost () {
+    if (this.isRemoteVideo()) {
+      return this.video.account.host
+    }
+
+    return ''
+  }
+
   ngOnInit () {
     this.buildForm({
       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)
                            )
   }
+
+  isRemoteVideo () {
+    return !this.video.isLocal
+  }
 }