aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-10-12 14:23:44 +0200
committerGitHub <noreply@github.com>2021-10-12 14:23:44 +0200
commit7399a79f73cc2015e64fad49361439a322ee1d3b (patch)
tree134903063dbc66e5f3b12cc59669d061403bdde1 /client/src/app
parent10ef089102f2225c5ec3ed426bc612e4f2bc8655 (diff)
downloadPeerTube-7399a79f73cc2015e64fad49361439a322ee1d3b.tar.gz
PeerTube-7399a79f73cc2015e64fad49361439a322ee1d3b.tar.zst
PeerTube-7399a79f73cc2015e64fad49361439a322ee1d3b.zip
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
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.html19
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.scss20
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-avatar-channel.component.ts3
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.html2
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.html4
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.ts8
6 files changed, 31 insertions, 25 deletions
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 @@
1<div class="wrapper" [ngClass]="{ 'generic-channel': genericChannel }"> 1<div class="wrapper">
2 <my-actor-avatar 2 <my-actor-avatar
3 class="channel" [channel]="video.channel" 3 *ngIf="showChannel"
4 [internalHref]="[ '/c', video.byVideoChannel ]" [title]="channelLinkTitle" 4 class="channel"
5 [class.main-avatar]="showChannel"
6 [channel]="video.channel"
7 [internalHref]="[ '/c', video.byVideoChannel ]"
8 [title]="channelLinkTitle"
5 ></my-actor-avatar> 9 ></my-actor-avatar>
6 10
7 <my-actor-avatar 11 <my-actor-avatar
8 class="account" [account]="video.account" 12 *ngIf="showAccount"
9 [internalHref]="[ '/a', video.byAccount ]" [title]="accountLinkTitle"> 13 class="account"
14 [class.main-avatar]="!showChannel"
15 [class.second-avatar]="showChannel"
16 [account]="video.account"
17 [internalHref]="[ '/a', video.byAccount ]"
18 [title]="accountLinkTitle">
10 </my-actor-avatar> 19 </my-actor-avatar>
11</div> 20</div>
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 @@
20 position: relative; 20 position: relative;
21 margin-bottom: 5px; 21 margin-bottom: 5px;
22 22
23 &.generic-channel { 23 .main-avatar {
24 .account { 24 @include main();
25 @include main();
26 }
27
28 .channel {
29 display: none !important;
30 }
31 } 25 }
32 26
33 &:not(.generic-channel) { 27 .second-avatar {
34 .account { 28 @include secondary();
35 @include secondary();
36 }
37
38 .channel {
39 @include main();
40 }
41 } 29 }
42} 30}
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 {
10 @Input() video: Video 10 @Input() video: Video
11 @Input() byAccount: string 11 @Input() byAccount: string
12 12
13 @Input() genericChannel: boolean 13 @Input() showAccount: boolean
14 @Input() showChannel: boolean
14 15
15 channelLinkTitle = '' 16 channelLinkTitle = ''
16 accountLinkTitle = '' 17 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 @@
60 60
61 <div class="pt-3 border-top video-info-channel d-flex"> 61 <div class="pt-3 border-top video-info-channel d-flex">
62 <div class="video-info-channel-left d-flex"> 62 <div class="video-info-channel-left d-flex">
63 <my-video-avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></my-video-avatar-channel> 63 <my-video-avatar-channel [video]="video" [showChannel]="!isChannelDisplayNameGeneric()"></my-video-avatar-channel>
64 64
65 <div class="video-info-channel-left-links ml-1"> 65 <div class="video-info-channel-left-links ml-1">
66 <ng-container *ngIf="!isChannelDisplayNameGeneric()"> 66 <ng-container *ngIf="!isChannelDisplayNameGeneric()">
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 @@
39 </span> 39 </span>
40 40
41 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]"> 41 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
42 {{ video.byAccount }} 42 {{ authorAccount }}
43 </a> 43 </a>
44 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerVideoChannel()" class="video-miniature-channel" [routerLink]="[ '/c', video.byVideoChannel ]"> 44 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerVideoChannel()" class="video-miniature-channel" [routerLink]="[ '/c', video.byVideoChannel ]">
45 {{ video.byVideoChannel }} 45 {{ authorChannel }}
46 </a> 46 </a>
47 47
48 <div class="video-info-privacy"> 48 <div class="video-info-privacy">
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 {
100 @Inject(LOCALE_ID) private localeId: string 100 @Inject(LOCALE_ID) private localeId: string
101 ) {} 101 ) {}
102 102
103 get authorAccount () {
104 return this.serverConfig.client.videos.miniature.showAuthorDisplayName ? this.video.account.displayName : this.video.byAccount
105 }
106
107 get authorChannel () {
108 return this.serverConfig.client.videos.miniature.showAuthorDisplayName ? this.video.channel.displayName : this.video.byVideoChannel
109 }
110
103 get isVideoBlur () { 111 get isVideoBlur () {
104 return this.video.isVideoNSFWForUser(this.user, this.serverConfig) 112 return this.video.isVideoNSFWForUser(this.user, this.serverConfig)
105 } 113 }