]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Square channel avatar consistency
authorChocobozzz <me@florianbigard.com>
Mon, 29 Mar 2021 14:45:35 +0000 (16:45 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Wed, 31 Mar 2021 07:05:51 +0000 (09:05 +0200)
14 files changed:
client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
client/src/app/+my-library/my-subscriptions/my-subscriptions.component.scss
client/src/app/+search/search.component.scss
client/src/app/+videos/+video-watch/video-watch.component.scss
client/src/app/shared/shared-main/account/actor-avatar-info.component.html
client/src/app/shared/shared-main/account/actor-avatar-info.component.scss
client/src/app/shared/shared-main/account/actor-avatar-info.component.ts
client/src/app/shared/shared-main/account/video-avatar-channel.component.html
client/src/app/shared/shared-main/account/video-avatar-channel.component.scss
client/src/app/shared/shared-video-miniature/video-miniature.component.html
client/src/app/shared/shared-video-miniature/video-miniature.component.scss
client/src/app/shared/shared-video-miniature/video-miniature.component.ts
client/src/sass/include/_miniature.scss
client/src/sass/include/_mixins.scss

index f2f42459fce850e1b20e9f26f3948a6454b68750..8804fa95c533c2fb42fbf332027d1e4b42f1b04a 100644 (file)
@@ -17,10 +17,11 @@ input[type=text] {
 
 .video-channel {
   @include row-blocks;
+
   padding-bottom: 0;
 
   img {
-    @include avatar(80px);
+    @include channel-avatar(80px);
 
     margin-right: 10px;
   }
index 5ead45dd85a6911c5ac838e010a1386189cbac97..9fc8be86c374e5173ec053bea8227ccd5ec4e00a 100644 (file)
@@ -9,7 +9,7 @@ input[type=text] {
   @include row-blocks;
 
   img {
-    @include avatar(80px);
+    @include channel-avatar(80px);
 
     margin-right: 10px;
   }
index 64927fa4b317c1ad12ea9b6e0cd551b645e58f9d..d25fdd31dabf81df9191d44e9a812be622ec178f 100644 (file)
@@ -48,7 +48,7 @@
         $image-size: 130px;
         $margin-size: ($video-thumbnail-width - $image-size) / 2; // So we have the same width than the video miniature
 
-        @include avatar($image-size);
+        @include channel-avatar($image-size);
 
         margin: 0 ($margin-size + 10) 0 $margin-size;
       }
index 555126cbc293eb709be5d7248b7b934e953df20b..a676052173a11a76bac1025047f1f5598cfaf5cc 100644 (file)
@@ -179,12 +179,6 @@ $video-info-margin-left: 44px;
           &:hover {
             opacity: 0.8;
           }
-
-          img {
-            @include avatar(18px);
-
-            margin: -2px 5px 0 0;
-          }
         }
 
         .video-info-channel-left {
index 30584fd005016cfb7dafd1419b6f67f20d143362..f3db553105c001c7305aad2a6634adc6aa9d6621 100644 (file)
@@ -1,7 +1,7 @@
 <ng-container *ngIf="actor">
   <div class="actor">
     <div class="d-flex">
-      <img [src]="actor.avatarUrl" alt="Avatar" />
+      <img [ngClass]="{ channel: isChannel() }" [src]="actor.avatarUrl" alt="Avatar" />
 
       <div class="actor-img-edit-container">
 
@@ -19,7 +19,6 @@
       </div>
     </div>
 
-
     <div class="actor-info">
       <div class="actor-info-names">
         <div class="actor-info-display-name">{{ actor.displayName }}</div>
index 57c298508ba5fe8e3b0300b12f1c4a94a10a9c6f..40ba4269bb3e14078a1a9941d137665816de08b6 100644 (file)
@@ -5,9 +5,15 @@
   display: flex;
 
   img {
-    @include avatar(100px);
-
     margin-right: 15px;
+
+    &:not(.channel) {
+      @include avatar(100px);
+    }
+
+    &.channel {
+      @include channel-avatar(100px);
+    }
   }
 
   .actor-img-edit-container {
@@ -18,7 +24,7 @@
       @include peertube-button-file(21px);
       @include button-with-icon(19px);
       @include orange-button;
-    
+
       margin-top: 10px;
       margin-bottom: 5px;
       border-radius: 50%;
index b459c591fb5340137a31ac3c2f0b35f79c628064..87e9e917c6fb6db69ec0d4e997994ba6988bf863 100644 (file)
@@ -70,4 +70,8 @@ export class ActorAvatarInfoComponent implements OnInit, OnChanges {
   hasAvatar () {
     return !!this.avatarUrl
   }
+
+  isChannel () {
+    return !!(this.actor as VideoChannel).ownerAccount
+  }
 }
index 310cc926f51ac84a4c7f050f794da84584c36972..5058f05ddebb72e7de282461a95eb6a98ed03936 100644 (file)
@@ -1,8 +1,9 @@
 <div class="wrapper" [ngClass]="'avatar-' + size">
   <ng-container *ngIf="!isChannelAvatarNull() && !genericChannel">
     <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
-      <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" />
+      <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" class="channel-avatar" />
     </a>
+
     <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">
       <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" />
     </a>
@@ -14,7 +15,7 @@
     </a>
 
     <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
-      <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" />
+      <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" class="channel-avatar" />
     </a>
   </ng-container>
 
index 37709fce6ee7d11093ca2946300cc751dc1d407c..ea7cb2cf72b3daabc7ee7bf23ae6d8c76f22bbea 100644 (file)
     position: absolute;
     top:50%;
     left:50%;
-    border-radius: 50%;
-    transform: translate(-50%,-50%)
+    transform: translate(-50%,-50%);
+
+    &:not(.channel-avatar) {
+      border-radius: 50%;
+    }
   }
 
   a:nth-of-type(2) img {
index 7a6df7b64ea690e9927da4d72693c1ecda354f2d..e5b07896f7e4878ce1cfc6f4fa9dec7844bfeb1b 100644 (file)
@@ -10,7 +10,7 @@
   <div class="video-bottom">
     <div class="video-miniature-information">
       <div class="d-inline-flex video-miniature-meta">
-        <a *ngIf="displayOptions.avatar" class="avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
+        <a *ngIf="displayOptions.avatar" class="avatar" [ngClass]="{ channel: displayOwnerVideoChannel() }" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
           <img [src]="getAvatarUrl()" alt="" />
         </a>
 
index 38cac5b6e6452493c3463133106980a86dbca3d4..cd492e9ad0b6bb1fc5daffa8574e4a364abcf354 100644 (file)
@@ -21,9 +21,13 @@ $more-margin-right: 15px;
       .avatar {
         margin: 10px 10px 0 0;
 
-        img {
+        img:not(.channel) {
           @include avatar(40px);
         }
+
+        img.channel {
+          @include channel-avatar(40px);
+        }
       }
 
       .video-miniature-name {
index cc5665ab1483cb0a0f8cd3324ad369124e64e056..f08be9c25d672a16acc41c5532301d796197f33d 100644 (file)
@@ -183,7 +183,7 @@ export class VideoMiniatureComponent implements OnInit {
   }
 
   getAvatarUrl () {
-    if (this.ownerDisplayTypeChosen === 'account') {
+    if (this.displayOwnerAccount()) {
       return this.video.accountAvatarUrl
     }
 
@@ -250,7 +250,8 @@ export class VideoMiniatureComponent implements OnInit {
       return
     }
 
-    // If the video channel name an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12)
+    // If the video channel name is an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12)
+    // Or is just a suffix of the account (default created channel)
     // -> Use the account name
     if (
       this.video.channel.name === `${this.video.account.name}_channel` ||
index 326d4677a5905d8f3d3cf59ebd9ddb62a489bcdb..457a7151cd8ba3945d82f710ff757f6409998f37 100644 (file)
@@ -136,7 +136,7 @@ $play-overlay-width: 18px;
         align-items: center;
 
         img {
-          @include avatar(28px);
+          @include channel-avatar(28px);
 
           margin-right: 8px;
         }
index 82c60a59dce9175ff57c36e9170fdc55a244f6b6..7b862a156a4f3ed343a7d393b3cb208aa7d51a08 100644 (file)
   }
 }
 
-@mixin sub-menu-with-actor {
-  position: initial;
-  z-index: unset;
-  height: max-content;
-  display: flex;
-  flex-direction: column;
-  align-items: flex-start;
-
-  .actor {
-    display: flex;
-    margin-top: 20px;
-    margin-bottom: 20px;
-
-    img {
-      @include avatar(80px);
-
-      margin-right: 20px;
-    }
-
-    .actor-info {
-      display: flex;
-      flex-direction: column;
-      justify-content: center;
-
-      .actor-names {
-        display: flex;
-        align-items: center;
-        flex-wrap: wrap;
-
-        .actor-display-name {
-          font-size: 23px;
-          font-weight: $font-bold;
-          margin-right: 7px;
-        }
-
-        .actor-name {
-          position: relative;
-          top: 3px;
-          font-size: 14px;
-          color: $grey-actor-name;
-        }
-      }
-
-      .actor-lower {
-        grid-area: lower;
-      }
-
-      .actor-followers {
-        font-size: 15px;
-      }
-
-      .actor-owner {
-        @include actor-owner;
-      }
-    }
-  }
-
-  .links {
-    margin-top: 0;
-    margin-bottom: 15px;
-
-    a {
-      margin-top: 0;
-      margin-bottom: 0;
-      text-transform: uppercase;
-      font-weight: 600;
-      font-size: 110%;
-
-      @media screen and (max-width: $mobile-view) {
-        font-size: 130%;
-      }
-    }
-
-    list-overflow {
-      display: inline-block;
-      width: max-content;
-    }
-  }
-}
-
 @mixin create-button {
   @include peertube-button-link;
   @include orange-button;