diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-subscriptions')
3 files changed, 102 insertions, 0 deletions
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html new file mode 100644 index 000000000..4c68cd1a5 --- /dev/null +++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html | |||
@@ -0,0 +1,23 @@ | |||
1 | <div class="video-channels"> | ||
2 | <div *ngFor="let videoChannel of videoChannels" class="video-channel"> | ||
3 | <a [routerLink]="[ '/video-channels', videoChannel.name ]"> | ||
4 | <img [src]="videoChannel.avatarUrl" alt="Avatar" /> | ||
5 | </a> | ||
6 | |||
7 | <div class="video-channel-info"> | ||
8 | <a [routerLink]="[ '/video-channels', videoChannel.name ]" class="video-channel-names" i18n-title title="Go to the channel"> | ||
9 | <div class="video-channel-display-name">{{ videoChannel.displayName }}</div> | ||
10 | <div class="video-channel-name">{{ videoChannel.name }}</div> | ||
11 | </a> | ||
12 | |||
13 | <div i18n class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div> | ||
14 | |||
15 | <a [routerLink]="[ '/accounts', videoChannel.ownerBy ]" i18n-title title="Go the owner account page" class="actor-owner"> | ||
16 | <span i18n>Created by {{ videoChannel.ownerBy }}</span> | ||
17 | <img [src]="videoChannel.ownerAvatarUrl" alt="Owner account avatar" /> | ||
18 | </a> | ||
19 | </div> | ||
20 | |||
21 | <my-subscribe-button [videoChannel]="videoChannel"></my-subscribe-button> | ||
22 | </div> | ||
23 | </div> | ||
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss new file mode 100644 index 000000000..2fbfa335b --- /dev/null +++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss | |||
@@ -0,0 +1,49 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
4 | .video-channel { | ||
5 | @include row-blocks; | ||
6 | |||
7 | img { | ||
8 | @include avatar(80px); | ||
9 | |||
10 | margin-right: 10px; | ||
11 | } | ||
12 | |||
13 | .video-channel-info { | ||
14 | flex-grow: 1; | ||
15 | |||
16 | a.video-channel-names { | ||
17 | @include disable-default-a-behaviour; | ||
18 | |||
19 | width: fit-content; | ||
20 | display: flex; | ||
21 | align-items: baseline; | ||
22 | color: #000; | ||
23 | |||
24 | .video-channel-display-name { | ||
25 | font-weight: $font-semibold; | ||
26 | font-size: 18px; | ||
27 | } | ||
28 | |||
29 | .video-channel-name { | ||
30 | font-size: 14px; | ||
31 | color: $grey-actor-name; | ||
32 | margin-left: 5px; | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | |||
37 | .actor-owner { | ||
38 | @include actor-owner; | ||
39 | } | ||
40 | |||
41 | my-subscribe-button { | ||
42 | /deep/ span[role=button] { | ||
43 | padding: 7px 12px; | ||
44 | font-size: 16px; | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | |||
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts new file mode 100644 index 000000000..1e94cf90b --- /dev/null +++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts | |||
@@ -0,0 +1,30 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { NotificationsService } from 'angular2-notifications' | ||
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { UserSubscriptionService } from '@app/shared/user-subscription' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-account-subscriptions', | ||
9 | templateUrl: './my-account-subscriptions.component.html', | ||
10 | styleUrls: [ './my-account-subscriptions.component.scss' ] | ||
11 | }) | ||
12 | export class MyAccountSubscriptionsComponent implements OnInit { | ||
13 | videoChannels: VideoChannel[] = [] | ||
14 | |||
15 | constructor ( | ||
16 | private userSubscriptionService: UserSubscriptionService, | ||
17 | private notificationsService: NotificationsService, | ||
18 | private i18n: I18n | ||
19 | ) {} | ||
20 | |||
21 | ngOnInit () { | ||
22 | this.userSubscriptionService.listSubscriptions() | ||
23 | .subscribe( | ||
24 | res => { console.log(res); this.videoChannels = res.data }, | ||
25 | |||
26 | error => this.notificationsService.error(this.i18n('Error'), error.message) | ||
27 | ) | ||
28 | } | ||
29 | |||
30 | } | ||