]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add channel avatar to overviews
authorChocobozzz <me@florianbigard.com>
Fri, 31 Aug 2018 12:26:51 +0000 (14:26 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 31 Aug 2018 12:32:37 +0000 (14:32 +0200)
client/src/app/videos/video-list/video-overview.component.html
client/src/app/videos/video-list/video-overview.component.scss
client/src/app/videos/video-list/video-overview.component.ts
server/initializers/constants.ts

index 9282dd59c03f79c4a69fe6dbe0511c7217b0ae85..84a4c70ee315d9c70f42c95ce7ba02fcb02e5280 100644 (file)
     </div>
   </div>
 
-  <div class="section" *ngFor="let object of overview.channels">
+  <div class="section channel" *ngFor="let object of overview.channels">
     <div class="section-title" i18n>
-      <a [routerLink]="[ '/video-channels', buildVideoChannelBy(object) ]">Channel {{ object.channel.displayName }}</a>
+      <a [routerLink]="[ '/video-channels', buildVideoChannelBy(object) ]">
+        <img [src]="buildVideoChannelAvatarUrl(object)" alt="Avatar" />
+
+        <div>{{ object.channel.displayName }}</div>
+      </a>
     </div>
 
     <div>
index 8d66cf80a003a969ff038bc15d9f4fdf34e4b66a..73b6d2e53cf7042ab9cf6b56a7008d770639bb87 100644 (file)
 
     color: #000;
   }
+}
+
+.channel {
+  .section-title a {
+    display: flex;
+    width: fit-content;
+    align-items: center;
+
+    img {
+      @include avatar(30px);
+
+      margin-right: 10px;
+    }
+  }
 }
\ No newline at end of file
index c758e115c2478653d28a8589db0696e65a53c8df..2c6054721315d3d66fb3776156187dd1997e3dd8 100644 (file)
@@ -53,4 +53,8 @@ export class VideoOverviewComponent implements OnInit {
   buildVideoChannelBy (object: { videos: Video[] }) {
     return object.videos[0].byVideoChannel
   }
+
+  buildVideoChannelAvatarUrl (object: { videos: Video[] }) {
+    return object.videos[0].videoChannelAvatarUrl
+  }
 }
index 536d99713c2d5602bbd624f2ab52936b421a4ea1..6d0503f48df2a4d508abfa6e417d2f8327a2e35c 100644 (file)
@@ -473,7 +473,7 @@ const TORRENT_MIMETYPE_EXT = {
 
 const OVERVIEWS = {
   VIDEOS: {
-    SAMPLE_THRESHOLD: 4,
+    SAMPLE_THRESHOLD: 6,
     SAMPLES_COUNT: 2
   }
 }