Place private/unlisted labels in thumbnail instead of miniature

This commit is contained in:
Rigel Kent 2020-04-11 14:47:13 +02:00
parent 58e1765aff
commit 62eacb4209
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
3 changed files with 18 additions and 6 deletions

View File

@ -2,7 +2,10 @@
<my-video-thumbnail <my-video-thumbnail
[video]="video" [nsfw]="isVideoBlur" [video]="video" [nsfw]="isVideoBlur"
[displayWatchLaterPlaylist]="isWatchLaterPlaylistDisplayed()" [inWatchLaterPlaylist]="inWatchLaterPlaylist" (watchLaterClick)="onWatchLaterClick($event)" [displayWatchLaterPlaylist]="isWatchLaterPlaylistDisplayed()" [inWatchLaterPlaylist]="inWatchLaterPlaylist" (watchLaterClick)="onWatchLaterClick($event)"
></my-video-thumbnail> >
<ng-container ngProjectAs="label-warning" *ngIf="displayOptions.privacyLabel && isUnlistedVideo()" i18n>Unlisted</ng-container>
<ng-container ngProjectAs="label-danger" *ngIf="displayOptions.privacyLabel && isPrivateVideo()" i18n>Private</ng-container>
</my-video-thumbnail>
<div class="video-bottom"> <div class="video-bottom">
<div class="video-miniature-information"> <div class="video-miniature-information">
@ -19,11 +22,6 @@
<ng-container *ngIf="displayOptions.date && displayOptions.views"></ng-container> <ng-container *ngIf="displayOptions.date && displayOptions.views"></ng-container>
<ng-container i18n *ngIf="displayOptions.views">{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}</ng-container> <ng-container i18n *ngIf="displayOptions.views">{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}</ng-container>
</span> </span>
<ng-container *ngIf="displayOptions.privacyLabel">
<span *ngIf="isUnlistedVideo()" class="badge badge-warning ml-1" i18n>Unlisted</span>
<span *ngIf="isPrivateVideo()" class="badge badge-danger ml-1" i18n>Private</span>
</ng-container>
</span> </span>
<a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/accounts', video.byAccount ]"> <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/accounts', video.byAccount ]">

View File

@ -18,6 +18,9 @@
</ng-container> </ng-container>
</div> </div>
<div class="video-thumbnail-label-overlay warning"><ng-content select="label-warning"></ng-content></div>
<div class="video-thumbnail-label-overlay danger"><ng-content select="label-danger"></ng-content></div>
<div class="video-thumbnail-duration-overlay">{{ video.durationLabel }}</div> <div class="video-thumbnail-duration-overlay">{{ video.durationLabel }}</div>
<div class="play-overlay"> <div class="play-overlay">

View File

@ -19,6 +19,7 @@
} }
.video-thumbnail-watch-later-overlay, .video-thumbnail-watch-later-overlay,
.video-thumbnail-label-overlay,
.video-thumbnail-duration-overlay { .video-thumbnail-duration-overlay {
@include static-thumbnail-overlay; @include static-thumbnail-overlay;
@ -28,6 +29,16 @@
z-index: z(miniature); z-index: z(miniature);
} }
.video-thumbnail-label-overlay {
position: absolute;
padding: 0 5px;
left: 5px;
top: 5px;
&.warning { background-color: orange; }
&.danger { background-color: red; }
}
.video-thumbnail-duration-overlay { .video-thumbnail-duration-overlay {
position: absolute; position: absolute;
padding: 0 5px; padding: 0 5px;