+++ /dev/null
-<div *ngIf="account" class="row">
- <div class="description col-md-6 col-sm-12">
- <div class="small-title">Description</div>
- <div class="content">{{ getAccountDescription() }}</div>
- </div>
-
- <div class="stats col-md-6 col-sm-12">
- <div class="small-title">Stats</div>
-
- <div class="content">Joined {{ account.createdAt | date }}</div>
- </div>
-</div>
\ No newline at end of file
+++ /dev/null
-@import '_variables';
-@import '_mixins';
-
-.small-title {
- @include in-content-small-title;
-
- margin-bottom: 20px;
-}
+++ /dev/null
-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'
- }
-}
+++ /dev/null
-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 {}
+++ /dev/null
-<div *ngIf="account" class="row">
- <a
- *ngFor="let videoChannel of videoChannels" [routerLink]="[ '/video-channels', videoChannel.uuid ]"
- class="video-channel" title="See this video channel"
- >
- <img [src]="videoChannel.avatarUrl" alt="Avatar" />
-
- <div class="video-channel-display-name">{{ videoChannel.displayName }}</div>
- <div class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div>
- </a>
-</div>
\ No newline at end of file
+++ /dev/null
-@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
+++ /dev/null
-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)
- }
-}
+++ /dev/null
-.title-page-single {
- margin-top: 0;
-}
\ No newline at end of file
+++ /dev/null
-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)
- }
-}
+++ /dev/null
-<div *ngIf="account" class="row">
- <div class="sub-menu">
-
- <div class="account">
- <img [src]="account.avatarUrl" alt="Avatar" />
-
- <div class="account-info">
- <div class="account-display-name">{{ account.displayName }}</div>
- <div class="account-followers">{{ account.followersCount }} subscribers</div>
- </div>
- </div>
-
- <div class="links">
- <a routerLink="videos" routerLinkActive="active" class="title-page">Videos</a>
-
- <a routerLink="video-channels" routerLinkActive="active" class="title-page">Video channels</a>
-
- <a routerLink="about" routerLinkActive="active" class="title-page">About</a>
- </div>
- </div>
-
- <div class="margin-content">
- <router-outlet></router-outlet>
- </div>
-</div>
+++ /dev/null
-@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
+++ /dev/null
-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)
- }
-}
+++ /dev/null
-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 { }
+++ /dev/null
-export * from './account-routing.module'
-export * from './account.component'
-export * from './account.module'
--- /dev/null
+<div *ngIf="account" class="row">
+ <div class="description col-md-6 col-sm-12">
+ <div class="small-title">Description</div>
+ <div class="content">{{ getAccountDescription() }}</div>
+ </div>
+
+ <div class="stats col-md-6 col-sm-12">
+ <div class="small-title">Stats</div>
+
+ <div class="content">Joined {{ account.createdAt | date }}</div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+@import '_variables';
+@import '_mixins';
+
+.small-title {
+ @include in-content-small-title;
+
+ margin-bottom: 20px;
+}
--- /dev/null
+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'
+ }
+}
--- /dev/null
+<div *ngIf="account" class="row">
+ <a
+ *ngFor="let videoChannel of videoChannels" [routerLink]="[ '/video-channels', videoChannel.uuid ]"
+ class="video-channel" title="See this video channel"
+ >
+ <img [src]="videoChannel.avatarUrl" alt="Avatar" />
+
+ <div class="video-channel-display-name">{{ videoChannel.displayName }}</div>
+ <div class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div>
+ </a>
+</div>
\ No newline at end of file
--- /dev/null
+@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
--- /dev/null
+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.listAccountVideoChannels(account.id))
+ .map(res => res.data)
+ .subscribe(videoChannels => this.videoChannels = videoChannels)
+ }
+}
--- /dev/null
+.title-page-single {
+ margin-top: 0;
+}
\ No newline at end of file
--- /dev/null
+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)
+ }
+}
--- /dev/null
+import { NgModule } from '@angular/core'
+import { RouterModule, Routes } from '@angular/router'
+import { MetaGuard } from '@ngx-meta/core'
+import { AccountsComponent } from './accounts.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 accountsRoutes: Routes = [
+ {
+ path: ':accountId',
+ component: AccountsComponent,
+ 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(accountsRoutes) ],
+ exports: [ RouterModule ]
+})
+export class AccountsRoutingModule {}
--- /dev/null
+<div *ngIf="account" class="row">
+ <div class="sub-menu">
+
+ <div class="actor">
+ <img [src]="account.avatarUrl" alt="Avatar" />
+
+ <div class="actor-info">
+ <div class="actor-display-name">{{ account.displayName }}</div>
+ <div class="actor-followers">{{ account.followersCount }} subscribers</div>
+ </div>
+ </div>
+
+ <div class="links">
+ <a routerLink="videos" routerLinkActive="active" class="title-page">Videos</a>
+
+ <a routerLink="video-channels" routerLinkActive="active" class="title-page">Video channels</a>
+
+ <a routerLink="about" routerLinkActive="active" class="title-page">About</a>
+ </div>
+ </div>
+
+ <div class="margin-content">
+ <router-outlet></router-outlet>
+ </div>
+</div>
--- /dev/null
+@import '_variables';
+@import '_mixins';
+
+.sub-menu {
+ @include sub-menu-with-actor;
+}
\ No newline at end of file
--- /dev/null
+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({
+ templateUrl: './accounts.component.html',
+ styleUrls: [ './accounts.component.scss' ]
+})
+export class AccountsComponent 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)
+ }
+}
--- /dev/null
+import { NgModule } from '@angular/core'
+import { SharedModule } from '../shared'
+import { AccountsRoutingModule } from './accounts-routing.module'
+import { AccountsComponent } from './accounts.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: [
+ AccountsRoutingModule,
+ SharedModule
+ ],
+
+ declarations: [
+ AccountsComponent,
+ AccountVideosComponent,
+ AccountVideoChannelsComponent,
+ AccountAboutComponent
+ ],
+
+ exports: [
+ AccountsComponent
+ ],
+
+ providers: []
+})
+export class AccountsModule { }
--- /dev/null
+export * from './accounts-routing.module'
+export * from './accounts.component'
+export * from './accounts.module'
--- /dev/null
+export * from './video-channels-routing.module'
+export * from './video-channels.component'
+export * from './video-channels.module'
--- /dev/null
+<div *ngIf="videoChannel" class="row">
+ <div class="description col-md-6 col-sm-12">
+ <div class="small-title">Description</div>
+ <div class="content">{{ getVideoChannelDescription() }}</div>
+ </div>
+
+ <div class="stats col-md-6 col-sm-12">
+ <div class="small-title">Stats</div>
+
+ <div class="content">Created {{ videoChannel.createdAt | date }}</div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+@import '_variables';
+@import '_mixins';
+
+.small-title {
+ @include in-content-small-title;
+
+ margin-bottom: 20px;
+}
--- /dev/null
+import { Component, OnInit } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
+import 'rxjs/add/observable/from'
+import 'rxjs/add/operator/concatAll'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+
+@Component({
+ selector: 'my-video-channel-about',
+ templateUrl: './video-channel-about.component.html',
+ styleUrls: [ './video-channel-about.component.scss' ]
+})
+export class VideoChannelAboutComponent implements OnInit {
+ videoChannel: VideoChannel
+
+ constructor (
+ protected route: ActivatedRoute,
+ private videoChannelService: VideoChannelService
+ ) { }
+
+ ngOnInit () {
+ // Parent get the video channel for us
+ this.videoChannelService.videoChannelLoaded
+ .subscribe(videoChannel => this.videoChannel = videoChannel)
+ }
+
+ getVideoChannelDescription () {
+ if (this.videoChannel.description) return this.videoChannel.description
+
+ return 'No description'
+ }
+}
--- /dev/null
+.title-page-single {
+ margin-top: 0;
+}
\ No newline at end of file
--- /dev/null
+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 { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+
+@Component({
+ selector: 'my-video-channel-videos',
+ templateUrl: '../../shared/video/abstract-video-list.html',
+ styleUrls: [
+ '../../shared/video/abstract-video-list.scss',
+ './video-channel-videos.component.scss'
+ ]
+})
+export class VideoChannelVideosComponent extends AbstractVideoList implements OnInit, OnDestroy {
+ titlePage = 'Published videos'
+ marginContent = false // Disable margin
+ currentRoute = '/video-channel/videos'
+ loadOnInit = false
+
+ private videoChannel: VideoChannel
+
+ constructor (
+ protected router: Router,
+ protected route: ActivatedRoute,
+ protected authService: AuthService,
+ protected notificationsService: NotificationsService,
+ protected confirmService: ConfirmService,
+ protected location: Location,
+ private videoChannelService: VideoChannelService,
+ private videoService: VideoService
+ ) {
+ super()
+ }
+
+ ngOnInit () {
+ super.ngOnInit()
+
+ // Parent get the video channel for us
+ this.videoChannelService.videoChannelLoaded
+ .subscribe(videoChannel => {
+ this.videoChannel = videoChannel
+ this.currentRoute = '/video-channel/' + this.videoChannel.uuid + '/videos'
+
+ this.loadMoreVideos(this.pagination.currentPage)
+ this.generateSyndicationList()
+ })
+ }
+
+ ngOnDestroy () {
+ super.ngOnDestroy()
+ }
+
+ getVideosObservable (page: number) {
+ const newPagination = immutableAssign(this.pagination, { currentPage: page })
+
+ return this.videoService.getVideoChannelVideos(this.videoChannel, newPagination, this.sort)
+ }
+
+ generateSyndicationList () {
+ this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id)
+ }
+}
--- /dev/null
+import { NgModule } from '@angular/core'
+import { RouterModule, Routes } from '@angular/router'
+import { MetaGuard } from '@ngx-meta/core'
+import { VideoChannelsComponent } from './video-channels.component'
+import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
+import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
+
+const videoChannelsRoutes: Routes = [
+ {
+ path: ':videoChannelId',
+ component: VideoChannelsComponent,
+ canActivateChild: [ MetaGuard ],
+ children: [
+ {
+ path: '',
+ redirectTo: 'videos',
+ pathMatch: 'full'
+ },
+ {
+ path: 'videos',
+ component: VideoChannelVideosComponent,
+ data: {
+ meta: {
+ title: 'Video channel videos'
+ }
+ }
+ },
+ {
+ path: 'about',
+ component: VideoChannelAboutComponent,
+ data: {
+ meta: {
+ title: 'About video channel'
+ }
+ }
+ }
+ ]
+ }
+]
+
+@NgModule({
+ imports: [ RouterModule.forChild(videoChannelsRoutes) ],
+ exports: [ RouterModule ]
+})
+export class VideoChannelsRoutingModule {}
--- /dev/null
+<div *ngIf="videoChannel" class="row">
+ <div class="sub-menu">
+
+ <div class="actor">
+ <img [src]="videoChannel.avatarUrl" alt="Avatar" />
+
+ <div class="actor-info">
+ <div class="actor-display-name">{{ videoChannel.displayName }}</div>
+ <div class="actor-followers">{{ videoChannel.followersCount }} subscribers</div>
+ </div>
+ </div>
+
+ <div class="links">
+ <a routerLink="videos" routerLinkActive="active" class="title-page">Videos</a>
+
+ <a routerLink="about" routerLinkActive="active" class="title-page">About</a>
+ </div>
+ </div>
+
+ <div class="margin-content">
+ <router-outlet></router-outlet>
+ </div>
+</div>
--- /dev/null
+@import '_variables';
+@import '_mixins';
+
+.sub-menu {
+ @include sub-menu-with-actor;
+}
\ No newline at end of file
--- /dev/null
+import { Component, OnInit } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+
+@Component({
+ templateUrl: './video-channels.component.html',
+ styleUrls: [ './video-channels.component.scss' ]
+})
+export class VideoChannelsComponent implements OnInit {
+ videoChannel: VideoChannel
+
+ constructor (
+ private route: ActivatedRoute,
+ private videoChannelService: VideoChannelService
+ ) {}
+
+ ngOnInit () {
+ const videoChannelId = this.route.snapshot.params['videoChannelId']
+
+ this.videoChannelService.getVideoChannel(videoChannelId)
+ .subscribe(videoChannel => this.videoChannel = videoChannel)
+ }
+}
--- /dev/null
+import { NgModule } from '@angular/core'
+import { SharedModule } from '../shared'
+import { VideoChannelsRoutingModule } from './video-channels-routing.module'
+import { VideoChannelsComponent } from './video-channels.component'
+import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
+import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
+
+@NgModule({
+ imports: [
+ VideoChannelsRoutingModule,
+ SharedModule
+ ],
+
+ declarations: [
+ VideoChannelsComponent,
+ VideoChannelVideosComponent,
+ VideoChannelAboutComponent
+ ],
+
+ exports: [
+ VideoChannelsComponent
+ ],
+
+ providers: []
+})
+export class VideoChannelsModule { }
loadChildren: './+admin/admin.module#AdminModule'
},
{
- path: 'account',
- loadChildren: './+account/account.module#AccountModule'
+ path: 'accounts',
+ loadChildren: './+accounts/accounts.module#AccountsModule'
+ },
+ {
+ path: 'video-channels',
+ loadChildren: './+video-channels/video-channels.module#VideoChannelsModule'
}
]
import { AccountService } from '../account/account.service'
import { ResultList } from '../../../../../shared'
import { VideoChannel } from './video-channel.model'
+import { ReplaySubject } from 'rxjs/ReplaySubject'
+import { environment } from '../../../environments/environment'
@Injectable()
export class VideoChannelService {
+ static BASE_VIDEO_CHANNEL_URL = environment.apiUrl + '/api/v1/video-channels/'
+
+ videoChannelLoaded = new ReplaySubject<VideoChannel>(1)
+
constructor (
private authHttp: HttpClient,
private restExtractor: RestExtractor,
private restService: RestService
) {}
- getVideoChannels (accountId: number): Observable<ResultList<VideoChannel>> {
+ getVideoChannel (videoChannelUUID: string) {
+ return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID)
+ .map(videoChannelHash => new VideoChannel(videoChannelHash))
+ .do(videoChannel => this.videoChannelLoaded.next(videoChannel))
+ .catch((res) => this.restExtractor.handleError(res))
+ }
+
+ listAccountVideoChannels (accountId: number): Observable<ResultList<VideoChannel>> {
return this.authHttp.get<ResultList<VideoChannelServer>>(AccountService.BASE_ACCOUNT_URL + accountId + '/video-channels')
.map(res => this.extractVideoChannels(res))
.catch((res) => this.restExtractor.handleError(res))
<span class="video-miniature-name">
<a
class="video-miniature-name"
- [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }"
+ [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }"
>
{{ video.name }}
</a>
</span>
<span class="video-miniature-created-at-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
- <a class="video-miniature-account" [routerLink]="[ '/account', video.account.id ]">{{ video.by }}</a>
+ <a class="video-miniature-account" [routerLink]="[ '/accounts', video.account.id ]">{{ video.by }}</a>
</div>
</div>
import { objectToFormData } from '@app/shared/misc/utils'
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'
@Injectable()
export class VideoService {
.catch((res) => this.restExtractor.handleError(res))
}
+ getVideoChannelVideos (
+ videoChannel: VideoChannel,
+ videoPagination: ComponentPagination,
+ sort: VideoSortField
+ ): Observable<{ videos: Video[], totalVideos: number}> {
+ const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
+
+ let params = new HttpParams()
+ params = this.restService.addRestGetParams(params, pagination, sort)
+
+ return this.authHttp
+ .get(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params })
+ .map(this.extractVideos)
+ .catch((res) => this.restExtractor.handleError(res))
+ }
+
getVideos (
videoPagination: ComponentPagination,
sort: VideoSortField,
return this.buildBaseFeedUrls(params)
}
+ getVideoChannelFeedUrls (videoChannelId: number) {
+ let params = this.restService.addRestGetParams(new HttpParams())
+ params = params.set('videoChannelId', videoChannelId.toString())
+
+ return this.buildBaseFeedUrls(params)
+ }
+
searchVideos (
search: string,
videoPagination: ComponentPagination,
</div>
<div class="video-info-by">
- <a [routerLink]="[ '/account', video.account.id ]" title="Go the account page">
+ <a [routerLink]="[ '/accounts', video.account.id ]" title="Go the account page">
<span>By {{ video.by }}</span>
<img [src]="video.accountAvatarUrl" alt="Account avatar" />
</a>
color: $orange-color;
font-weight: $font-bold;
font-size: 13px;
+}
+
+@mixin sub-menu-with-actor {
+ height: 160px;
+ display: flex;
+ flex-direction: column;
+ align-items: start;
+
+ .actor {
+ display: flex;
+ margin-top: 20px;
+ margin-bottom: 20px;
+
+ img {
+ @include avatar(80px);
+
+ margin-right: 20px;
+ }
+
+ .actor-info {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+
+ .actor-display-name {
+ font-size: 23px;
+ font-weight: $font-bold;
+ }
+
+ .actor-followers {
+ font-size: 15px;
+ }
+ }
+ }
+
+ .links {
+ margin-top: 0;
+ margin-bottom: 10px;
+
+ a {
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+ }
}
\ No newline at end of file
let path: string
before(async function () {
- path = '/api/v1/accounts/' + accountUUID + '/video-channels/' + channelUUID + '/videos'
+ path = '/api/v1/video-channels/' + channelUUID + '/videos'
})
it('Should fail with a bad start pagination', async function () {
let servers: ServerInfo[] = []
const toRemove = []
let videoUUID = ''
- let accountId: number
let videoChannelId: number
before(async function () {
// Get the access tokens
await setAccessTokensToServers(servers)
- {
- const res = await getAccountsList(servers[0].url)
- accountId = res.body.data[0].id
- }
-
{
const videoChannel = {
name: 'my channel',
description: 'super channel'
}
- await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, accountId, videoChannel)
+ await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, videoChannel)
const channelRes = await getVideoChannelsList(servers[ 0 ].url, 0, 1)
videoChannelId = channelRes.body.data[ 0 ].id
}