From: Chocobozzz Date: Wed, 25 Apr 2018 13:43:19 +0000 (+0200) Subject: Add video channel account list X-Git-Tag: v1.0.0-beta.4~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d3e91a5f72ac9c986cdb67d7d6c85bb4819e680c;p=oweals%2Fpeertube.git Add video channel account list --- diff --git a/client/src/app/+account/account-routing.module.ts b/client/src/app/+account/account-routing.module.ts index 534102121..f72d8373f 100644 --- a/client/src/app/+account/account-routing.module.ts +++ b/client/src/app/+account/account-routing.module.ts @@ -3,7 +3,8 @@ import { RouterModule, Routes } from '@angular/router' import { MetaGuard } from '@ngx-meta/core' import { AccountComponent } from './account.component' import { AccountVideosComponent } from './account-videos/account-videos.component' -import { AccountAboutComponent } from '@app/+account/account-about/account-about.component' +import { AccountAboutComponent } from './account-about/account-about.component' +import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' const accountRoutes: Routes = [ { @@ -25,6 +26,15 @@ const accountRoutes: Routes = [ } } }, + { + path: 'video-channels', + component: AccountVideoChannelsComponent, + data: { + meta: { + title: 'Account video channels' + } + } + }, { path: 'about', component: AccountAboutComponent, diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.html b/client/src/app/+account/account-video-channels/account-video-channels.component.html new file mode 100644 index 000000000..d20b40c60 --- /dev/null +++ b/client/src/app/+account/account-video-channels/account-video-channels.component.html @@ -0,0 +1,11 @@ +
+ + Avatar + +
{{ videoChannel.displayName }}
+
{{ videoChannel.followersCount }} subscribers
+
+
\ No newline at end of file diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.scss b/client/src/app/+account/account-video-channels/account-video-channels.component.scss new file mode 100644 index 000000000..c9c7fa8eb --- /dev/null +++ b/client/src/app/+account/account-video-channels/account-video-channels.component.scss @@ -0,0 +1,30 @@ +@import '_variables'; +@import '_mixins'; + +.row { + text-align: center; +} + +a.video-channel { + @include disable-default-a-behaviour; + + display: inline-block; + text-align: center; + color: #000; + margin: 10px 30px; + + img { + @include avatar(80px); + + margin-bottom: 10px; + } + + .video-channel-display-name { + font-size: 20px; + font-weight: $font-bold; + } + + .video-channel-followers { + font-size: 15px; + } +} \ No newline at end of file diff --git a/client/src/app/+account/account-video-channels/account-video-channels.component.ts b/client/src/app/+account/account-video-channels/account-video-channels.component.ts new file mode 100644 index 000000000..8915eb622 --- /dev/null +++ b/client/src/app/+account/account-video-channels/account-video-channels.component.ts @@ -0,0 +1,33 @@ +import { Component, OnInit } from '@angular/core' +import { ActivatedRoute } from '@angular/router' +import 'rxjs/add/observable/from' +import 'rxjs/add/operator/concatAll' +import { Account } from '@app/shared/account/account.model' +import { AccountService } from '@app/shared/account/account.service' +import { VideoChannel } from '../../../../../shared/models/videos' +import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' + +@Component({ + selector: 'my-account-video-channels', + templateUrl: './account-video-channels.component.html', + styleUrls: [ './account-video-channels.component.scss' ] +}) +export class AccountVideoChannelsComponent implements OnInit { + account: Account + videoChannels: VideoChannel[] = [] + + constructor ( + protected route: ActivatedRoute, + private accountService: AccountService, + private videoChannelService: VideoChannelService + ) { } + + ngOnInit () { + // Parent get the account for us + this.accountService.accountLoaded + .do(account => this.account = account) + .flatMap(account => this.videoChannelService.getVideoChannels(account.id)) + .map(res => res.data) + .subscribe(videoChannels => this.videoChannels = videoChannels) + } +} diff --git a/client/src/app/+account/account.component.html b/client/src/app/+account/account.component.html index f875b37a4..d0e99edda 100644 --- a/client/src/app/+account/account.component.html +++ b/client/src/app/+account/account.component.html @@ -2,7 +2,7 @@