X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideo-channels%2Fvideo-channels.component.ts;h=41fdb5e799e2f44fa9a5c11fa1e31a900924be29;hb=0a25749f14a083d2c388b6229cbdbba695d0387e;hp=037c108f2c4ebee6141e867931ababe38a233580;hpb=60c35932f6a14cfe83bb0e54407427cce70171ea;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts index 037c108f2..41fdb5e79 100644 --- a/client/src/app/+video-channels/video-channels.component.ts +++ b/client/src/app/+video-channels/video-channels.component.ts @@ -5,6 +5,7 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { AuthService, MarkdownService, Notifier, RestExtractor, ScreenService } from '@app/core' import { ListOverflowItem, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' +import { SupportModalComponent } from '@app/shared/shared-support-modal' import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' @@ -14,6 +15,7 @@ import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' }) export class VideoChannelsComponent implements OnInit, OnDestroy { @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent + @ViewChild('supportModal') supportModal: SupportModalComponent videoChannel: VideoChannel hotkeys: Hotkey[] @@ -72,7 +74,7 @@ export class VideoChannelsComponent implements OnInit, OnDestroy { this.links = [ { label: $localize`VIDEOS`, routerLink: 'videos' }, - { label: $localize`VIDEO PLAYLISTS`, routerLink: 'video-playlists' } + { label: $localize`PLAYLISTS`, routerLink: 'video-playlists' } ] } @@ -94,13 +96,25 @@ export class VideoChannelsComponent implements OnInit, OnDestroy { isManageable () { if (!this.isUserLoggedIn()) return false - return this.videoChannel.ownerAccount.userId === this.authService.getUser().id + return this.videoChannel?.ownerAccount.userId === this.authService.getUser().id } activateCopiedMessage () { this.notifier.success($localize`Username copied`) } + hasShowMoreDescription () { + return !this.channelDescriptionExpanded && this.channelDescriptionHTML.length > 100 + } + + showSupportModal () { + this.supportModal.show() + } + + getAccountUrl () { + return [ '/accounts', this.videoChannel.ownerBy ] + } + private loadChannelVideosCount () { this.videoService.getVideoChannelVideos({ videoChannel: this.videoChannel,