Add ability to ban/unban users
[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     <span class="icon icon-add"></span>
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 >
14   <ng-template pTemplate="header">
15     <tr>
16       <th style="width: 40px"></th>
17       <th i18n pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th>
18       <th i18n>Email</th>
19       <th i18n>Video quota</th>
20       <th i18n>Role</th>
21       <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
22       <th style="width: 50px;"></th>
23     </tr>
24   </ng-template>
25
26   <ng-template pTemplate="body" let-expanded="expanded" let-user>
27
28     <tr [ngClass]="{ banned: user.blocked }">
29       <td>
30         <span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
31           <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
32         </span>
33       </td>
34       <td>
35         {{ user.username }}
36         <span *ngIf="user.blocked" class="banned-info">(banned)</span>
37       </td>
38       <td>{{ user.email }}</td>
39       <td>{{ user.videoQuota }}</td>
40       <td>{{ user.roleLabel }}</td>
41       <td>{{ user.createdAt }}</td>
42       <td class="action-cell">
43         <my-action-dropdown i18n-label label="Actions" [actions]="userActions" [entry]="user"></my-action-dropdown>
44       </td>
45     </tr>
46   </ng-template>
47
48   <ng-template pTemplate="rowexpansion" let-user>
49     <tr class="user-blocked-reason">
50       <td colspan="7">
51         <span i18n class="ban-reason-label">Ban reason:</span>
52         {{ user.blockedReason }}
53       </td>
54     </tr>
55   </ng-template>
56 </p-table>
57
58 <my-user-ban-modal #userBanModal (userBanned)="onUserBanned()"></my-user-ban-modal>