aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-video-channels
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 16:56:13 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 16:56:13 +0200
commit170726f523ff48f89da45473fc53ca54784f43dd (patch)
treef9f783ebdfc934c6831396c2bf33f658d6640583 /client/src/app/+accounts/account-video-channels
parentcc918ac3f45e32f031cce7b6e0473e5c2c34b8ae (diff)
downloadPeerTube-170726f523ff48f89da45473fc53ca54784f43dd.tar.gz
PeerTube-170726f523ff48f89da45473fc53ca54784f43dd.tar.zst
PeerTube-170726f523ff48f89da45473fc53ca54784f43dd.zip
Implement video channel views
Diffstat (limited to 'client/src/app/+accounts/account-video-channels')
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.html11
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.scss30
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.ts33
3 files changed, 74 insertions, 0 deletions
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html
new file mode 100644
index 000000000..d20b40c60
--- /dev/null
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html
@@ -0,0 +1,11 @@
1<div *ngIf="account" class="row">
2 <a
3 *ngFor="let videoChannel of videoChannels" [routerLink]="[ '/video-channels', videoChannel.uuid ]"
4 class="video-channel" title="See this video channel"
5 >
6 <img [src]="videoChannel.avatarUrl" alt="Avatar" />
7
8 <div class="video-channel-display-name">{{ videoChannel.displayName }}</div>
9 <div class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div>
10 </a>
11</div> \ No newline at end of file
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss b/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
new file mode 100644
index 000000000..c9c7fa8eb
--- /dev/null
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
@@ -0,0 +1,30 @@
1@import '_variables';
2@import '_mixins';
3
4.row {
5 text-align: center;
6}
7
8a.video-channel {
9 @include disable-default-a-behaviour;
10
11 display: inline-block;
12 text-align: center;
13 color: #000;
14 margin: 10px 30px;
15
16 img {
17 @include avatar(80px);
18
19 margin-bottom: 10px;
20 }
21
22 .video-channel-display-name {
23 font-size: 20px;
24 font-weight: $font-bold;
25 }
26
27 .video-channel-followers {
28 font-size: 15px;
29 }
30} \ No newline at end of file
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
new file mode 100644
index 000000000..4c5782f9d
--- /dev/null
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
@@ -0,0 +1,33 @@
1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router'
3import 'rxjs/add/observable/from'
4import 'rxjs/add/operator/concatAll'
5import { Account } from '@app/shared/account/account.model'
6import { AccountService } from '@app/shared/account/account.service'
7import { VideoChannel } from '../../../../../shared/models/videos'
8import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
9
10@Component({
11 selector: 'my-account-video-channels',
12 templateUrl: './account-video-channels.component.html',
13 styleUrls: [ './account-video-channels.component.scss' ]
14})
15export class AccountVideoChannelsComponent implements OnInit {
16 account: Account
17 videoChannels: VideoChannel[] = []
18
19 constructor (
20 protected route: ActivatedRoute,
21 private accountService: AccountService,
22 private videoChannelService: VideoChannelService
23 ) { }
24
25 ngOnInit () {
26 // Parent get the account for us
27 this.accountService.accountLoaded
28 .do(account => this.account = account)
29 .flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id))
30 .map(res => res.data)
31 .subscribe(videoChannels => this.videoChannels = videoChannels)
32 }
33}