aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+account/account-videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+account/account-videos')
-rw-r--r--client/src/app/+account/account-videos/account-videos.component.scss3
-rw-r--r--client/src/app/+account/account-videos/account-videos.component.ts71
2 files changed, 74 insertions, 0 deletions
diff --git a/client/src/app/+account/account-videos/account-videos.component.scss b/client/src/app/+account/account-videos/account-videos.component.scss
new file mode 100644
index 000000000..2ba85c031
--- /dev/null
+++ b/client/src/app/+account/account-videos/account-videos.component.scss
@@ -0,0 +1,3 @@
1.title-page-single {
2 margin-top: 0;
3} \ No newline at end of file
diff --git a/client/src/app/+account/account-videos/account-videos.component.ts b/client/src/app/+account/account-videos/account-videos.component.ts
new file mode 100644
index 000000000..6c0f0bb52
--- /dev/null
+++ b/client/src/app/+account/account-videos/account-videos.component.ts
@@ -0,0 +1,71 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router'
3import { Location } from '@angular/common'
4import { immutableAssign } from '@app/shared/misc/utils'
5import { NotificationsService } from 'angular2-notifications'
6import 'rxjs/add/observable/from'
7import 'rxjs/add/operator/concatAll'
8import { AuthService } from '../../core/auth'
9import { ConfirmService } from '../../core/confirm'
10import { AbstractVideoList } from '../../shared/video/abstract-video-list'
11import { VideoService } from '../../shared/video/video.service'
12import { Account } from '@app/shared/account/account.model'
13import { AccountService } from '@app/shared/account/account.service'
14
15@Component({
16 selector: 'my-account-videos',
17 templateUrl: '../../shared/video/abstract-video-list.html',
18 styleUrls: [
19 '../../shared/video/abstract-video-list.scss',
20 './account-videos.component.scss'
21 ]
22})
23export class AccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy {
24 titlePage = 'Published videos'
25 marginContent = false // Disable margin
26 currentRoute = '/account/videos'
27 loadOnInit = false
28
29 private account: Account
30
31 constructor (
32 protected router: Router,
33 protected route: ActivatedRoute,
34 protected authService: AuthService,
35 protected notificationsService: NotificationsService,
36 protected confirmService: ConfirmService,
37 protected location: Location,
38 private accountService: AccountService,
39 private videoService: VideoService
40 ) {
41 super()
42 }
43
44 ngOnInit () {
45 super.ngOnInit()
46
47 // Parent get the account for us
48 this.accountService.accountLoaded
49 .subscribe(account => {
50 this.account = account
51 this.currentRoute = '/account/' + this.account.id + '/videos'
52
53 this.loadMoreVideos(this.pagination.currentPage)
54 this.generateSyndicationList()
55 })
56 }
57
58 ngOnDestroy () {
59 super.ngOnDestroy()
60 }
61
62 getVideosObservable (page: number) {
63 const newPagination = immutableAssign(this.pagination, { currentPage: page })
64
65 return this.videoService.getAccountVideos(this.account, newPagination, this.sort)
66 }
67
68 generateSyndicationList () {
69 this.syndicationItems = this.videoService.getAccountFeedUrls(this.account.id)
70 }
71}