]>
Commit | Line | Data |
---|---|---|
1 | <div class="admin-sub-header"> | |
2 | <div i18n class="form-sub-title">Users list</div> | |
3 | ||
4 | <a class="add-button" routerLink="/admin/users/create"> | |
5 | <my-global-icon iconName="add"></my-global-icon> | |
6 | <ng-container i18n>Create user</ng-container> | |
7 | </a> | |
8 | </div> | |
9 | ||
10 | <p-table | |
11 | [value]="users" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
12 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" | |
13 | [(selection)]="selectedUsers" | |
14 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
15 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users" | |
16 | (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" | |
17 | > | |
18 | <ng-template pTemplate="caption"> | |
19 | <div class="caption"> | |
20 | <div> | |
21 | <my-action-dropdown | |
22 | *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange" | |
23 | [actions]="bulkUserActions" [entry]="selectedUsers" | |
24 | > | |
25 | </my-action-dropdown> | |
26 | </div> | |
27 | ||
28 | <div class="has-feedback has-clear"> | |
29 | <input | |
30 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
31 | (keyup)="onSearch($event)" | |
32 | > | |
33 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetSearch()"></a> | |
34 | <span class="sr-only" i18n>Clear filters</span> | |
35 | </div> | |
36 | </div> | |
37 | </ng-template> | |
38 | ||
39 | <ng-template pTemplate="header"> | |
40 | <tr> | |
41 | <th style="width: 40px"> | |
42 | <p-tableHeaderCheckbox></p-tableHeaderCheckbox> | |
43 | </th> | |
44 | <th style="width: 40px"></th> | |
45 | <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th> | |
46 | <th i18n>Email</th> | |
47 | <th i18n pSortableColumn="videoQuotaUsed">Video quota <p-sortIcon field="videoQuotaUsed"></p-sortIcon></th> | |
48 | <th i18n>Role</th> | |
49 | <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
50 | <th style="width: 50px;"></th> | |
51 | </tr> | |
52 | </ng-template> | |
53 | ||
54 | <ng-template pTemplate="body" let-expanded="expanded" let-user> | |
55 | ||
56 | <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }"> | |
57 | <td> | |
58 | <p-tableCheckbox [value]="user"></p-tableCheckbox> | |
59 | </td> | |
60 | ||
61 | <td class="expand-cell"> | |
62 | <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user"> | |
63 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
64 | </span> | |
65 | </td> | |
66 | ||
67 | <td> | |
68 | <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]"> | |
69 | <div class="chip two-lines"> | |
70 | <img | |
71 | class="avatar" | |
72 | [src]="user?.account?.avatar?.path" | |
73 | (error)="switchToDefaultAvatar($event)" | |
74 | alt="Avatar" | |
75 | > | |
76 | <div> | |
77 | {{ user.account.displayName }} | |
78 | <span class="text-muted">{{ user.username }}</span> | |
79 | </div> | |
80 | </div> | |
81 | <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span> | |
82 | </a> | |
83 | </td> | |
84 | ||
85 | <td *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus" [title]="user.email">{{ user.email }}</td> | |
86 | ||
87 | <ng-template #emailWithVerificationStatus> | |
88 | <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login"> | |
89 | <em>? {{ user.email }}</em> | |
90 | </td> | |
91 | <ng-template #emailVerifiedNotFalse> | |
92 | <td i18n-title title="User's email is verified / User can login without email verification"> | |
93 | ✓ {{ user.email }} | |
94 | </td> | |
95 | </ng-template> | |
96 | </ng-template> | |
97 | ||
98 | <td>{{ user.videoQuotaUsed }} / {{ user.videoQuota }}</td> | |
99 | <td>{{ user.roleLabel }}</td> | |
100 | <td [title]="user.createdAt">{{ user.createdAt }}</td> | |
101 | <td class="action-cell"> | |
102 | <my-user-moderation-dropdown *ngIf="!isInSelectionMode()" [user]="user" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()"> | |
103 | </my-user-moderation-dropdown> | |
104 | </td> | |
105 | </tr> | |
106 | </ng-template> | |
107 | ||
108 | <ng-template pTemplate="rowexpansion" let-user> | |
109 | <tr class="user-blocked-reason"> | |
110 | <td colspan="7"> | |
111 | <span i18n class="ban-reason-label">Ban reason:</span> | |
112 | {{ user.blockedReason }} | |
113 | </td> | |
114 | </tr> | |
115 | </ng-template> | |
116 | </p-table> | |
117 | ||
118 | <my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal> |