From 7399a79f73cc2015e64fad49361439a322ee1d3b Mon Sep 17 00:00:00 2001
From: kontrollanten <6680299+kontrollanten@users.noreply.github.com>
Date: Tue, 12 Oct 2021 14:23:44 +0200
Subject: add option to always show channel display name (#4422)
* add option to always show channel display name
closes #4040
* show avatar in video miniatures
closes #4040
* Revert "show avatar in video miniatures"
This reverts commit 79b1a84140857fc24f7e2233e838d012f72bc56f.
* channel display name: fix review comments
---
.../metadata/video-avatar-channel.component.html | 19 ++++++++++++++-----
.../metadata/video-avatar-channel.component.scss | 20 ++++----------------
.../metadata/video-avatar-channel.component.ts | 3 ++-
.../+videos/+video-watch/video-watch.component.html | 2 +-
.../video-miniature.component.html | 4 ++--
.../video-miniature.component.ts | 8 ++++++++
6 files changed, 31 insertions(+), 25 deletions(-)
(limited to 'client/src/app')
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.html b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.html
index 5a7221858..d433c7aba 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.html
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.html
@@ -1,11 +1,20 @@
-
+
+ *ngIf="showAccount"
+ class="account"
+ [class.main-avatar]="!showChannel"
+ [class.second-avatar]="showChannel"
+ [account]="video.account"
+ [internalHref]="[ '/a', video.byAccount ]"
+ [title]="accountLinkTitle">
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.scss b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.scss
index 1ff8fb96e..71c5e4b5a 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.scss
@@ -20,23 +20,11 @@
position: relative;
margin-bottom: 5px;
- &.generic-channel {
- .account {
- @include main();
- }
-
- .channel {
- display: none !important;
- }
+ .main-avatar {
+ @include main();
}
- &:not(.generic-channel) {
- .account {
- @include secondary();
- }
-
- .channel {
- @include main();
- }
+ .second-avatar {
+ @include secondary();
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.ts
index 63edd7bad..146c440b3 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.ts
@@ -10,7 +10,8 @@ export class VideoAvatarChannelComponent implements OnInit {
@Input() video: Video
@Input() byAccount: string
- @Input() genericChannel: boolean
+ @Input() showAccount: boolean
+ @Input() showChannel: boolean
channelLinkTitle = ''
accountLinkTitle = ''
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html
index 45cfba167..df74a818b 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.html
+++ b/client/src/app/+videos/+video-watch/video-watch.component.html
@@ -60,7 +60,7 @@
-
+
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index f51c298f2..b12495f90 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -39,10 +39,10 @@
- {{ video.byAccount }}
+ {{ authorAccount }}
- {{ video.byVideoChannel }}
+ {{ authorChannel }}
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
index cb81ba3bd..69f00fb10 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
@@ -100,6 +100,14 @@ export class VideoMiniatureComponent implements OnInit {
@Inject(LOCALE_ID) private localeId: string
) {}
+ get authorAccount () {
+ return this.serverConfig.client.videos.miniature.showAuthorDisplayName ? this.video.account.displayName : this.video.byAccount
+ }
+
+ get authorChannel () {
+ return this.serverConfig.client.videos.miniature.showAuthorDisplayName ? this.video.channel.displayName : this.video.byVideoChannel
+ }
+
get isVideoBlur () {
return this.video.isVideoNSFWForUser(this.user, this.serverConfig)
}
--
cgit v1.2.3