]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/users/user-list/user-list.component.html
Refactor modal buttons style
[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">
9c1a88e3 11 <div class="left-buttons">
791645e6
C
12 <my-action-dropdown
13 *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
14 [actions]="bulkUserActions" [entry]="selectedUsers"
15 >
16 </my-action-dropdown>
9c1a88e3
C
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>
791645e6
C
22 </div>
23
8491293b
RK
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..."
5ed46c1b 38 (keyup)="onSearch($event)"
8491293b
RK
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>
791645e6 43 </div>
8491293b 44
791645e6
C
45 </div>
46 </ng-template>
47
ab998f7b
C
48 <ng-template pTemplate="header">
49 <tr>
791645e6 50 <th style="width: 40px">
1916c966 51 <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
791645e6 52 </th>
2cae5f13 53 <th style="width: 40px"></th>
bc99dfe5 54 <th style="width: 60px;">
9a423632 55 <div class="c-hand column-toggle" ngbDropdown placement="bottom-left auto" container="body" autoClose="outside">
bc99dfe5 56 <my-global-icon iconName="columns" ngbDropdownToggle></my-global-icon>
30814423 57
bc99dfe5
RK
58 <div role="menu" class="dropdown-menu" ngbDropdownMenu>
59 <div class="dropdown-header" i18n>Table parameters</div>
60 <div ngbDropdownItem class="dropdown-item">
52c4976f
C
61 <my-select-checkbox
62 name="columns"
63 [availableItems]="columns"
64 [selectableGroup]="false" [(ngModel)]="selectedColumns"
857961f0 65 i18n-placeholder placeholder="Select columns"
52c4976f
C
66 >
67 </my-select-checkbox>
bc99dfe5
RK
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>
fe9cc718
C
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>
ab998f7b
C
84 </tr>
85 </ng-template>
86
141b177d
C
87 <ng-template pTemplate="body" let-expanded="expanded" let-user>
88
bc99dfe5 89 <tr [pSelectableRow]="user" [ngClass]="{ banned: highlightBannedUsers && user.blocked }">
7706b370 90 <td class="checkbox-cell">
1916c966 91 <p-tableCheckbox [value]="user" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
791645e6
C
92 </td>
93
d6af8146 94 <td class="expand-cell">
141b177d
C
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>
791645e6 99
30814423
K
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
52c4976f 106 <td *ngIf="isSelected('username')">
d6af8146
RK
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 <img
110 class="avatar"
111 [src]="user?.account?.avatar?.path"
112 (error)="switchToDefaultAvatar($event)"
113 alt="Avatar"
114 >
115 <div>
bc99dfe5 116 <span class="user-table-primary-text">{{ user.account.displayName }}</span>
d6af8146
RK
117 <span class="text-muted">{{ user.username }}</span>
118 </div>
119 </div>
af5767ff 120 </a>
141b177d 121 </td>
5abb9fbb 122
52c4976f 123 <td *ngIf="isSelected('email')" [title]="user.email">
4f5d0459
RK
124 <ng-container *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus">
125 <a class="table-email" [href]="'mailto:' + user.email">{{ user.email }}</a>
126 </ng-container>
bc99dfe5 127 </td>
5abb9fbb 128
fc2ec87a
JM
129 <ng-template #emailWithVerificationStatus>
130 <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login">
131 <em>? {{ user.email }}</em>
132 </td>
133 <ng-template #emailVerifiedNotFalse>
134 <td i18n-title title="User's email is verified / User can login without email verification">
135 &#x2713; {{ user.email }}
136 </td>
137 </ng-template>
138 </ng-template>
5abb9fbb 139
52c4976f 140 <td *ngIf="isSelected('quota')">
bc99dfe5
RK
141 <div class="progress" i18n-title title="Total video quota">
142 <div class="progress-bar" role="progressbar" [style]="{ width: getUserVideoQuotaPercentage(user) + '%' }"
143 [attr.aria-valuenow]="user.rawVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuota">
144 </div>
145 <span>{{ user.videoQuotaUsed }}</span>
146 <span>{{ user.videoQuota }}</span>
147 </div>
148 </td>
149
52c4976f 150 <td *ngIf="isSelected('quotaDaily')">
bc99dfe5
RK
151 <div class="progress" i18n-title title="Total daily video quota">
152 <div class="progress-bar secondary" role="progressbar" [style]="{ width: getUserVideoQuotaDailyPercentage(user) + '%' }"
153 [attr.aria-valuenow]="user.rawVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.rawVideoQuotaDaily">
154 </div>
155 <span>{{ user.videoQuotaUsedDaily }}</span>
156 <span>{{ user.videoQuotaDaily }}</span>
157 </div>
158 </td>
8bb71f2e 159
52c4976f 160 <td *ngIf="isSelected('role')">
bc99dfe5
RK
161 <span *ngIf="user.blocked" class="badge badge-banned" i18n-title title="The user was banned">{{ user.roleLabel }}</span>
162 <span *ngIf="!user.blocked" class="badge" [ngClass]="getRoleClass(user.role)">{{ user.roleLabel }}</span>
163 </td>
164
52c4976f 165 <td *ngIf="isSelected('pluginAuth')">
8bb71f2e
C
166 <ng-container *ngIf="user.pluginAuth">{{ user.pluginAuth }}</ng-container>
167 </td>
168
52c4976f 169 <td *ngIf="isSelected('createdAt')" [title]="user.createdAt">{{ user.createdAt | date: 'short' }}</td>
bc99dfe5 170
52c4976f 171 <td *ngIf="isSelected('lastLoginDate')" [title]="user.lastLoginDate">{{ user.lastLoginDate | date: 'short' }}</td>
141b177d
C
172 </tr>
173 </ng-template>
174
175 <ng-template pTemplate="rowexpansion" let-user>
176 <tr class="user-blocked-reason">
177 <td colspan="7">
178 <span i18n class="ban-reason-label">Ban reason:</span>
179 {{ user.blockedReason }}
ab998f7b
C
180 </td>
181 </tr>
182 </ng-template>
183</p-table>
141b177d 184
2fbe7f19 185<my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal>