]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html
Move to HttpClient and PrimeNG data table
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / video-abuses / video-abuse-list / video-abuse-list.component.html
index 46043577c96b9bc1e38ba2da19585dec4aa083d6..e73f38112cba651eb7bef29ba7884f50b3d44ac4 100644 (file)
@@ -1,27 +1,23 @@
-<h3>Video abuses list</h3>
+<div class="row">
+  <div class="content-padding">
 
-<table class="table table-hover">
-  <thead>
-    <tr>
-      <th class="cell-id">ID</th>
-      <th class="cell-reason">Reason</th>
-      <th>Reporter pod host</th>
-      <th>Reporter username</th>
-      <th>Video</th>
-      <th>Created at</th>
-    </tr>
-  </thead>
+  <h3>Video abuses list</h3>
 
-  <tbody>
-    <tr *ngFor="let videoAbuse of videoAbuses">
-      <td>{{ videoAbuse.id }}</td>
-      <td>{{ videoAbuse.reason }}</td>
-      <td>{{ videoAbuse.reporterPodHost }}</td>
-      <td>{{ videoAbuse.reporterUsername }}</td>
-      <td>
-        <a [routerLink]="buildVideoLink(videoAbuse)" title="Go to video">{{ videoAbuse.videoId }}</a>
-      </td>
-      <td>{{ videoAbuse.createdAt | date: 'medium' }}</td>
-    </tr>
-  </tbody>
-</table>
+  <p-dataTable
+      [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+      sortField="id" (onLazyLoad)="loadLazy($event)"
+  >
+    <p-column field="id" header="ID" [sortable]="true"></p-column>
+    <p-column field="reason" header="Reason"></p-column>
+    <p-column field="reporterPodHost" header="Reporter pod host"></p-column>
+    <p-column field="reporterUsername" header="Reporter username"></p-column>
+    <p-column header="Video" styleClass="action-cell">
+      <ng-template pTemplate="body" let-videoAbuse="rowData">
+        <a [routerLink]="getRouterVideoLink(videoAbuse.videoId)" title="Go to the video">{{ videoAbuse.videoId }}</a>
+      </ng-template>
+    </p-column>
+    <p-column field="createdAt" header="Created date" [sortable]="true"></p-column>
+  </p-dataTable>
+
+  </div>
+</div>