1
0
Fork 0

Use badge in video block list

This commit is contained in:
Chocobozzz 2020-11-16 15:41:15 +01:00
parent f0048d5edd
commit c195975c54
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 15 additions and 16 deletions

View file

@ -80,16 +80,17 @@
</a> </a>
</td> </td>
<ng-container *ngIf="videoBlock.reason"> <td>
<td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.video.nsfw) }}</td> <span *ngIf="videoBlock.video.nsfw" class="badge badge-red" i18n>NSFW</span>
<td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.unfederated) }}</td> </td>
<td class="c-hand" [pRowToggler]="videoBlock">{{ videoBlock.createdAt | date: 'short' }}</td>
</ng-container> <td>
<ng-container *ngIf="!videoBlock.reason"> <span *ngIf="videoBlock.unfederated" class="badge badge-blue" i18n>Unfederated</span>
<td>{{ booleanToText(videoBlock.video.nsfw) }}</td> </td>
<td>{{ booleanToText(videoBlock.unfederated) }}</td>
<td>{{ videoBlock.createdAt | date: 'short' }}</td> <td>
</ng-container> {{ videoBlock.createdAt | date: 'short' }}
</td>
</tr> </tr>
</ng-template> </ng-template>

View file

@ -21,3 +21,7 @@ my-global-icon {
flex-grow: 1; flex-grow: 1;
} }
} }
.badge {
@include table-badge;
}

View file

@ -138,12 +138,6 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
return Video.buildClientUrl(videoBlock.video.uuid) return Video.buildClientUrl(videoBlock.video.uuid)
} }
booleanToText (value: boolean) {
if (value === true) return $localize`yes`
return $localize`no`
}
toHtml (text: string) { toHtml (text: string) {
return this.markdownRenderer.textMarkdownToHTML(text) return this.markdownRenderer.textMarkdownToHTML(text)
} }