From 170726f523ff48f89da45473fc53ca54784f43dd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 Apr 2018 16:56:13 +0200 Subject: Implement video channel views --- .../account-about/account-about.component.html | 12 ---- .../account-about/account-about.component.scss | 8 --- .../account-about/account-about.component.ts | 39 ------------ client/src/app/+account/account-routing.module.ts | 55 ----------------- .../account-video-channels.component.html | 11 ---- .../account-video-channels.component.scss | 30 --------- .../account-video-channels.component.ts | 33 ---------- .../account-videos/account-videos.component.scss | 3 - .../account-videos/account-videos.component.ts | 71 ---------------------- client/src/app/+account/account.component.html | 25 -------- client/src/app/+account/account.component.scss | 46 -------------- client/src/app/+account/account.component.ts | 25 -------- client/src/app/+account/account.module.ts | 28 --------- client/src/app/+account/index.ts | 3 - 14 files changed, 389 deletions(-) delete mode 100644 client/src/app/+account/account-about/account-about.component.html delete mode 100644 client/src/app/+account/account-about/account-about.component.scss delete mode 100644 client/src/app/+account/account-about/account-about.component.ts delete mode 100644 client/src/app/+account/account-routing.module.ts delete mode 100644 client/src/app/+account/account-video-channels/account-video-channels.component.html delete mode 100644 client/src/app/+account/account-video-channels/account-video-channels.component.scss delete mode 100644 client/src/app/+account/account-video-channels/account-video-channels.component.ts delete mode 100644 client/src/app/+account/account-videos/account-videos.component.scss delete mode 100644 client/src/app/+account/account-videos/account-videos.component.ts delete mode 100644 client/src/app/+account/account.component.html delete mode 100644 client/src/app/+account/account.component.scss delete mode 100644 client/src/app/+account/account.component.ts delete mode 100644 client/src/app/+account/account.module.ts delete mode 100644 client/src/app/+account/index.ts (limited to 'client/src/app/+account') diff --git a/client/src/app/+account/account-about/account-about.component.html b/client/src/app/+account/account-about/account-about.component.html deleted file mode 100644 index 003a8045e..000000000 --- a/client/src/app/+account/account-about/account-about.component.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
Description
-
{{ getAccountDescription() }}
-
- -
-
Stats
- -
Joined {{ account.createdAt | date }}
-
-
\ No newline at end of file diff --git a/client/src/app/+account/account-about/account-about.component.scss b/client/src/app/+account/account-about/account-about.component.scss deleted file mode 100644 index b1be7d4ed..000000000 --- a/client/src/app/+account/account-about/account-about.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -.small-title { - @include in-content-small-title; - - margin-bottom: 20px; -} diff --git a/client/src/app/+account/account-about/account-about.component.ts b/client/src/app/+account/account-about/account-about.component.ts deleted file mode 100644 index 8746875cb..000000000 --- a/client/src/app/+account/account-about/account-about.component.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { Location } from '@angular/common' -import { getParameterByName, immutableAssign } from '@app/shared/misc/utils' -import { NotificationsService } from 'angular2-notifications' -import 'rxjs/add/observable/from' -import 'rxjs/add/operator/concatAll' -import { AuthService } from '../../core/auth' -import { ConfirmService } from '../../core/confirm' -import { AbstractVideoList } from '../../shared/video/abstract-video-list' -import { VideoService } from '../../shared/video/video.service' -import { Account } from '@app/shared/account/account.model' -import { AccountService } from '@app/shared/account/account.service' - -@Component({ - selector: 'my-account-about', - templateUrl: './account-about.component.html', - styleUrls: [ './account-about.component.scss' ] -}) -export class AccountAboutComponent implements OnInit { - account: Account - - constructor ( - protected route: ActivatedRoute, - private accountService: AccountService - ) { } - - ngOnInit () { - // Parent get the account for us - this.accountService.accountLoaded - .subscribe(account => this.account = account) - } - - getAccountDescription () { - if (this.account.description) return this.account.description - - return 'No description' - } -} diff --git a/client/src/app/+account/account-routing.module.ts b/client/src/app/+account/account-routing.module.ts deleted file mode 100644 index f72d8373f..000000000 --- a/client/src/app/+account/account-routing.module.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { NgModule } from '@angular/core' -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 './account-about/account-about.component' -import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' - -const accountRoutes: Routes = [ - { - path: ':accountId', - component: AccountComponent, - canActivateChild: [ MetaGuard ], - children: [ - { - path: '', - redirectTo: 'videos', - pathMatch: 'full' - }, - { - path: 'videos', - component: AccountVideosComponent, - data: { - meta: { - title: 'Account videos' - } - } - }, - { - path: 'video-channels', - component: AccountVideoChannelsComponent, - data: { - meta: { - title: 'Account video channels' - } - } - }, - { - path: 'about', - component: AccountAboutComponent, - data: { - meta: { - title: 'About account' - } - } - } - ] - } -] - -@NgModule({ - imports: [ RouterModule.forChild(accountRoutes) ], - exports: [ RouterModule ] -}) -export class AccountRoutingModule {} 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 deleted file mode 100644 index d20b40c60..000000000 --- a/client/src/app/+account/account-video-channels/account-video-channels.component.html +++ /dev/null @@ -1,11 +0,0 @@ -
- - 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 deleted file mode 100644 index c9c7fa8eb..000000000 --- a/client/src/app/+account/account-video-channels/account-video-channels.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -@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 deleted file mode 100644 index 8915eb622..000000000 --- a/client/src/app/+account/account-video-channels/account-video-channels.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -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-videos/account-videos.component.scss b/client/src/app/+account/account-videos/account-videos.component.scss deleted file mode 100644 index 2ba85c031..000000000 --- a/client/src/app/+account/account-videos/account-videos.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.title-page-single { - margin-top: 0; -} \ 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 deleted file mode 100644 index 6c0f0bb52..000000000 --- a/client/src/app/+account/account-videos/account-videos.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { Location } from '@angular/common' -import { immutableAssign } from '@app/shared/misc/utils' -import { NotificationsService } from 'angular2-notifications' -import 'rxjs/add/observable/from' -import 'rxjs/add/operator/concatAll' -import { AuthService } from '../../core/auth' -import { ConfirmService } from '../../core/confirm' -import { AbstractVideoList } from '../../shared/video/abstract-video-list' -import { VideoService } from '../../shared/video/video.service' -import { Account } from '@app/shared/account/account.model' -import { AccountService } from '@app/shared/account/account.service' - -@Component({ - selector: 'my-account-videos', - templateUrl: '../../shared/video/abstract-video-list.html', - styleUrls: [ - '../../shared/video/abstract-video-list.scss', - './account-videos.component.scss' - ] -}) -export class AccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage = 'Published videos' - marginContent = false // Disable margin - currentRoute = '/account/videos' - loadOnInit = false - - private account: Account - - constructor ( - protected router: Router, - protected route: ActivatedRoute, - protected authService: AuthService, - protected notificationsService: NotificationsService, - protected confirmService: ConfirmService, - protected location: Location, - private accountService: AccountService, - private videoService: VideoService - ) { - super() - } - - ngOnInit () { - super.ngOnInit() - - // Parent get the account for us - this.accountService.accountLoaded - .subscribe(account => { - this.account = account - this.currentRoute = '/account/' + this.account.id + '/videos' - - this.loadMoreVideos(this.pagination.currentPage) - this.generateSyndicationList() - }) - } - - ngOnDestroy () { - super.ngOnDestroy() - } - - getVideosObservable (page: number) { - const newPagination = immutableAssign(this.pagination, { currentPage: page }) - - return this.videoService.getAccountVideos(this.account, newPagination, this.sort) - } - - generateSyndicationList () { - this.syndicationItems = this.videoService.getAccountFeedUrls(this.account.id) - } -} diff --git a/client/src/app/+account/account.component.html b/client/src/app/+account/account.component.html deleted file mode 100644 index d0e99edda..000000000 --- a/client/src/app/+account/account.component.html +++ /dev/null @@ -1,25 +0,0 @@ -
- - -
- -
-
diff --git a/client/src/app/+account/account.component.scss b/client/src/app/+account/account.component.scss deleted file mode 100644 index c7b8f038f..000000000 --- a/client/src/app/+account/account.component.scss +++ /dev/null @@ -1,46 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -.sub-menu { - height: 160px; - display: flex; - flex-direction: column; - align-items: start; - - .account { - display: flex; - margin-top: 20px; - margin-bottom: 20px; - - img { - @include avatar(80px); - - margin-right: 20px; - } - - .account-info { - display: flex; - flex-direction: column; - justify-content: center; - - .account-display-name { - font-size: 23px; - font-weight: $font-bold; - } - - .account-followers { - font-size: 15px; - } - } - } - - .links { - margin-top: 0; - margin-bottom: 10px; - - a { - margin-top: 0; - margin-bottom: 0; - } - } -} \ No newline at end of file diff --git a/client/src/app/+account/account.component.ts b/client/src/app/+account/account.component.ts deleted file mode 100644 index d936ce2fe..000000000 --- a/client/src/app/+account/account.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { ActivatedRoute } from '@angular/router' -import { AccountService } from '@app/shared/account/account.service' -import { Account } from '@app/shared/account/account.model' - -@Component({ - selector: 'my-account', - templateUrl: './account.component.html', - styleUrls: [ './account.component.scss' ] -}) -export class AccountComponent implements OnInit { - account: Account - - constructor ( - private route: ActivatedRoute, - private accountService: AccountService - ) {} - - ngOnInit () { - const accountId = parseInt(this.route.snapshot.params['accountId'], 10) - - this.accountService.getAccount(accountId) - .subscribe(account => this.account = account) - } -} diff --git a/client/src/app/+account/account.module.ts b/client/src/app/+account/account.module.ts deleted file mode 100644 index 82ef06e76..000000000 --- a/client/src/app/+account/account.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NgModule } from '@angular/core' -import { SharedModule } from '../shared' -import { AccountRoutingModule } from './account-routing.module' -import { AccountComponent } from './account.component' -import { AccountVideosComponent } from './account-videos/account-videos.component' -import { AccountAboutComponent } from './account-about/account-about.component' -import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' - -@NgModule({ - imports: [ - AccountRoutingModule, - SharedModule - ], - - declarations: [ - AccountComponent, - AccountVideosComponent, - AccountVideoChannelsComponent, - AccountAboutComponent - ], - - exports: [ - AccountComponent - ], - - providers: [] -}) -export class AccountModule { } diff --git a/client/src/app/+account/index.ts b/client/src/app/+account/index.ts deleted file mode 100644 index dc56ffdbd..000000000 --- a/client/src/app/+account/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './account-routing.module' -export * from './account.component' -export * from './account.module' -- cgit v1.2.3