aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-01 12:09:23 +0200
committerRigel Kent <sendmemail@rigelk.eu>2020-07-01 12:09:23 +0200
commit9b01cfc788a6ed525d72620da9f9e607b8d6396e (patch)
tree724aa0431b34d9189197a2fca1afbc99eaf7c082 /client/src/app/+admin
parent4dcaa2d797a31392e0d3f9239898fdb14c0ff857 (diff)
downloadPeerTube-9b01cfc788a6ed525d72620da9f9e607b8d6396e.tar.gz
PeerTube-9b01cfc788a6ed525d72620da9f9e607b8d6396e.tar.zst
PeerTube-9b01cfc788a6ed525d72620da9f9e607b8d6396e.zip
distinct style for rows of banned users in listing, saving space
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.html9
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.scss4
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts6
3 files changed, 14 insertions, 5 deletions
diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html
index e0022d2ba..ea5aca024 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/users/user-list/user-list.component.html
@@ -14,6 +14,7 @@
14 [showCurrentPageReport]="true" i18n-currentPageReportTemplate 14 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
15 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users" 15 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
16 (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" 16 (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
17 [rowStyleClass]="getRowClasses"
17> 18>
18 <ng-template pTemplate="caption"> 19 <ng-template pTemplate="caption">
19 <div class="caption"> 20 <div class="caption">
@@ -48,7 +49,7 @@
48 <th style="width: 120px;" i18n>Role</th> 49 <th style="width: 120px;" i18n>Role</th>
49 <th style="width: 140px;" pResizableColumn i18n>Auth plugin</th> 50 <th style="width: 140px;" pResizableColumn i18n>Auth plugin</th>
50 <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> 51 <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
51 <th style="width: 50px;"></th> 52 <th style="width: 60px;"></th>
52 </tr> 53 </tr>
53 </ng-template> 54 </ng-template>
54 55
@@ -75,11 +76,13 @@
75 alt="Avatar" 76 alt="Avatar"
76 > 77 >
77 <div> 78 <div>
78 {{ user.account.displayName }} 79 <span>
80 <span *ngIf="user.blocked" i18n-title title="The user was banned" class="glyphicon glyphicon-ban-circle"></span>
81 {{ user.account.displayName }}
82 </span>
79 <span class="text-muted">{{ user.username }}</span> 83 <span class="text-muted">{{ user.username }}</span>
80 </div> 84 </div>
81 </div> 85 </div>
82 <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span>
83 </a> 86 </a>
84 </td> 87 </td>
85 88
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/users/user-list/user-list.component.scss
index 99b22aaea..697b2c11b 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.scss
+++ b/client/src/app/+admin/users/user-list/user-list.component.scss
@@ -5,8 +5,8 @@
5 @include create-button; 5 @include create-button;
6} 6}
7 7
8tr.banned { 8tr.banned > td {
9 color: red; 9 background-color: lighten($color: $red, $amount: 40) !important;
10} 10}
11 11
12.banned-info { 12.banned-info {
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index 8f01c7d51..e167d1432 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -87,6 +87,12 @@ export class UserListComponent extends RestTable implements OnInit {
87 return 'UserListComponent' 87 return 'UserListComponent'
88 } 88 }
89 89
90 getRowClasses (rowData: User) {
91 return {
92 banned: rowData.blocked
93 }
94 }
95
90 openBanUserModal (users: User[]) { 96 openBanUserModal (users: User[]) {
91 for (const user of users) { 97 for (const user of users) {
92 if (user.username === 'root') { 98 if (user.username === 'root') {