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