aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
blob: 3a8df1f07e6972f025dbe35df99c04f34faa964e (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<h1>
  <my-global-icon iconName="cross" aria-hidden="true"></my-global-icon>
  <ng-container i18n>Video blocks</ng-container>
</h1>

<p-table
  [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"
>
  <ng-template pTemplate="caption">
    <div class="caption">
      <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;"></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>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-videoBlock let-expanded="expanded">
    <tr>
      <td *ngIf="!videoBlock.reason"></td>
      <td *ngIf="videoBlock.reason" class="expand-cell c-hand" [pRowToggler]="videoBlock" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
        <span class="expander">
          <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
        </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="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="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 }}
              </div>
              <div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div>
            </div>
          </div>
        </a>
      </td>

      <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>
        {{ videoBlock.createdAt | date: 'short' }}
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-videoBlock>
    <tr>
      <td class="expand-cell" colspan="6">
        <div class="d-flex moderation-expanded">

          <!-- 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>

  <ng-template pTemplate="emptymessage">
    <tr>
      <td colspan="6">
        <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>
      </td>
    </tr>
  </ng-template>
</p-table>