249883efcbffbdfc8727e402f7a3dfaab9420e32
[oweals/peertube.git] / client / src / app / +admin / users / user-list / user-list.component.html
1 <div class="admin-sub-header">
2   <div i18n class="form-sub-title">Users list</div>
3
4   <a class="add-button" routerLink="/admin/users/create">
5     <my-global-icon iconName="add"></my-global-icon>
6     <ng-container i18n>Create user</ng-container>
7   </a>
8 </div>
9
10 <p-table
11   [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
12   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
13   [(selection)]="selectedUsers"
14 >
15   <ng-template pTemplate="caption">
16     <div class="caption">
17       <div>
18         <my-action-dropdown
19           *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
20           [actions]="bulkUserActions" [entry]="selectedUsers"
21         >
22         </my-action-dropdown>
23       </div>
24
25       <div>
26         <input
27           type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
28           (keyup)="onSearch($event)"
29         >
30       </div>
31     </div>
32   </ng-template>
33
34   <ng-template pTemplate="header">
35     <tr>
36       <th style="width: 40px">
37         <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
38       </th>
39       <th style="width: 40px"></th>
40       <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th>
41       <th i18n>Email</th>
42       <th i18n pSortableColumn="videoQuotaUsed">Video quota <p-sortIcon field="videoQuotaUsed"></p-sortIcon></th>
43       <th i18n>Role</th>
44       <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
45       <th style="width: 50px;"></th>
46     </tr>
47   </ng-template>
48
49   <ng-template pTemplate="body" let-expanded="expanded" let-user>
50
51     <tr [pSelectableRow]="user" [ngClass]="{ banned: user.blocked }">
52       <td class="expand-cell">
53         <p-tableCheckbox [value]="user"></p-tableCheckbox>
54       </td>
55
56       <td>
57         <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
58           <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
59         </span>
60       </td>
61
62       <td>
63         <a i18n-title title="Go to the account page" target="_blank" rel="noopener noreferrer" [routerLink]="[ '/accounts/' + user.username ]">
64           {{ user.username }}
65           <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span>
66         </a>
67       </td>
68
69       <td *ngIf="!requiresEmailVerification || user.blocked; else emailWithVerificationStatus" [title]="user.email">{{ user.email }}</td>
70
71       <ng-template #emailWithVerificationStatus>
72         <td *ngIf="user.emailVerified === false; else emailVerifiedNotFalse" i18n-title title="User's email must be verified to login">
73           <em>? {{ user.email }}</em>
74         </td>
75         <ng-template #emailVerifiedNotFalse>
76           <td i18n-title title="User's email is verified / User can login without email verification">
77             &#x2713; {{ user.email }}
78           </td>
79         </ng-template>
80       </ng-template>
81
82       <td>{{ user.videoQuotaUsed }} / {{ user.videoQuota }}</td>
83       <td>{{ user.roleLabel }}</td>
84       <td [title]="user.createdAt">{{ user.createdAt }}</td>
85       <td class="action-cell">
86         <my-user-moderation-dropdown *ngIf="!isInSelectionMode()" [user]="user" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()">
87         </my-user-moderation-dropdown>
88       </td>
89     </tr>
90   </ng-template>
91
92   <ng-template pTemplate="rowexpansion" let-user>
93     <tr class="user-blocked-reason">
94       <td colspan="7">
95         <span i18n class="ban-reason-label">Ban reason:</span>
96         {{ user.blockedReason }}
97       </td>
98     </tr>
99   </ng-template>
100 </p-table>
101
102 <my-user-ban-modal #userBanModal (userBanned)="onUserChanged()"></my-user-ban-modal>