]>
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"> |
457bb213 | 5 | <my-global-icon iconName="add"></my-global-icon> |
b1d40cff | 6 | <ng-container i18n>Create user</ng-container> |
04e0fc48 | 7 | </a> |
897ec54d | 8 | </div> |
04e0fc48 | 9 | |
ab998f7b | 10 | <p-table |
b8cf27c0 | 11 | [value]="users" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" |
141b177d | 12 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" |
791645e6 | 13 | [(selection)]="selectedUsers" |
2bc9bd08 | 14 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
45c14ae1 | 15 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users" |
d4051183 | 16 | (onPage)="onPage()" [expandedRowKeys]="expandedRows" |
04e0fc48 | 17 | > |
791645e6 C |
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> | |
29 | <input | |
30 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
be27ef3b | 31 | (keyup)="onSearch($event)" |
791645e6 C |
32 | > |
33 | </div> | |
34 | </div> | |
35 | </ng-template> | |
36 | ||
ab998f7b C |
37 | <ng-template pTemplate="header"> |
38 | <tr> | |
791645e6 | 39 | <th style="width: 40px"> |
2cae5f13 | 40 | <p-tableHeaderCheckbox></p-tableHeaderCheckbox> |
791645e6 | 41 | </th> |
2cae5f13 | 42 | <th style="width: 40px"></th> |
b1d40cff C |
43 | <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th> |
44 | <th i18n>Email</th> | |
4511437e | 45 | <th i18n pSortableColumn="videoQuotaUsed">Video quota <p-sortIcon field="videoQuotaUsed"></p-sortIcon></th> |
b1d40cff C |
46 | <th i18n>Role</th> |
47 | <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
141b177d | 48 | <th style="width: 50px;"></th> |
ab998f7b C |
49 | </tr> |
50 | </ng-template> | |
51 | ||
141b177d C |
52 | <ng-template pTemplate="body" let-expanded="expanded" let-user> |
53 | ||
791645e6 | 54 | <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }"> |
d6af8146 | 55 | <td> |
791645e6 C |
56 | <p-tableCheckbox [value]="user"></p-tableCheckbox> |
57 | </td> | |
58 | ||
d6af8146 | 59 | <td class="expand-cell"> |
141b177d C |
60 | <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user"> |
61 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
62 | </span> | |
63 | </td> | |
791645e6 | 64 | |
141b177d | 65 | <td> |
d6af8146 RK |
66 | <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]"> |
67 | <div class="chip two-lines"> | |
68 | <img | |
69 | class="avatar" | |
70 | [src]="user?.account?.avatar?.path" | |
71 | (error)="switchToDefaultAvatar($event)" | |
72 | alt="Avatar" | |
73 | > | |
74 | <div> | |
75 | {{ user.account.displayName }} | |
76 | <span class="text-muted">{{ user.username }}</span> | |
77 | </div> | |
78 | </div> | |
af5767ff C |
79 | <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span> |
80 | </a> | |
141b177d | 81 | </td> |
5abb9fbb | 82 | |
9b82d49d | 83 | <td *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus" [title]="user.email">{{ user.email }}</td> |
5abb9fbb | 84 | |
fc2ec87a JM |
85 | <ng-template #emailWithVerificationStatus> |
86 | <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login"> | |
87 | <em>? {{ user.email }}</em> | |
88 | </td> | |
89 | <ng-template #emailVerifiedNotFalse> | |
90 | <td i18n-title title="User's email is verified / User can login without email verification"> | |
91 | ✓ {{ user.email }} | |
92 | </td> | |
93 | </ng-template> | |
94 | </ng-template> | |
5abb9fbb | 95 | |
a76138ff | 96 | <td>{{ user.videoQuotaUsed }} / {{ user.videoQuota }}</td> |
ab998f7b | 97 | <td>{{ user.roleLabel }}</td> |
9b82d49d | 98 | <td [title]="user.createdAt">{{ user.createdAt }}</td> |
ab998f7b | 99 | <td class="action-cell"> |
791645e6 | 100 | <my-user-moderation-dropdown *ngIf="!isInSelectionMode()" [user]="user" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()"> |
79bd2632 | 101 | </my-user-moderation-dropdown> |
141b177d C |
102 | </td> |
103 | </tr> | |
104 | </ng-template> | |
105 | ||
106 | <ng-template pTemplate="rowexpansion" let-user> | |
107 | <tr class="user-blocked-reason"> | |
108 | <td colspan="7"> | |
109 | <span i18n class="ban-reason-label">Ban reason:</span> | |
110 | {{ user.blockedReason }} | |
ab998f7b C |
111 | </td> |
112 | </tr> | |
113 | </ng-template> | |
114 | </p-table> | |
141b177d | 115 | |
2fbe7f19 | 116 | <my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal> |