]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Place private/unlisted labels in thumbnail instead of miniature
authorRigel Kent <sendmemail@rigelk.eu>
Sat, 11 Apr 2020 12:47:13 +0000 (14:47 +0200)
committerRigel Kent <sendmemail@rigelk.eu>
Sat, 11 Apr 2020 14:05:50 +0000 (16:05 +0200)
client/src/app/shared/video/video-miniature.component.html
client/src/app/shared/video/video-thumbnail.component.html
client/src/app/shared/video/video-thumbnail.component.scss

index 6a8558de3764e592e80be7ff9367779a1b2e6136..8e948ce422ff6d3d01cc57150d0eeabe84856784 100644 (file)
@@ -2,7 +2,10 @@
   <my-video-thumbnail
     [video]="video" [nsfw]="isVideoBlur"
     [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-miniature-information">
           <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>
         </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>
 
       <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/accounts', video.byAccount ]">
index 3152161bf5f84775959df3efb01a11f64cb3a33b..fe5510c568b24d09aa2e6393a869737cec29537a 100644 (file)
@@ -18,6 +18,9 @@
     </ng-container>
   </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="play-overlay">
index c13105e94e570dc365e584d39523c2391786b131..5fca916f03a6d0ab8b2621d47726d96ef7d6f33f 100644 (file)
@@ -19,6 +19,7 @@
   }
 
   .video-thumbnail-watch-later-overlay,
+  .video-thumbnail-label-overlay,
   .video-thumbnail-duration-overlay {
     @include static-thumbnail-overlay;
 
     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 {
     position: absolute;
     padding: 0 5px;