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