]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/abuse-list/abuse-list.component.html
Add ability to report account
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / abuse-list / abuse-list.component.html
index 167f32fe681c4c4d0a0c50d93aa36ee61f202915..99502304d03cb9c626731a7a62dd124bae6c9836 100644 (file)
@@ -1,6 +1,6 @@
 <p-table
   [value]="abuses" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
-  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true"
+  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true" [lazyLoadOnInit]="false"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports"
   (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
@@ -38,7 +38,7 @@
     <tr> <!-- header -->
       <th style="width: 40px;"></th>
       <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
-      <th i18n>Video</th>
+      <th i18n>Video/Comment/Account</th>
       <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
       <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
       <th style="width: 150px;"></th>
@@ -54,7 +54,7 @@
       </td>
 
       <td>
-        <a [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
+        <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
           <div class="chip two-lines">
             <img
               class="avatar"
             >
             <div>
               {{ abuse.reporterAccount.displayName }}
-              <span class="text-muted">{{ abuse.reporterAccount.nameWithHost }}</span>
+              <span>{{ abuse.reporterAccount.nameWithHost }}</span>
             </div>
           </div>
         </a>
+
+        <span i18n *ngIf="!abuse.reporterAccount">
+          Deleted account
+        </span>
       </td>
 
-      <td *ngIf="!abuse.video.deleted">
-        <a [href]="getVideoUrl(abuse)" class="video-table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer">
-          <div class="video-table-video">
-            <div class="video-table-video-image">
-              <img [src]="abuse.video.thumbnailPath">
-              <span
-                class="video-table-video-image-label" *ngIf="abuse.count > 1"
-                i18n-title title="This video has been reported multiple times."
-              >
-                {{ abuse.nth }}/{{ abuse.count }}
-              </span>
+      <ng-container *ngIf="abuse.video">
+
+        <td *ngIf="!abuse.video.deleted">
+          <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer">
+            <div class="table-video">
+              <div class="table-video-image">
+                <img [src]="abuse.video.thumbnailPath">
+                <span
+                  class="table-video-image-label" *ngIf="abuse.count > 1"
+                  i18n-title title="This video has been reported multiple times."
+                >
+                  {{ abuse.nth }}/{{ abuse.count }}
+                </span>
+              </div>
+
+              <div class="table-video-text">
+                <div>
+                  <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
+                  <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span>
+                  {{ abuse.video.name }}
+                </div>
+                <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
+              </div>
+            </div>
+          </a>
+        </td>
+
+        <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse">
+          <div class="table-video" i18n-title title="Video was deleted">
+            <div class="table-video-image">
+              <span i18n>Deleted</span>
             </div>
-            <div class="video-table-video-text">
+
+            <div class="table-video-text">
               <div>
-                <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
-                <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span>
                 {{ abuse.video.name }}
+                <span class="glyphicon glyphicon-trash"></span>
               </div>
-              <div class="text-muted" i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
+              <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
             </div>
           </div>
-        </a>
-      </td>
+        </td>
+      </ng-container>
+
+      <ng-container *ngIf="abuse.comment">
+        <td>
+          <a [href]="getCommentUrl(abuse)" [innerHTML]="abuse.truncatedCommentHtml" class="table-comment-link"
+            [title]="abuse.comment.video.name" target="_blank" rel="noopener noreferrer"
+          ></a>
+
+          <div class="comment-flagged-account" *ngIf="abuse.flaggedAccount">by {{ abuse.flaggedAccount.displayName }}</div>
+        </td>
+      </ng-container>
+
+      <ng-container *ngIf="!abuse.comment && !abuse.video">
+        <td *ngIf="abuse.flaggedAccount">
+          <a [href]="getAccountUrl(abuse)"  class="table-account-link" target="_blank" rel="noopener noreferrer">
+            <span>{{ abuse.flaggedAccount.displayName }}</span>
+
+            <span class="account-flagged-handle">{{ abuse.flaggedAccount.nameWithHostForced }}</span>
+          </a>
+        </td>
+
+        <td i18n *ngIf="!abuse.flaggedAccount">
+          Account deleted
+        </td>
+
+      </ng-container>
 
-      <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse">
-        <div class="video-table-video" i18n-title title="Video was deleted">
-          <div class="video-table-video-image">
-            <span i18n>Deleted</span>
-          </div>
-          <div class="video-table-video-text">
-            <div>
-              {{ abuse.video.name }}
-              <span class="glyphicon glyphicon-trash"></span>
-            </div>
-            <div class="text-muted" i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
-          </div>
-        </div>
-      </td>
 
       <td class="c-hand" [pRowToggler]="abuse">{{ abuse.createdAt | date: 'short'  }}</td>
 
-      <td class="c-hand video-abuse-states" [pRowToggler]="abuse">
+      <td class="c-hand abuse-states" [pRowToggler]="abuse">
         <span *ngIf="isAbuseAccepted(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-ok"></span>
         <span *ngIf="isAbuseRejected(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-remove"></span>
         <span *ngIf="abuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="abuse.moderationComment" class="glyphicon glyphicon-comment"></span>
     <tr>
       <td colspan="6">
         <div class="no-results">
-          <ng-container *ngIf="search" i18n>No video abuses found matching current filters.</ng-container>
-          <ng-container *ngIf="!search" i18n>No video abuses found.</ng-container>
+          <ng-container *ngIf="search" i18n>No abuses found matching current filters.</ng-container>
+          <ng-container *ngIf="!search" i18n>No abuses found.</ng-container>
         </div>
       </td>
     </tr>