diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-main/account/avatar.component.html | 30 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/account/avatar.component.ts | 5 |
2 files changed, 29 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-main/account/avatar.component.html b/client/src/app/shared/shared-main/account/avatar.component.html index 09871fca4..310cc926f 100644 --- a/client/src/app/shared/shared-main/account/avatar.component.html +++ b/client/src/app/shared/shared-main/account/avatar.component.html | |||
@@ -1,8 +1,26 @@ | |||
1 | <div class="wrapper" [ngClass]="'avatar-' + size"> | 1 | <div class="wrapper" [ngClass]="'avatar-' + size"> |
2 | <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"> | 2 | <ng-container *ngIf="!isChannelAvatarNull() && !genericChannel"> |
3 | <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" /> | 3 | <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"> |
4 | </a> | 4 | <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" /> |
5 | <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle"> | 5 | </a> |
6 | <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" /> | 6 | <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle"> |
7 | </a> | 7 | <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" /> |
8 | </a> | ||
9 | </ng-container> | ||
10 | |||
11 | <ng-container *ngIf="!isChannelAvatarNull() && genericChannel"> | ||
12 | <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle"> | ||
13 | <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" /> | ||
14 | </a> | ||
15 | |||
16 | <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"> | ||
17 | <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" /> | ||
18 | </a> | ||
19 | </ng-container> | ||
20 | |||
21 | <ng-container *ngIf="isChannelAvatarNull()"> | ||
22 | <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle"> | ||
23 | <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" /> | ||
24 | </a> | ||
25 | </ng-container> | ||
8 | </div> | 26 | </div> |
diff --git a/client/src/app/shared/shared-main/account/avatar.component.ts b/client/src/app/shared/shared-main/account/avatar.component.ts index 31f39c200..73c145ef9 100644 --- a/client/src/app/shared/shared-main/account/avatar.component.ts +++ b/client/src/app/shared/shared-main/account/avatar.component.ts | |||
@@ -10,6 +10,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill' | |||
10 | export class AvatarComponent implements OnInit { | 10 | export class AvatarComponent implements OnInit { |
11 | @Input() video: Video | 11 | @Input() video: Video |
12 | @Input() size: 'md' | 'sm' = 'md' | 12 | @Input() size: 'md' | 'sm' = 'md' |
13 | @Input() genericChannel: boolean | ||
13 | 14 | ||
14 | channelLinkTitle = '' | 15 | channelLinkTitle = '' |
15 | accountLinkTitle = '' | 16 | accountLinkTitle = '' |
@@ -28,4 +29,8 @@ export class AvatarComponent implements OnInit { | |||
28 | { name: this.video.account.name, handle: this.video.byAccount } | 29 | { name: this.video.account.name, handle: this.video.byAccount } |
29 | ) | 30 | ) |
30 | } | 31 | } |
32 | |||
33 | isChannelAvatarNull () { | ||
34 | return this.video.channel.avatar === null | ||
35 | } | ||
31 | } | 36 | } |