]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/overview/users/user-list/user-list.component.html
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / overview / users / user-list / user-list.component.html
CommitLineData
00004f7f
C
1<h1>
2 <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
3 <ng-container i18n>Users</ng-container>
4</h1>
5
ab998f7b 6<p-table
2e46eb97 7 [value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
87a0cac6 8 [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedUsers"
807a2280 9 [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
2bc9bd08 10 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
45c14ae1 11 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
e6492b2d 12 [expandedRowKeys]="expandedRows"
04e0fc48 13>
791645e6
C
14 <ng-template pTemplate="caption">
15 <div class="caption">
9c1a88e3 16 <div class="left-buttons">
791645e6
C
17 <my-action-dropdown
18 *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
19 [actions]="bulkUserActions" [entry]="selectedUsers"
20 >
21 </my-action-dropdown>
9c1a88e3
C
22
23 <a *ngIf="!isInSelectionMode()" class="add-button" routerLink="/admin/users/create">
24 <my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon>
25 <ng-container i18n>Create user</ng-container>
26 </a>
791645e6
C
27 </div>
28
4c8749cb 29 <div class="ms-auto">
2e46eb97 30 <my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
791645e6 31 </div>
8491293b 32
791645e6
C
33 </div>
34 </ng-template>
35
ab998f7b
C
36 <ng-template pTemplate="header">
37 <tr>
791645e6 38 <th style="width: 40px">
1916c966 39 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
791645e6 40 </th>
2cae5f13 41 <th style="width: 40px"></th>
bc99dfe5 42 <th style="width: 60px;">
9a423632 43 <div class="c-hand column-toggle" ngbDropdown placement="bottom-left auto" container="body" autoClose="outside">
bc99dfe5 44 <my-global-icon iconName="columns" ngbDropdownToggle></my-global-icon>
30814423 45
bc99dfe5
RK
46 <div role="menu" class="dropdown-menu" ngbDropdownMenu>
47 <div class="dropdown-header" i18n>Table parameters</div>
48 <div ngbDropdownItem class="dropdown-item">
52c4976f
C
49 <my-select-checkbox
50 name="columns"
51 [availableItems]="columns"
52 [selectableGroup]="false" [(ngModel)]="selectedColumns"
857961f0 53 i18n-placeholder placeholder="Select columns"
52c4976f
C
54 >
55 </my-select-checkbox>
bc99dfe5
RK
56 </div>
57 <div ngbDropdownItem class="dropdown-item">
58 <my-peertube-checkbox inputName="highlightBannedUsers" [(ngModel)]="highlightBannedUsers"
59 i18n-labelText labelText="Highlight banned users"></my-peertube-checkbox>
60 </div>
61 </div>
62 </div>
63 </th>
fe9cc718 64 <th *ngIf="isSelected('username')" pResizableColumn pSortableColumn="username">{{ getColumn('username').label }} <p-sortIcon field="username"></p-sortIcon></th>
a282e4d8 65 <th *ngIf="isSelected('role')" style="width: 120px;" pSortableColumn="role">{{ getColumn('role').label }} <p-sortIcon field="role"></p-sortIcon></th>
fe9cc718
C
66 <th *ngIf="isSelected('email')">{{ getColumn('email').label }}</th>
67 <th *ngIf="isSelected('quota')" style="width: 160px;" pSortableColumn="videoQuotaUsed">{{ getColumn('quota').label }} <p-sortIcon field="videoQuotaUsed"></p-sortIcon></th>
68 <th *ngIf="isSelected('quotaDaily')" style="width: 160px;">{{ getColumn('quotaDaily').label }}</th>
fe9cc718
C
69 <th *ngIf="isSelected('pluginAuth')" style="width: 140px;" pResizableColumn >{{ getColumn('pluginAuth').label }}</th>
70 <th *ngIf="isSelected('createdAt')" style="width: 150px;" pSortableColumn="createdAt">{{ getColumn('createdAt').label }} <p-sortIcon field="createdAt"></p-sortIcon></th>
71 <th *ngIf="isSelected('lastLoginDate')" style="width: 150px;" pSortableColumn="lastLoginDate">{{ getColumn('lastLoginDate').label }} <p-sortIcon field="lastLoginDate"></p-sortIcon></th>
ab998f7b
C
72 </tr>
73 </ng-template>
74
141b177d
C
75 <ng-template pTemplate="body" let-expanded="expanded" let-user>
76
bc99dfe5 77 <tr [pSelectableRow]="user" [ngClass]="{ banned: highlightBannedUsers && user.blocked }">
7706b370 78 <td class="checkbox-cell">
1916c966 79 <p-tableCheckbox [value]="user" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
791645e6
C
80 </td>
81
e4611b54
C
82 <td class="expand-cell" [ngClass]="{ 'empty-cell': !user.blockedReason }" [pRowToggler]="user">
83 <my-table-expander-icon *ngIf="user.blockedReason" [expanded]="expanded"></my-table-expander-icon>
141b177d 84 </td>
791645e6 85
30814423 86 <td class="action-cell">
a282e4d8
C
87 <my-user-moderation-dropdown
88 *ngIf="!isInSelectionMode()" [user]="user" [account]="user.accountMutedStatus" [displayOptions]="userModerationDisplayOptions"
89 container="body" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()">
30814423
K
90 </my-user-moderation-dropdown>
91 </td>
92
4c8749cb 93 <td *ngIf="isSelected('username')" class="cell-username">
71887396 94 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/a/' + user.username ]">
d6af8146 95 <div class="chip two-lines">
746018f6 96 <my-actor-avatar [account]="user?.account" size="32"></my-actor-avatar>
fbdcd4ec 97 <div>
bc99dfe5 98 <span class="user-table-primary-text">{{ user.account.displayName }}</span>
b788e691 99 <span class="muted">{{ user.username }}</span>
d6af8146
RK
100 </div>
101 </div>
af5767ff 102 </a>
a282e4d8 103
4c8749cb
C
104 <div *ngIf="user.accountMutedStatus.mutedByInstance" class="pt-badge badge-red" i18n>Muted</div>
105 <div *ngIf="user.blocked" class="pt-badge badge-red" i18n>Banned</div>
a282e4d8
C
106 </td>
107
108 <td *ngIf="isSelected('role')">
4c8749cb
C
109 <span *ngIf="user.blocked" class="pt-badge badge-banned" i18n-title title="The user was banned">{{ user.roleLabel }}</span>
110 <span *ngIf="!user.blocked" class="pt-badge" [ngClass]="getRoleClass(user.role)">{{ user.roleLabel }}</span>
141b177d 111 </td>
5abb9fbb 112
52c4976f 113 <td *ngIf="isSelected('email')" [title]="user.email">
4f5d0459
RK
114 <ng-container *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus">
115 <a class="table-email" [href]="'mailto:' + user.email">{{ user.email }}</a>
116 </ng-container>
bc99dfe5 117 </td>
5abb9fbb 118
fc2ec87a
JM
119 <ng-template #emailWithVerificationStatus>
120 <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login">
121 <em>? {{ user.email }}</em>
122 </td>
123 <ng-template #emailVerifiedNotFalse>
124 <td i18n-title title="User's email is verified / User can login without email verification">
125 &#x2713; {{ user.email }}
126 </td>
127 </ng-template>
128 </ng-template>
5abb9fbb 129
52c4976f 130 <td *ngIf="isSelected('quota')">
bc99dfe5
RK
131 <div class="progress" i18n-title title="Total video quota">
132 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaPercentage(user) + '%' }"
133 [attr.aria-valuenow]="user.rawVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuota">
134 </div>
135 <span>{{ user.videoQuotaUsed }}</span>
136 <span>{{ user.videoQuota }}</span>
137 </div>
138 </td>
139
52c4976f 140 <td *ngIf="isSelected('quotaDaily')">
bc99dfe5 141 <div class="progress" i18n-title title="Total daily video quota">
1fef6bcc 142 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaDailyPercentage(user) + '%' }"
bc99dfe5
RK
143 [attr.aria-valuenow]="user.rawVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuotaDaily">
144 </div>
145 <span>{{ user.videoQuotaUsedDaily }}</span>
146 <span>{{ user.videoQuotaDaily }}</span>
147 </div>
148 </td>
8bb71f2e 149
52c4976f 150 <td *ngIf="isSelected('pluginAuth')">
8bb71f2e
C
151 <ng-container *ngIf="user.pluginAuth">{{ user.pluginAuth }}</ng-container>
152 </td>
153
52c4976f 154 <td *ngIf="isSelected('createdAt')" [title]="user.createdAt">{{ user.createdAt | date: 'short' }}</td>
bc99dfe5 155
52c4976f 156 <td *ngIf="isSelected('lastLoginDate')" [title]="user.lastLoginDate">{{ user.lastLoginDate | date: 'short' }}</td>
141b177d
C
157 </tr>
158 </ng-template>
159
160 <ng-template pTemplate="rowexpansion" let-user>
161 <tr class="user-blocked-reason">
162 <td colspan="7">
163 <span i18n class="ban-reason-label">Ban reason:</span>
164 {{ user.blockedReason }}
ab998f7b
C
165 </td>
166 </tr>
167 </ng-template>
168</p-table>
141b177d 169
2fbe7f19 170<my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal>