]>
Commit | Line | Data |
---|---|---|
cd83ea1b | 1 | <div class="admin-sub-header"> |
b1d40cff | 2 | <div i18n class="form-sub-title">Users list</div> |
dfe3ec6b | 3 | |
4c200caa | 4 | <a class="add-button" routerLink="/admin/users/create"> |
04e0fc48 | 5 | <span class="icon icon-add"></span> |
b1d40cff | 6 | <ng-container i18n>Create user</ng-container> |
04e0fc48 | 7 | </a> |
897ec54d | 8 | </div> |
04e0fc48 | 9 | |
ab998f7b C |
10 | <p-table |
11 | [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | |
141b177d | 12 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" |
791645e6 | 13 | [(selection)]="selectedUsers" |
04e0fc48 | 14 | > |
791645e6 C |
15 | <ng-template pTemplate="caption"> |
16 | <div class="caption"> | |
17 | <div> | |
18 | <my-action-dropdown | |
19 | *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange" | |
20 | [actions]="bulkUserActions" [entry]="selectedUsers" | |
21 | > | |
22 | </my-action-dropdown> | |
23 | </div> | |
24 | ||
25 | <div> | |
26 | <input | |
27 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
24b9417c | 28 | (keyup)="onSearch($event.target.value)" |
791645e6 C |
29 | > |
30 | </div> | |
31 | </div> | |
32 | </ng-template> | |
33 | ||
ab998f7b C |
34 | <ng-template pTemplate="header"> |
35 | <tr> | |
791645e6 | 36 | <th style="width: 40px"> |
2cae5f13 | 37 | <p-tableHeaderCheckbox></p-tableHeaderCheckbox> |
791645e6 | 38 | </th> |
2cae5f13 | 39 | <th style="width: 40px"></th> |
b1d40cff C |
40 | <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th> |
41 | <th i18n>Email</th> | |
42 | <th i18n>Video quota</th> | |
43 | <th i18n>Role</th> | |
44 | <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
141b177d | 45 | <th style="width: 50px;"></th> |
ab998f7b C |
46 | </tr> |
47 | </ng-template> | |
48 | ||
141b177d C |
49 | <ng-template pTemplate="body" let-expanded="expanded" let-user> |
50 | ||
791645e6 C |
51 | <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }"> |
52 | <td> | |
53 | <p-tableCheckbox [value]="user"></p-tableCheckbox> | |
54 | </td> | |
55 | ||
141b177d C |
56 | <td> |
57 | <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user"> | |
58 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
59 | </span> | |
60 | </td> | |
791645e6 | 61 | |
141b177d | 62 | <td> |
af5767ff C |
63 | <a i18n-title title="Go to the account page" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]"> |
64 | {{ user.username }} | |
65 | <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span> | |
66 | </a> | |
141b177d | 67 | </td> |
ab998f7b | 68 | <td>{{ user.email }}</td> |
a76138ff | 69 | <td>{{ user.videoQuotaUsed }} / {{ user.videoQuota }}</td> |
ab998f7b C |
70 | <td>{{ user.roleLabel }}</td> |
71 | <td>{{ user.createdAt }}</td> | |
72 | <td class="action-cell"> | |
791645e6 | 73 | <my-user-moderation-dropdown *ngIf="!isInSelectionMode()" [user]="user" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()"> |
79bd2632 | 74 | </my-user-moderation-dropdown> |
141b177d C |
75 | </td> |
76 | </tr> | |
77 | </ng-template> | |
78 | ||
79 | <ng-template pTemplate="rowexpansion" let-user> | |
80 | <tr class="user-blocked-reason"> | |
81 | <td colspan="7"> | |
82 | <span i18n class="ban-reason-label">Ban reason:</span> | |
83 | {{ user.blockedReason }} | |
ab998f7b C |
84 | </td> |
85 | </tr> | |
86 | </ng-template> | |
87 | </p-table> | |
141b177d | 88 | |
791645e6 | 89 | <my-user-ban-modal #userBanModal (userBanned)="onUsersBanned()"></my-user-ban-modal> |