Add owner in video channel page
This commit is contained in:
parent
b851dabf78
commit
a4f99a766b
5 changed files with 44 additions and 20 deletions
|
@ -9,6 +9,11 @@
|
||||||
<div class="actor-display-name">{{ videoChannel.displayName }}</div>
|
<div class="actor-display-name">{{ videoChannel.displayName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="actor-followers">{{ videoChannel.followersCount }} subscribers</div>
|
<div class="actor-followers">{{ videoChannel.followersCount }} subscribers</div>
|
||||||
|
|
||||||
|
<a [routerLink]="[ '/accounts', videoChannel.ownerAccount.id ]" title="Go the owner account page" class="actor-owner">
|
||||||
|
<span>Created by {{ videoChannel.ownerBy }}</span>
|
||||||
|
<img [src]="videoChannel.ownerAvatarUrl" alt="Owner account avatar" />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos/video-channel.model'
|
import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos/video-channel.model'
|
||||||
import { Actor } from '../actor/actor.model'
|
import { Actor } from '../actor/actor.model'
|
||||||
|
import { Account } from '../../../../../shared/models/actors'
|
||||||
|
|
||||||
export class VideoChannel extends Actor implements ServerVideoChannel {
|
export class VideoChannel extends Actor implements ServerVideoChannel {
|
||||||
displayName: string
|
displayName: string
|
||||||
description: string
|
description: string
|
||||||
support: string
|
support: string
|
||||||
isLocal: boolean
|
isLocal: boolean
|
||||||
ownerAccount?: {
|
ownerAccount?: Account
|
||||||
id: number
|
ownerBy?: string
|
||||||
uuid: string
|
ownerAvatarUrl?: string
|
||||||
}
|
|
||||||
|
|
||||||
constructor (hash: ServerVideoChannel) {
|
constructor (hash: ServerVideoChannel) {
|
||||||
super(hash)
|
super(hash)
|
||||||
|
@ -18,6 +18,11 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
|
||||||
this.description = hash.description
|
this.description = hash.description
|
||||||
this.support = hash.support
|
this.support = hash.support
|
||||||
this.isLocal = hash.isLocal
|
this.isLocal = hash.isLocal
|
||||||
this.ownerAccount = hash.ownerAccount
|
|
||||||
|
if (hash.ownerAccount) {
|
||||||
|
this.ownerAccount = hash.ownerAccount
|
||||||
|
this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
|
||||||
|
this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
border: 5px solid rgba(0, 0, 0, 0);
|
border: 5px solid rgba(0, 0, 0, 0);
|
||||||
border-top-color: #000000;
|
border-top-color: #000;
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@
|
||||||
|
|
||||||
@mixin avatar ($size) {
|
@mixin avatar ($size) {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius:50%;
|
border-radius: 50%;
|
||||||
width: $size;
|
width: $size;
|
||||||
height: $size;
|
height: $size;
|
||||||
}
|
}
|
||||||
|
@ -365,6 +365,27 @@
|
||||||
.actor-followers {
|
.actor-followers {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actor-owner {
|
||||||
|
@include disable-default-a-behaviour;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-top: 4px;
|
||||||
|
color: #000;
|
||||||
|
|
||||||
|
span:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
@include avatar(18px);
|
||||||
|
|
||||||
|
margin-left: 7px;
|
||||||
|
position: relative;
|
||||||
|
top: -2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,4 +410,4 @@
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
background-image: url('/assets/images/admin/add.svg');
|
background-image: url('/assets/images/admin/add.svg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,11 @@ enum ScopeNames {
|
||||||
[ScopeNames.WITH_ACCOUNT]: {
|
[ScopeNames.WITH_ACCOUNT]: {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: () => AccountModel,
|
model: () => AccountModel.unscoped(),
|
||||||
required: true,
|
required: true,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: () => ActorModel,
|
model: () => ActorModel.unscoped(),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -247,12 +247,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
|
||||||
videos: undefined
|
videos: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Account) {
|
if (this.Account) videoChannel.ownerAccount = this.Account.toFormattedJSON()
|
||||||
videoChannel.ownerAccount = {
|
|
||||||
id: this.Account.id,
|
|
||||||
uuid: this.Account.Actor.uuid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Object.assign(actor, videoChannel)
|
return Object.assign(actor, videoChannel)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import { Actor } from '../actors/actor.model'
|
import { Actor } from '../actors/actor.model'
|
||||||
import { Video } from './video.model'
|
import { Video } from './video.model'
|
||||||
|
import { Account } from '../actors'
|
||||||
|
|
||||||
export interface VideoChannel extends Actor {
|
export interface VideoChannel extends Actor {
|
||||||
displayName: string
|
displayName: string
|
||||||
description: string
|
description: string
|
||||||
support: string
|
support: string
|
||||||
isLocal: boolean
|
isLocal: boolean
|
||||||
ownerAccount?: {
|
ownerAccount?: Account
|
||||||
id: number
|
|
||||||
uuid: string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue