aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/overview/videos/video-list.component.html
blob: 1f1e9cc6e3b35b1c0588b51071a8b62303d7016b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<h1>
  <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
  <ng-container i18n>Videos</ng-container>
</h1>

<p-table
  [value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
  [sortField]="sort.field" [sortOrder]="sort.order"  dataKey="id" [resizableColumns]="true" [(selection)]="selectedVideos"
  [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} videos"
  (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
>
  <ng-template pTemplate="caption">
    <div class="caption">
      <div class="left-buttons">
        <my-action-dropdown
          *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
          [actions]="bulkVideoActions" [entry]="selectedVideos"
        >
        </my-action-dropdown>
      </div>

      <div class="ml-auto">
        <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">
        <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
      </th>
      <th style="width: 40px"></th>
      <th style="width: 60px;"></th>
      <th i18n>Video</th>
      <th i18n>Info</th>
      <th style="width: 150px;" i18n pSortableColumn="publishedAt">Published <p-sortIcon field="publishedAt"></p-sortIcon></th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-expanded="expanded" let-video>

    <tr [pSelectableRow]="video">
      <td class="checkbox-cell">
        <p-tableCheckbox [value]="video" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
      </td>

      <td class="expand-cell" [pRowToggler]="video">
        <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
      </td>

      <td class="action-cell">
        <my-video-actions-dropdown
          placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video"
          [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
        ></my-video-actions-dropdown>
      </td>

      <td>
        <my-video-cell [video]="video"></my-video-cell>
      </td>

      <td>
        <span class="badge badge-blue" i18n>{{ video.privacy.label }}</span>
        <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span>
        <span *ngIf="video.blocked" class="badge badge-red" i18n>NSFW</span>
      </td>

      <td>
        {{ video.publishedAt | date: 'short' }}
      </td>

    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-video>
    <tr>
      <td colspan="50">
        <my-embed [video]="video"></my-embed>
      </td>
    </tr>
  </ng-template>
</p-table>