]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
distinct style for rows of banned users in listing, saving space
authorRigel Kent <sendmemail@rigelk.eu>
Wed, 1 Jul 2020 10:09:23 +0000 (12:09 +0200)
committerRigel Kent <sendmemail@rigelk.eu>
Wed, 1 Jul 2020 10:09:23 +0000 (12:09 +0200)
client/src/app/+admin/users/user-list/user-list.component.html
client/src/app/+admin/users/user-list/user-list.component.scss
client/src/app/+admin/users/user-list/user-list.component.ts

index e0022d2bafb8b820e006f436df95cf3d8c87a203..ea5aca024799e4112838a573b616afa6d2eb1be3 100644 (file)
@@ -14,6 +14,7 @@
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
   (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
+  [rowStyleClass]="getRowClasses"
 >
   <ng-template pTemplate="caption">
     <div class="caption">
@@ -48,7 +49,7 @@
       <th style="width: 120px;" i18n>Role</th>
       <th style="width: 140px;" pResizableColumn i18n>Auth plugin</th>
       <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
-      <th style="width: 50px;"></th>
+      <th style="width: 60px;"></th>
     </tr>
   </ng-template>
 
               alt="Avatar"
             >
             <div>
-              {{ user.account.displayName }}
+              <span>
+                <span *ngIf="user.blocked" i18n-title title="The user was banned" class="glyphicon glyphicon-ban-circle"></span>
+                {{ user.account.displayName }}
+              </span>
               <span class="text-muted">{{ user.username }}</span>
             </div>
           </div>
-          <span i18n *ngIf="user.blocked" class="banned-info">(banned)</span>
         </a>
       </td>
 
index 99b22aaea1ab78891e7cec4d412b5aec3547baf3..697b2c11be8092f2509273d3b195ad14c0f919e5 100644 (file)
@@ -5,8 +5,8 @@
   @include create-button;
 }
 
-tr.banned {
-  color: red;
+tr.banned > td {
+  background-color: lighten($color: $red, $amount: 40) !important;
 }
 
 .banned-info {
index 8f01c7d51497c586e2848bc843f98900c0966300..e167d1432323514e1743246143a5a4d257ada1f8 100644 (file)
@@ -87,6 +87,12 @@ export class UserListComponent extends RestTable implements OnInit {
     return 'UserListComponent'
   }
 
+  getRowClasses (rowData: User) {
+    return {
+      banned: rowData.blocked
+    }
+  }
+
   openBanUserModal (users: User[]) {
     for (const user of users) {
       if (user.username === 'root') {