]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
Add nth abuse count for a given video, add reporter/reportee reports stats
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / video-abuse-list / video-abuse-list.component.html
index c1ce093d7d3aeaaba8d35eb60ec552041d9b1cb5..67ef284083aeca3abc5ca853ab1129a408f1cac6 100644 (file)
       <td *ngIf="!videoAbuse.video.deleted">
         <a [href]="getVideoUrl(videoAbuse)" class="video-abuse-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
           <div class="video-abuse-video">
-            <div class="video-abuse-video-image"><img [src]="videoAbuse.video.thumbnailPath"></div>
+            <div class="video-abuse-video-image">
+              <img [src]="videoAbuse.video.thumbnailPath">
+              <span
+                class="video-abuse-video-image-label" *ngIf="videoAbuse.count > 1"
+                i18n-title title="This video has been reported multiple times."
+              >{{ videoAbuse.nth }}/{{ videoAbuse.count }}</span>
+            </div>
             <div class="video-abuse-video-text">
               <div>
                 {{ videoAbuse.video.name }}
       <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
         <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
         <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
-        <span *ngIf="videoAbuse.moderationComment" [title]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
+        <span *ngIf="videoAbuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
       </td>
 
       <td class="action-cell">
-        <my-action-dropdown placement="bottom-right auto" container="body" i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"></my-action-dropdown>
+        <my-action-dropdown
+          [ngClass]="{ 'show': expanded }" placement="bottom-right auto" container="body"
+          i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"
+        ></my-action-dropdown>
       </td>
     </tr>
   </ng-template>
   <ng-template pTemplate="rowexpansion" let-videoAbuse>
       <tr>
         <td class="expand-cell" colspan="6">
-          <div class="d-flex">
+          <div class="d-flex moderation-expanded">
+            <!-- report metadata -->
             <div class="col-8">
               <div class="d-flex">
-                <span class="col-3 moderation-expanded-label" i18n>Reason:</span>
+                <span class="col-3 moderation-expanded-label" i18n>Reporter</span>
+                <span class="col-9 moderation-expanded-text">
+                  <div class="chip">
+                    <img
+                      class="avatar"
+                      [src]="videoAbuse.reporterAccount.avatar.path"
+                      (error)="switchToDefaultAvatar($event)"
+                      alt="Avatar"
+                    >
+                    <div>
+                      <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
+                    </div>
+                  </div>
+                  <a routerLink="/admin/moderation/video-abuses/list" class="ml-auto text-muted video-abuse-links" i18n>
+                    {videoAbuse.countReportsForReporter, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReporter }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span>
+                  </a>
+                </span>
+              </div>
+              <div class="d-flex">
+                <span class="col-3 moderation-expanded-label" i18n>Reportee</span>
+                <span class="col-9 moderation-expanded-text">
+                  <div class="chip">
+                    <img
+                      class="avatar"
+                      [src]="videoAbuse.video.channel.ownerAccount?.avatar.path"
+                      (error)="switchToDefaultAvatar($event)"
+                      alt="Avatar"
+                    >
+                    <div>
+                      <span class="text-muted">{{ videoAbuse.video.channel.ownerAccount ? createByString(videoAbuse.video.channel.ownerAccount) : '' }}</span>
+                    </div>
+                  </div>
+                  <a routerLink="/admin/moderation/video-abuses/list" class="ml-auto text-muted video-abuse-links" *ngIf="!videoAbuse.video.deleted" i18n>
+                    {videoAbuse.countReportsForReportee, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReportee }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span>
+                  </a>
+                </span>
+              </div>
+              <div class="d-flex">
+                <span class="col-3 moderation-expanded-label" i18n>Updated</span>
+                <time class="col-9 moderation-expanded-text video-abuse-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time>
+              </div>
+
+              <!-- report text -->
+              <div class="mt-3 d-flex">
+                <span class="col-3 moderation-expanded-label" i18n>Report</span>
                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
               </div>
               <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
-                <span class="col-3 moderation-expanded-label" i18n>Note:</span>
+                <span class="col-3 moderation-expanded-label" i18n>Note</span>
                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
               </div>
             </div>