aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-list/user-list.component.html
blob: bb1b264428747e91850e5d8ce6a8879302219866 (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
<div class="admin-sub-header">
  <div i18n class="form-sub-title">Users list</div>

  <a class="add-button" routerLink="/admin/users/create">
    <span class="icon icon-add"></span>
    <ng-container i18n>Create user</ng-container>
  </a>
</div>

<p-table
  [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
>
  <ng-template pTemplate="header">
    <tr>
      <th style="width: 40px"></th>
      <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th>
      <th i18n>Email</th>
      <th i18n>Video quota</th>
      <th i18n>Role</th>
      <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
      <th style="width: 50px;"></th>
    </tr>
  </ng-template>

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

    <tr [ngClass]="{ banned: user.blocked }">
      <td>
        <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
          <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
        </span>
      </td>
      <td>
        {{ user.username }}
        <span *ngIf="user.blocked" class="banned-info">(banned)</span>
      </td>
      <td>{{ user.email }}</td>
      <td>{{ user.videoQuotaUsed }} / {{ user.videoQuota }}</td>
      <td>{{ user.roleLabel }}</td>
      <td>{{ user.createdAt }}</td>
      <td class="action-cell">
        <my-action-dropdown i18n-label label="Actions" [actions]="userActions" [entry]="user"></my-action-dropdown>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-user>
    <tr class="user-blocked-reason">
      <td colspan="7">
        <span i18n class="ban-reason-label">Ban reason:</span>
        {{ user.blockedReason }}
      </td>
    </tr>
  </ng-template>
</p-table>

<my-user-ban-modal #userBanModal (userBanned)="onUserBanned()"></my-user-ban-modal>