]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Use badge in video block list
authorChocobozzz <me@florianbigard.com>
Mon, 16 Nov 2020 14:41:15 +0000 (15:41 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 16 Nov 2020 14:41:15 +0000 (15:41 +0100)
client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
client/src/app/+admin/moderation/video-block-list/video-block-list.component.scss
client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts

index 7250b136875fca60da494ce9499f9ee46c2d6204..c7275de1b5817bd72e911912e939ae4d508bdf61 100644 (file)
         </a>
       </td>
 
-      <ng-container *ngIf="videoBlock.reason">
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.video.nsfw) }}</td>
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.unfederated) }}</td>
-        <td class="c-hand" [pRowToggler]="videoBlock">{{ videoBlock.createdAt | date: 'short' }}</td>
-      </ng-container>
-      <ng-container *ngIf="!videoBlock.reason">
-        <td>{{ booleanToText(videoBlock.video.nsfw) }}</td>
-        <td>{{ booleanToText(videoBlock.unfederated) }}</td>
-        <td>{{ videoBlock.createdAt | date: 'short' }}</td>
-      </ng-container>
+      <td>
+        <span *ngIf="videoBlock.video.nsfw" class="badge badge-red" i18n>NSFW</span>
+      </td>
+
+      <td>
+        <span *ngIf="videoBlock.unfederated" class="badge badge-blue" i18n>Unfederated</span>
+      </td>
+
+      <td>
+        {{ videoBlock.createdAt | date: 'short' }}
+      </td>
     </tr>
   </ng-template>
 
index 0e34150c13601502b9d0378204f6e22c09b76814..b67e33cc1a0ec68b863390d15796f09594f3cb4d 100644 (file)
@@ -21,3 +21,7 @@ my-global-icon {
     flex-grow: 1;
   }
 }
+
+.badge {
+  @include table-badge;
+}
index 82818547cd9e5badd9adf8d0aa7410bc3471390f..1d0e56bfddf55725ef9f8f74e2cc2b873e1d2daa 100644 (file)
@@ -138,12 +138,6 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
     return Video.buildClientUrl(videoBlock.video.uuid)
   }
 
-  booleanToText (value: boolean) {
-    if (value === true) return $localize`yes`
-
-    return $localize`no`
-  }
-
   toHtml (text: string) {
     return this.markdownRenderer.textMarkdownToHTML(text)
   }