diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-15 13:50:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-15 13:50:40 +0100 |
commit | 343d1395df2e07ea9eb3540724c9fd689e617cb8 (patch) | |
tree | acd553f76c1daab05f4cf44c66234467c5ea9b36 /client/src/app/shared/shared-video-playlist | |
parent | 72c98d189ef7b18264a7f715d7a58910eba29a1c (diff) | |
download | PeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.tar.gz PeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.tar.zst PeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.zip |
Prefer displaying channel for playlist element
Diffstat (limited to 'client/src/app/shared/shared-video-playlist')
3 files changed, 12 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html index f58d5f7f6..40c58166d 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html | |||
@@ -32,9 +32,11 @@ | |||
32 | </span> | 32 | </span> |
33 | </span> | 33 | </span> |
34 | 34 | ||
35 | <a *ngIf="accountLink" tabindex="-1" class="video-info-account" [routerLink]="[ '/a', playlistElement.video.byAccount ]"> | 35 | <a *ngIf="accountLink" tabindex="-1" class="video-info-owner" [routerLink]="[ '/c', playlistElement.video.byVideoChannel ]"> |
36 | {{ playlistElement.video.byAccount }} | 36 | <ng-container *ngIf="getVideoOwnerDisplayType(playlistElement) === 'account'">{{ playlistElement.video.byAccount }}</ng-container> |
37 | <ng-container *ngIf="getVideoOwnerDisplayType(playlistElement) === 'videoChannel'">{{ playlistElement.video.byVideoChannel }}</ng-container> | ||
37 | </a> | 38 | </a> |
39 | |||
38 | <span *ngIf="!accountLink" tabindex="-1" class="video-info-account">{{ playlistElement.video.byAccount }}</span> | 40 | <span *ngIf="!accountLink" tabindex="-1" class="video-info-account">{{ playlistElement.video.byAccount }}</span> |
39 | 41 | ||
40 | <span tabindex="-1" class="video-info-timestamp">{{ formatTimestamp(playlistElement) }}</span> | 42 | <span tabindex="-1" class="video-info-timestamp">{{ formatTimestamp(playlistElement) }}</span> |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss index e6b01d33d..0f085231c 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss | |||
@@ -133,13 +133,13 @@ my-video-thumbnail, | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | .video-info-account, | 136 | .video-info-owner, |
137 | .video-info-timestamp { | 137 | .video-info-timestamp { |
138 | color: pvar(--greyForegroundColor); | 138 | color: pvar(--greyForegroundColor); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | .video-info-account, | 142 | .video-info-owner, |
143 | .video-miniature-created-at-views { | 143 | .video-miniature-created-at-views { |
144 | font-size: 14px; | 144 | font-size: 14px; |
145 | } | 145 | } |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index 79b7b9a50..552ea742b 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { AuthService, Notifier, ServerService } from '@app/core' | 2 | import { AuthService, Notifier, ServerService } from '@app/core' |
3 | import { Video } from '@app/shared/shared-main' | 3 | import { Video, VideoService } from '@app/shared/shared-main' |
4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
5 | import { secondsToTime } from '@shared/core-utils' | 5 | import { secondsToTime } from '@shared/core-utils' |
6 | import { HTMLServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate, VideoPrivacy } from '@shared/models' | 6 | import { HTMLServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate, VideoPrivacy } from '@shared/models' |
@@ -44,6 +44,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
44 | private serverService: ServerService, | 44 | private serverService: ServerService, |
45 | private notifier: Notifier, | 45 | private notifier: Notifier, |
46 | private videoPlaylistService: VideoPlaylistService, | 46 | private videoPlaylistService: VideoPlaylistService, |
47 | private videoService: VideoService, | ||
47 | private cdr: ChangeDetectorRef | 48 | private cdr: ChangeDetectorRef |
48 | ) {} | 49 | ) {} |
49 | 50 | ||
@@ -51,6 +52,10 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
51 | this.serverConfig = this.serverService.getHTMLConfig() | 52 | this.serverConfig = this.serverService.getHTMLConfig() |
52 | } | 53 | } |
53 | 54 | ||
55 | getVideoOwnerDisplayType (element: VideoPlaylistElement) { | ||
56 | return this.videoService.buildDefaultOwnerDisplayType(element.video) | ||
57 | } | ||
58 | |||
54 | isVideoPrivate () { | 59 | isVideoPrivate () { |
55 | return this.playlistElement.video.privacy.id === VideoPrivacy.PRIVATE | 60 | return this.playlistElement.video.privacy.id === VideoPrivacy.PRIVATE |
56 | } | 61 | } |