]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
Merge branch 'release/3.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / video-block-list / video-block-list.component.html
index f3ec373146c6525e6718fe10026eacc931f459bb..d89c8f24445c2754eb36617e90584b57c16bc715 100644 (file)
@@ -1,6 +1,12 @@
+<h1>
+  <my-global-icon iconName="cross" aria-hidden="true"></my-global-icon>
+  <ng-container i18n>Video blocks</ng-container>
+</h1>
+
 <p-table
-  [value]="blocklist" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
-  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
+  [value]="blocklist" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
+  [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
+  [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blocked videos"
   (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
@@ -8,25 +14,7 @@
   <ng-template pTemplate="caption">
     <div class="caption">
       <div class="ml-auto">
-        <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>Advanced block filters</h6>
-              <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:auto' }" class="dropdown-item" i18n>Automatic blocks</a>
-              <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:manual' }" class="dropdown-item" i18n>Manual blocks</a>
-            </div>
-          </div>
-          <input
-            type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
-            (keyup)="onBlockSearch($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>
+        <my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
       </div>
     </div>
   </ng-template>
   <ng-template pTemplate="header">
     <tr>
       <th style="width: 40px"></th>
+      <th style="width: 150px;"></th>
       <th i18n pSortableColumn="name">Video <p-sortIcon field="name"></p-sortIcon></th>
       <th style="width: 100px;" i18n>Sensitive</th>
       <th style="width: 120px;" i18n>Unfederated</th>
       <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th>
-      <th style="width: 150px;"></th>
     </tr>
   </ng-template>
 
         </span>
       </td>
 
+      <td class="action-cell">
+        <my-action-dropdown
+          [ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
+          i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
+        ></my-action-dropdown>
+      </td>
+
       <td>
-        <a [href]="getVideoUrl(videoBlock)" class="video-table-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
-          <div class="video-table-video">
-            <div class="video-table-video-image">
+        <a [href]="getVideoUrl(videoBlock)" class="table-video-link" [title]="videoBlock.video.name" target="_blank" rel="noopener noreferrer">
+          <div class="table-video">
+            <div class="table-video-image">
               <img [src]="videoBlock.video.thumbnailPath">
             </div>
-            <div class="video-table-video-text">
+            <div class="table-video-text">
               <div>
                 <my-global-icon i18n-title title="The video was blocked due to automatic blocking of new videos" *ngIf="videoBlock.type == 2" iconName="robot"></my-global-icon>
                 {{ videoBlock.video.name }}
         </a>
       </td>
 
-      <ng-container *ngIf="videoBlock.reason">
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.video.nsfw) }}</td>
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.unfederated) }}</td>
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ videoBlock.createdAt | date: 'short' }}</td>
-      </ng-container>
-      <ng-container *ngIf="!videoBlock.reason">
-        <td>{{ booleanToText(videoBlock.video.nsfw) }}</td>
-        <td>{{ booleanToText(videoBlock.unfederated) }}</td>
-        <td>{{ videoBlock.createdAt | date: 'short' }}</td>
-      </ng-container>
+      <td>
+        <span *ngIf="videoBlock.video.nsfw" class="badge badge-red" i18n>NSFW</span>
+      </td>
+
+      <td>
+        <span *ngIf="videoBlock.unfederated" class="badge badge-blue" i18n>Unfederated</span>
+      </td>
 
-      <td class="action-cell">
-        <my-action-dropdown
-          [ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
-          i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
-        ></my-action-dropdown>
+      <td>
+        {{ videoBlock.createdAt | date: 'short' }}
       </td>
     </tr>
   </ng-template>
     <tr>
       <td class="expand-cell" colspan="6">
         <div class="d-flex moderation-expanded">
-          <span class="col-2 moderation-expanded-label" i18n>Block reason:</span>
-          <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
+
+          <!-- block right part (block details) -->
+          <div class="col-8">
+            <span class="col-3 moderation-expanded-label" i18n>Block reason:</span>
+            <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
+          </div>
+
+          <!-- block right part (video embed) -->
+          <div class="col-4">
+            <div class="screenratio">
+              <div [innerHTML]="videoBlock.embedHtml"></div>
+            </div>
+          </div>
+
         </div>
       </td>
     </tr>
   <ng-template pTemplate="emptymessage">
     <tr>
       <td colspan="6">
-        <div class="empty-table-message">
+        <div class="no-results">
           <ng-container *ngIf="search" i18n>No blocked video found matching current filters.</ng-container>
           <ng-container *ngIf="!search" i18n>No blocked video found.</ng-container>
         </div>