aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-library/my-ownership/my-ownership.component.html
blob: 01470e46f0211762fab2e9e8c83c44aee647894d (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
<h1>
  <my-global-icon iconName="download" aria-hidden="true"></my-global-icon>
  <ng-container i18n>My ownership changes</ng-container>
</h1>

<p-table
    [value]="videoChangeOwnerships"
    [lazy]="true"
    [paginator]="totalRecords > 0"
    [totalRecords]="totalRecords"
    [rows]="rowsPerPage"
    [sortField]="sort.field"
    [sortOrder]="sort.order"
    (onLazyLoad)="loadLazy($event)"
>
  <ng-template pTemplate="header">
    <tr>
      <th style="width: 150px;" i18n>Actions</th>
      <th style="width: 35%;" i18n>Initiator</th>
      <th style="width: 65%;" i18n>Video</th>
      <th style="width: 150px;" i18n pSortableColumn="createdAt">
        Created
        <p-sortIcon field="createdAt"></p-sortIcon>
      </th>
      <th style="width: 100px;" i18n>Status</th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-videoChangeOwnership>
    <tr>
      <td class="action-cell">
        <ng-container *ngIf="videoChangeOwnership.status === 'WAITING'">
          <my-button i18n-title title="Accept" icon="tick" (click)="openAcceptModal(videoChangeOwnership)"></my-button>
          <my-button i18n-title title="Refuse" icon="cross" (click)="refuse(videoChangeOwnership)"></my-button>
        </ng-container>
      </td>
      <td>
        <a [href]="videoChangeOwnership.initiatorAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
          <div class="chip two-lines">
            <my-actor-avatar [account]="videoChangeOwnership.initiatorAccount" size="32"></my-actor-avatar>
            <div>
              {{ videoChangeOwnership.initiatorAccount.displayName }}
              <span class="muted">{{ videoChangeOwnership.initiatorAccount.nameWithHost }}</span>
            </div>
          </div>
        </a>
      </td>

      <td>
        <a [href]="videoChangeOwnership.video.url" class="video-table-video-link" [title]="videoChangeOwnership.video.name" target="_blank" rel="noopener noreferrer">
          <div class="video-table-video">
            <div class="video-table-video-image">
              <img [src]="videoChangeOwnership.video.thumbnailPath">
            </div>
            <div class="video-table-video-text">
              <div>
                {{ videoChangeOwnership.video.name }}
              </div>
              <div class="muted">by {{ videoChangeOwnership.video.channel?.displayName }} </div>
            </div>
          </div>
        </a>
      </td>

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

      <td>
        <span class="pt-badge"
          [ngClass]="getStatusClass(videoChangeOwnership.status)">{{ videoChangeOwnership.status }}</span>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="emptymessage">
    <tr>
      <td colspan="6">
        <div class="no-results">
          <ng-container i18n>No ownership change request found.</ng-container>
        </div>
      </td>
    </tr>
  </ng-template>
</p-table>

<my-accept-ownership #myAcceptOwnershipComponent (accepted)="accepted()"></my-accept-ownership>