]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/users/user-list/user-list.component.html
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / users / user-list / user-list.component.html
1 <p-table
2 [value]="users" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
3 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true"
4 [(selection)]="selectedUsers"
5 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
6 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
7 (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
8 >
9 <ng-template pTemplate="caption">
10 <div class="caption">
11 <div class="left-buttons">
12 <my-action-dropdown
13 *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
14 [actions]="bulkUserActions" [entry]="selectedUsers"
15 >
16 </my-action-dropdown>
17
18 <a *ngIf="!isInSelectionMode()" class="add-button" routerLink="/admin/users/create">
19 <my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon>
20 <ng-container i18n>Create user</ng-container>
21 </a>
22 </div>
23
24 <div class="ml-auto">
25 <div class="input-group has-feedback has-clear">
26 <div class="input-group-prepend c-hand" ngbDropdown placement="bottom-left auto" container="body">
27 <div class="input-group-text" ngbDropdownToggle>
28 <span class="caret" aria-haspopup="menu" role="button"></span>
29 </div>
30
31 <div role="menu" ngbDropdownMenu>
32 <h6 class="dropdown-header" i18n>Advanced user filters</h6>
33 <a [routerLink]="[ '/admin/users/list' ]" [queryParams]="{ 'search': 'banned:true' }" class="dropdown-item" i18n>Banned users</a>
34 </div>
35 </div>
36 <input
37 type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
38 (keyup)="onSearch($event)"
39 >
40 <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetTableFilter()"></a>
41 <span class="sr-only" i18n>Clear filters</span>
42 </div>
43 </div>
44
45 </div>
46 </ng-template>
47
48 <ng-template pTemplate="header">
49 <tr>
50 <th style="width: 40px">
51 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
52 </th>
53 <th style="width: 40px"></th>
54 <th style="width: 60px;">
55 <div class="c-hand column-toggle" ngbDropdown placement="bottom-left auto" container="body" autoClose="outside">
56 <my-global-icon iconName="columns" ngbDropdownToggle></my-global-icon>
57
58 <div role="menu" class="dropdown-menu" ngbDropdownMenu>
59 <div class="dropdown-header" i18n>Table parameters</div>
60 <div ngbDropdownItem class="dropdown-item">
61 <my-select-checkbox
62 name="columns"
63 [availableItems]="columns"
64 [selectableGroup]="false" [(ngModel)]="selectedColumns"
65 i18n-placeholder placeholder="Select columns"
66 >
67 </my-select-checkbox>
68 </div>
69 <div ngbDropdownItem class="dropdown-item">
70 <my-peertube-checkbox inputName="highlightBannedUsers" [(ngModel)]="highlightBannedUsers"
71 i18n-labelText labelText="Highlight banned users"></my-peertube-checkbox>
72 </div>
73 </div>
74 </div>
75 </th>
76 <th *ngIf="isSelected('username')" pResizableColumn pSortableColumn="username">{{ getColumn('username').label }} <p-sortIcon field="username"></p-sortIcon></th>
77 <th *ngIf="isSelected('email')">{{ getColumn('email').label }}</th>
78 <th *ngIf="isSelected('quota')" style="width: 160px;" pSortableColumn="videoQuotaUsed">{{ getColumn('quota').label }} <p-sortIcon field="videoQuotaUsed"></p-sortIcon></th>
79 <th *ngIf="isSelected('quotaDaily')" style="width: 160px;">{{ getColumn('quotaDaily').label }}</th>
80 <th *ngIf="isSelected('role')" style="width: 120px;" pSortableColumn="role">{{ getColumn('role').label }} <p-sortIcon field="role"></p-sortIcon></th>
81 <th *ngIf="isSelected('pluginAuth')" style="width: 140px;" pResizableColumn >{{ getColumn('pluginAuth').label }}</th>
82 <th *ngIf="isSelected('createdAt')" style="width: 150px;" pSortableColumn="createdAt">{{ getColumn('createdAt').label }} <p-sortIcon field="createdAt"></p-sortIcon></th>
83 <th *ngIf="isSelected('lastLoginDate')" style="width: 150px;" pSortableColumn="lastLoginDate">{{ getColumn('lastLoginDate').label }} <p-sortIcon field="lastLoginDate"></p-sortIcon></th>
84 </tr>
85 </ng-template>
86
87 <ng-template pTemplate="body" let-expanded="expanded" let-user>
88
89 <tr [pSelectableRow]="user" [ngClass]="{ banned: highlightBannedUsers && user.blocked }">
90 <td class="checkbox-cell">
91 <p-tableCheckbox [value]="user" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
92 </td>
93
94 <td class="expand-cell">
95 <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
96 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
97 </span>
98 </td>
99
100 <td class="action-cell">
101 <my-user-moderation-dropdown *ngIf="!isInSelectionMode()" [user]="user" container="body"
102 (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()">
103 </my-user-moderation-dropdown>
104 </td>
105
106 <td *ngIf="isSelected('username')">
107 <a i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]">
108 <div class="chip two-lines">
109 <my-account-avatar [account]="user?.account"></my-account-avatar>
110 <div>
111 <span class="user-table-primary-text">{{ user.account.displayName }}</span>
112 <span class="text-muted">{{ user.username }}</span>
113 </div>
114 </div>
115 </a>
116 </td>
117
118 <td *ngIf="isSelected('email')" [title]="user.email">
119 <ng-container *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus">
120 <a class="table-email" [href]="'mailto:' + user.email">{{ user.email }}</a>
121 </ng-container>
122 </td>
123
124 <ng-template #emailWithVerificationStatus>
125 <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login">
126 <em>? {{ user.email }}</em>
127 </td>
128 <ng-template #emailVerifiedNotFalse>
129 <td i18n-title title="User's email is verified / User can login without email verification">
130 &#x2713; {{ user.email }}
131 </td>
132 </ng-template>
133 </ng-template>
134
135 <td *ngIf="isSelected('quota')">
136 <div class="progress" i18n-title title="Total video quota">
137 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaPercentage(user) + '%' }"
138 [attr.aria-valuenow]="user.rawVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuota">
139 </div>
140 <span>{{ user.videoQuotaUsed }}</span>
141 <span>{{ user.videoQuota }}</span>
142 </div>
143 </td>
144
145 <td *ngIf="isSelected('quotaDaily')">
146 <div class="progress" i18n-title title="Total daily video quota">
147 <div class="progress-bar secondary" role="progressbar" [style]="{ width: getUserVideoQuotaDailyPercentage(user) + '%' }"
148 [attr.aria-valuenow]="user.rawVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuotaDaily">
149 </div>
150 <span>{{ user.videoQuotaUsedDaily }}</span>
151 <span>{{ user.videoQuotaDaily }}</span>
152 </div>
153 </td>
154
155 <td *ngIf="isSelected('role')">
156 <span *ngIf="user.blocked" class="badge badge-banned" i18n-title title="The user was banned">{{ user.roleLabel }}</span>
157 <span *ngIf="!user.blocked" class="badge" [ngClass]="getRoleClass(user.role)">{{ user.roleLabel }}</span>
158 </td>
159
160 <td *ngIf="isSelected('pluginAuth')">
161 <ng-container *ngIf="user.pluginAuth">{{ user.pluginAuth }}</ng-container>
162 </td>
163
164 <td *ngIf="isSelected('createdAt')" [title]="user.createdAt">{{ user.createdAt | date: 'short' }}</td>
165
166 <td *ngIf="isSelected('lastLoginDate')" [title]="user.lastLoginDate">{{ user.lastLoginDate | date: 'short' }}</td>
167 </tr>
168 </ng-template>
169
170 <ng-template pTemplate="rowexpansion" let-user>
171 <tr class="user-blocked-reason">
172 <td colspan="7">
173 <span i18n class="ban-reason-label">Ban reason:</span>
174 {{ user.blockedReason }}
175 </td>
176 </tr>
177 </ng-template>
178 </p-table>
179
180 <my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal>