]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
Support pagination rowsPerPage change in instance account/server blocklists
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / video-abuse-list / video-abuse-list.component.html
index b55b18333deda6cdcf5193610160341f3a99d120..ba05073cf1b6d96a22ad407d26e18c4ffe9660fb 100644 (file)
@@ -3,35 +3,32 @@
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports"
+  (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
 >
   <ng-template pTemplate="caption">
     <div class="caption">
       <div class="ml-auto">
-        <div class="input-group">
+        <div class="input-group has-feedback has-clear">
           <div class="input-group-prepend c-hand" ngbDropdown placement="bottom-left auto" container="body">
             <div class="input-group-text" ngbDropdownToggle>
               <span class="caret" aria-haspopup="menu" role="button"></span>
             </div>
 
             <div role="menu" ngbDropdownMenu>
-              <h6 class="dropdown-header" i18n>Filter reports</h6>
-
-              <!-- TODO:
-              <div class="dropdown-item" i18n>Reports opened by admins</div>
-              <div class="dropdown-item" i18n>Reports on videos with multiple reports</div>
-              <div class="dropdown-item" i18n>Unassigned reports</div>
-              -->
+              <h6 class="dropdown-header" i18n>Advanced report filters</h6>
               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a>
               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a>
               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a>
-              <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blocked' }" class="dropdown-item" i18n>Reports with blocked videos</a>
+              <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blacklisted' }" class="dropdown-item" i18n>Reports with blacklisted videos</a>
               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:deleted' }" class="dropdown-item" i18n>Reports with deleted videos</a>
             </div>
           </div>
           <input
             type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
-            (keyup)="onSearch($event)"
+            (keyup)="onAbuseSearch($event)"
           >
+          <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetTableFilter()"></a>
+          <span class="sr-only" i18n>Clear filters</span>
         </div>
       </div>
     </div>
@@ -42,7 +39,7 @@
       <th style="width: 40px;"></th>
       <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
       <th i18n>Video</th>
-      <th style="width: 190px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
+      <th style="width: 140px;" 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: 120px;"></th>
     </tr>
@@ -67,7 +64,7 @@
             >
             <div>
               {{ videoAbuse.reporterAccount.displayName }}
-              <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
+              <span class="text-muted">{{ videoAbuse.reporterAccount.nameWithHost }}</span>
             </div>
           </div>
         </a>
         </div>
       </td>
 
-      <td class="c-hand" [pRowToggler]="videoAbuse">{{ videoAbuse.createdAt }}</td>
+      <td class="c-hand" [pRowToggler]="videoAbuse">{{ videoAbuse.createdAt | date: 'short'  }}</td>
 
       <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
         <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
   <ng-template pTemplate="rowexpansion" let-videoAbuse>
       <tr>
         <td class="expand-cell" colspan="6">
-          <div class="d-flex moderation-expanded">
-            <!-- report left part (report details) -->
-            <div class="col-8">
-
-              <!-- report metadata -->
-              <div class="d-flex">
-                <span class="col-3 moderation-expanded-label" i18n>Reporter</span>
-                <span class="col-9 moderation-expanded-text">
-                  <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:&quot;' + videoAbuse.reporterAccount.displayName + '&quot;' }" 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>
-                  </a>
-                  <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:&quot;' + videoAbuse.reporterAccount.displayName + '&quot;' }" class="ml-auto text-muted video-details-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' ]" [queryParams]="{ 'search': 'reportee:&quot;' +videoAbuse.video.channel.ownerAccount.displayName + '&quot;' }" class="ml-auto text-muted video-details-links" 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-details-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 #{{ videoAbuse.id }}</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-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
-              </div>
-
-            </div>
-
-            <!-- report right part (video details) -->
-            <div class="col-4">
-              <div class="screenratio">
-                <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted">
-                  <span i18n *ngIf="videoAbuse.video.deleted">The video was deleted</span>
-                  <span i18n *ngIf="!videoAbuse.video.deleted">The video was blacklisted</span>
-                </div>
-                <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div>
-              </div>
-            </div>
-          </div>
+          <my-video-abuse-details [videoAbuse]="videoAbuse"></my-video-abuse-details>
         </td>
       </tr>
   </ng-template>