]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/overview/users/user-list/user-list.component.html
8c90f5a450fa0506870c9d74b108f6b6aef307cf
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / overview / users / user-list / user-list.component.html
1 <h1>
2 <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
3 <ng-container i18n>Users</ng-container>
4 </h1>
5
6 <p-table
7 [value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
8 [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
9 [(selection)]="selectedRows" [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
10 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
11 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
12 [expandedRowKeys]="expandedRows"
13 >
14 <ng-template pTemplate="caption">
15 <div class="caption">
16 <div class="left-buttons">
17 <my-action-dropdown
18 *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
19 [actions]="bulkActions" [entry]="selectedRows"
20 >
21 </my-action-dropdown>
22
23 <a *ngIf="!isInSelectionMode()" class="peertube-create-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>
27 </div>
28
29 <div class="ms-auto">
30 <my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
31 </div>
32
33 </div>
34 </ng-template>
35
36 <ng-template pTemplate="header">
37 <tr>
38 <th style="width: 40px">
39 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
40 </th>
41 <th style="width: 40px"></th>
42 <th style="width: 70px;">
43 <div class="c-hand column-toggle" ngbDropdown placement="bottom-left auto" container="body" autoClose="outside">
44 <my-global-icon iconName="columns" ngbDropdownToggle></my-global-icon>
45
46 <div role="menu" class="dropdown-menu" ngbDropdownMenu>
47 <div class="dropdown-header" i18n>Table parameters</div>
48 <div ngbDropdownItem class="dropdown-item">
49 <my-select-checkbox
50 name="columns"
51 [availableItems]="columns"
52 [selectableGroup]="false" [(ngModel)]="selectedColumns"
53 i18n-placeholder placeholder="Select columns"
54 >
55 </my-select-checkbox>
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>
64 <th *ngIf="isSelected('username')" pResizableColumn pSortableColumn="username">{{ getColumn('username').label }} <p-sortIcon field="username"></p-sortIcon></th>
65 <th *ngIf="isSelected('role')" style="width: 120px;" pSortableColumn="role">{{ getColumn('role').label }} <p-sortIcon field="role"></p-sortIcon></th>
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>
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>
72 </tr>
73 </ng-template>
74
75 <ng-template pTemplate="body" let-expanded="expanded" let-user>
76
77 <tr [pSelectableRow]="user" [ngClass]="{ banned: highlightBannedUsers && user.blocked }">
78 <td class="checkbox-cell">
79 <p-tableCheckbox [value]="user" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
80 </td>
81
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>
84 </td>
85
86 <td class="action-cell">
87 <my-user-moderation-dropdown
88 *ngIf="!isInSelectionMode()" [user]="user" [account]="user.accountMutedStatus" [displayOptions]="userModerationDisplayOptions"
89 container="body" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()">
90 </my-user-moderation-dropdown>
91 </td>
92
93 <td *ngIf="isSelected('username')" class="cell-username">
94 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/a/' + user.username ]">
95 <div class="chip two-lines">
96 <my-actor-avatar [actor]="user?.account" actorType="account" size="32"></my-actor-avatar>
97 <div>
98 <span>{{ user.account.displayName }}</span>
99 <span class="muted">{{ user.username }}</span>
100 </div>
101 </div>
102 </a>
103
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>
106 </td>
107
108 <td *ngIf="isSelected('role')">
109 <span *ngIf="user.blocked" class="pt-badge badge-banned" i18n-title title="The user was banned">{{ user.role.label }}</span>
110 <span *ngIf="!user.blocked" class="pt-badge" [ngClass]="getRoleClass(user.role.id)">{{ user.role.label }}</span>
111 </td>
112
113 <td *ngIf="isSelected('email')">
114 <my-user-email-info [entry]="user" [requiresEmailVerification]="requiresEmailVerification"></my-user-email-info>
115 </td>
116
117 <td *ngIf="isSelected('quota')">
118 <div class="progress" i18n-title title="Total video quota">
119 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaPercentage(user) + '%' }"
120 [attr.aria-valuenow]="user.rawVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuota">
121 </div>
122 <span>{{ user.videoQuotaUsed }}</span>
123 <span>{{ user.videoQuota }}</span>
124 </div>
125 </td>
126
127 <td *ngIf="isSelected('quotaDaily')">
128 <div class="progress" i18n-title title="Total daily video quota">
129 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaDailyPercentage(user) + '%' }"
130 [attr.aria-valuenow]="user.rawVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuotaDaily">
131 </div>
132 <span>{{ user.videoQuotaUsedDaily }}</span>
133 <span>{{ user.videoQuotaDaily }}</span>
134 </div>
135 </td>
136
137 <td *ngIf="isSelected('pluginAuth')">
138 <ng-container *ngIf="user.pluginAuth">{{ user.pluginAuth }}</ng-container>
139 </td>
140
141 <td *ngIf="isSelected('createdAt')" [title]="user.createdAt">{{ user.createdAt | date: 'short' }}</td>
142
143 <td *ngIf="isSelected('lastLoginDate')" [title]="user.lastLoginDate">{{ user.lastLoginDate | date: 'short' }}</td>
144 </tr>
145 </ng-template>
146
147 <ng-template pTemplate="rowexpansion" let-user>
148 <tr class="user-blocked-reason">
149 <td colspan="7">
150 <span i18n class="ban-reason-label">Ban reason:</span>
151 {{ user.blockedReason }}
152 </td>
153 </tr>
154 </ng-template>
155 </p-table>
156
157 <my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal>