aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html
blob: b4f66a75f4fde9a17ac145ebde815b78ebcee28d (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
<h1>
  <my-global-icon iconName="cross" aria-hidden="true"></my-global-icon>
  <ng-container i18n>Video comments</ng-container>
</h1>

this view does show comments from muted accounts so you can delete them

<p-table
  [value]="comments" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} comments"
  (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
>
  <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 comments filters</h6>
              <a [routerLink]="[ '/admin/moderation/video-comments/list' ]" [queryParams]="{ 'search': 'local:true' }" class="dropdown-item" i18n>Local comments</a>
              <a [routerLink]="[ '/admin/moderation/video-comments/list' ]" [queryParams]="{ 'search': 'local:false' }" class="dropdown-item" i18n>Remote comments</a>
            </div>
          </div>
          <input
            type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
            (keyup)="onSearch($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>
  </ng-template>

  <ng-template pTemplate="header">
    <tr>
      <th style="width: 40px"></th>
      <th style="width: 100px;" i18n>Account</th>
      <th style="width: 100px;" i18n>Video</th>
      <th style="width: 100px;" i18n>Comment</th>
      <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th>
      <th style="width: 150px;"></th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-videoComment let-expanded="expanded">
    <tr>
      <td class="expand-cell c-hand" [pRowToggler]="videoComment" 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>
        {{ videoComment.by }}
      </td>

      <td>
        {{ videoComment.video.name }}
      </td>

      <td>
        <div [innerHTML]="videoComment.textHtml"></div>
      </td>

      <td>{{ videoComment.createdAt | date: 'short' }}</td>

      <td class="action-cell">
        <my-action-dropdown
          [ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
          i18n-label label="Actions" [actions]="videoCommentActions" [entry]="videoComment"
        ></my-action-dropdown>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-videoComment>
    <tr>
      <td class="expand-cell" colspan="5">
        <div [innerHTML]="videoComment.textHtml"></div>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="emptymessage">
    <tr>
      <td colspan="5">
        <div class="no-results">
          <ng-container *ngIf="search" i18n>No comments found matching current filters.</ng-container>
          <ng-container *ngIf="!search" i18n>No comments found.</ng-container>
        </div>
      </td>
    </tr>
  </ng-template>
</p-table>