* 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
-<div class="wrapper" [ngClass]="{ 'generic-channel': genericChannel }">
+<div class="wrapper">
<my-actor-avatar
- class="channel" [channel]="video.channel"
- [internalHref]="[ '/c', video.byVideoChannel ]" [title]="channelLinkTitle"
+ *ngIf="showChannel"
+ class="channel"
+ [class.main-avatar]="showChannel"
+ [channel]="video.channel"
+ [internalHref]="[ '/c', video.byVideoChannel ]"
+ [title]="channelLinkTitle"
></my-actor-avatar>
<my-actor-avatar
- class="account" [account]="video.account"
- [internalHref]="[ '/a', video.byAccount ]" [title]="accountLinkTitle">
+ *ngIf="showAccount"
+ class="account"
+ [class.main-avatar]="!showChannel"
+ [class.second-avatar]="showChannel"
+ [account]="video.account"
+ [internalHref]="[ '/a', video.byAccount ]"
+ [title]="accountLinkTitle">
</my-actor-avatar>
</div>
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();
}
}
@Input() video: Video
@Input() byAccount: string
- @Input() genericChannel: boolean
+ @Input() showAccount: boolean
+ @Input() showChannel: boolean
channelLinkTitle = ''
accountLinkTitle = ''
<div class="pt-3 border-top video-info-channel d-flex">
<div class="video-info-channel-left d-flex">
- <my-video-avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></my-video-avatar-channel>
+ <my-video-avatar-channel [video]="video" [showChannel]="!isChannelDisplayNameGeneric()"></my-video-avatar-channel>
<div class="video-info-channel-left-links ml-1">
<ng-container *ngIf="!isChannelDisplayNameGeneric()">
</span>
<a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
- {{ video.byAccount }}
+ {{ authorAccount }}
</a>
<a tabindex="-1" *ngIf="displayOptions.by && displayOwnerVideoChannel()" class="video-miniature-channel" [routerLink]="[ '/c', video.byVideoChannel ]">
- {{ video.byVideoChannel }}
+ {{ authorChannel }}
</a>
<div class="video-info-privacy">
@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)
}
subject:
prefix: "[PeerTube]"
+client:
+ videos:
+ miniature:
+ show_author_display_name: false
+
# From the project root directory
storage:
tmp: 'storage/tmp/' # Use to download data (imports etc), store uploaded files before and during processing...
subject:
prefix: "[PeerTube]"
+client:
+ videos:
+ miniature:
+ show_author_display_name: false
+
# From the project root directory
storage:
tmp: '/var/www/peertube/storage/tmp/' # Use to download data (imports etc), store uploaded files before and during processing...
PREFIX: config.get<string>('email.subject.prefix') + ' '
}
},
+
+ CLIENT: {
+ VIDEOS: {
+ MINIATURE: {
+ get SHOW_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.show_author_display_name') }
+ }
+ }
+ },
+
STORAGE: {
TMP_DIR: buildPath(config.get<string>('storage.tmp')),
ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')),
return {
allowEdits: CONFIG.WEBADMIN.CONFIGURATION.EDITS.ALLOWED,
+ client: {
+ videos: {
+ miniature: {
+ showAuthorDisplayName: CONFIG.CLIENT.VIDEOS.MINIATURE.SHOW_AUTHOR_DISPLAY_NAME
+ }
+ }
+ },
instance: {
name: CONFIG.INSTANCE.NAME,
shortDescription: CONFIG.INSTANCE.SHORT_DESCRIPTION,
serverVersion: string
serverCommit?: string
+ client: {
+ videos: {
+ miniature: {
+ showAuthorDisplayName: boolean
+ }
+ }
+ }
+
instance: {
name: string
shortDescription: string