mirror of https://github.com/Chocobozzz/PeerTube
parent
4d3e611dd2
commit
46ed55544c
|
@ -1,11 +1,20 @@
|
|||
<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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -60,19 +60,19 @@
|
|||
|
||||
<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" [showAccount]="!onlyShowAuthorChannel" [showChannel]="!isChannelDisplayNameGeneric() || onlyShowAuthorChannel"></my-video-avatar-channel>
|
||||
|
||||
<div class="video-info-channel-left-links ml-1">
|
||||
<ng-container *ngIf="!isChannelDisplayNameGeneric()">
|
||||
<a [routerLink]="[ '/c', video.byVideoChannel ]" i18n-title title="Channel page">
|
||||
<ng-container *ngIf="!isChannelDisplayNameGeneric() || onlyShowAuthorChannel">
|
||||
<a [routerLink]="[ '/c', video.byVideoChannel ]" i18n-title title="Channel page" [class.single-link]="onlyShowAuthorChannel">
|
||||
{{ video.channel.displayName }}
|
||||
</a>
|
||||
<a [routerLink]="[ '/a', video.byAccount ]" i18n-title title="Account page">
|
||||
<a [routerLink]="[ '/a', video.byAccount ]" i18n-title title="Account page" *ngIf="!onlyShowAuthorChannel">
|
||||
<span i18n>By {{ video.byAccount }}</span>
|
||||
</a>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isChannelDisplayNameGeneric()">
|
||||
<ng-container *ngIf="isChannelDisplayNameGeneric() && !onlyShowAuthorChannel">
|
||||
<a [routerLink]="[ '/a', video.byAccount ]" class="single-link" i18n-title title="Account page">
|
||||
<span i18n>{{ video.byAccount }}</span>
|
||||
</a>
|
||||
|
|
|
@ -67,6 +67,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
|
||||
remoteServerDown = false
|
||||
|
||||
onlyShowAuthorChannel: boolean
|
||||
|
||||
private nextVideoUUID = ''
|
||||
private nextVideoTitle = ''
|
||||
|
||||
|
@ -116,6 +118,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
ngOnInit () {
|
||||
this.serverConfig = this.serverService.getHTMLConfig()
|
||||
|
||||
this.onlyShowAuthorChannel = this.serverConfig.instance.onlyShowAuthorChannel
|
||||
|
||||
PeertubePlayerManager.initState()
|
||||
|
||||
this.loadRouteParams()
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
</span>
|
||||
|
||||
<a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
|
||||
{{ video.byAccount }}
|
||||
{{ serverConfig.instance.showAuthorDisplayNameInMiniatures ? video.account.displayName : video.byAccount }}
|
||||
</a>
|
||||
<a tabindex="-1" *ngIf="displayOptions.by && displayOwnerVideoChannel()" class="video-miniature-channel" [routerLink]="[ '/c', video.byVideoChannel ]">
|
||||
{{ video.byVideoChannel }}
|
||||
{{ serverConfig.instance.showAuthorDisplayNameInMiniatures ? video.channel.displayName : video.byVideoChannel }}
|
||||
</a>
|
||||
|
||||
<div class="video-info-privacy">
|
||||
|
|
|
@ -240,6 +240,11 @@ export class VideoMiniatureComponent implements OnInit {
|
|||
}
|
||||
|
||||
private setUpBy () {
|
||||
if (this.serverConfig.instance.onlyShowAuthorChannel === true) {
|
||||
this.ownerDisplayType = 'videoChannel'
|
||||
return
|
||||
}
|
||||
|
||||
const accountName = this.video.account.name
|
||||
|
||||
// If the video channel name is an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12)
|
||||
|
|
|
@ -399,6 +399,9 @@ instance:
|
|||
terms: 'No terms for now.' # Support markdown
|
||||
code_of_conduct: '' # Supports markdown
|
||||
|
||||
only_show_channel_author: false
|
||||
show_author_display_name_in_miniatures: false
|
||||
|
||||
# Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc
|
||||
moderation_information: '' # Supports markdown
|
||||
|
||||
|
|
|
@ -409,6 +409,9 @@ instance:
|
|||
terms: 'No terms for now.' # Support markdown
|
||||
code_of_conduct: '' # Supports markdown
|
||||
|
||||
only_show_channel_author: false
|
||||
show_author_display_name_in_miniatures: false
|
||||
|
||||
# Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc
|
||||
moderation_information: '' # Supports markdown
|
||||
|
||||
|
|
|
@ -334,7 +334,10 @@ const CONFIG = {
|
|||
},
|
||||
get ROBOTS () { return config.get<string>('instance.robots') },
|
||||
get SECURITYTXT () { return config.get<string>('instance.securitytxt') },
|
||||
get SECURITYTXT_CONTACT () { return config.get<string>('admin.email') }
|
||||
get SECURITYTXT_CONTACT () { return config.get<string>('admin.email') },
|
||||
|
||||
get ONLY_SHOW_CHANNEL_AUTHOR () { return config.get<boolean>('instance.only_show_channel_author') },
|
||||
get SHOW_AUTHOR_DISPLAY_NAME_IN_MINIATURES () { return config.get<boolean>('instance.show_author_display_name_in_miniatures') }
|
||||
},
|
||||
SERVICES: {
|
||||
TWITTER: {
|
||||
|
|
|
@ -51,7 +51,9 @@ class ServerConfigManager {
|
|||
customizations: {
|
||||
javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT,
|
||||
css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS
|
||||
}
|
||||
},
|
||||
onlyShowAuthorChannel: CONFIG.INSTANCE.ONLY_SHOW_CHANNEL_AUTHOR,
|
||||
showAuthorDisplayNameInMiniatures: CONFIG.INSTANCE.SHOW_AUTHOR_DISPLAY_NAME_IN_MINIATURES
|
||||
},
|
||||
search: {
|
||||
remoteUri: {
|
||||
|
|
|
@ -43,6 +43,8 @@ export interface ServerConfig {
|
|||
javascript: string
|
||||
css: string
|
||||
}
|
||||
onlyShowAuthorChannel: boolean
|
||||
showAuthorDisplayNameInMiniatures: boolean
|
||||
}
|
||||
|
||||
search: {
|
||||
|
|
Loading…
Reference in New Issue