]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/app/videos/video-list/video-list.component.ts
Follow the angular styleguide for the directories structure
[github/Chocobozzz/PeerTube.git] / client / app / videos / video-list / video-list.component.ts
similarity index 67%
rename from client/angular/videos/components/list/videos-list.component.ts
rename to client/app/videos/video-list/video-list.component.ts
index 56230e331119d6948f04d0c78a4a6df72388de7b..a88fb379a4513ea79ad448e187e30f7fd2cedf97 100644 (file)
@@ -1,27 +1,28 @@
 import { Component, OnInit } from '@angular/core';
-import { ROUTER_DIRECTIVES, RouteParams, Router } from '@angular/router-deprecated';
+import { Router, ROUTER_DIRECTIVES, RouteParams } from '@angular/router-deprecated';
 
 import { PAGINATION_DIRECTIVES } from 'ng2-bootstrap/components/pagination';
 
-import { AuthService } from '../../../users/services/auth.service';
-import { Pagination } from '../../pagination';
-import { User } from '../../../users/models/user';
-import { VideosService } from '../../videos.service';
-import { Video } from '../../video';
+import {
+  LoaderComponent,
+  Pagination,
+  SortField,
+  Video,
+  VideoService
+} from '../shared/index';
+import { Search, SearchField } from '../../shared/index';
+import { AuthService, User } from '../../users/index';
 import { VideoMiniatureComponent } from './video-miniature.component';
-import { Search, SearchField } from '../../../app/search';
 import { VideoSortComponent } from './video-sort.component';
-import { SortField } from './sort';
-import { LoaderComponent } from '../../loader.component';
 
 @Component({
   selector: 'my-videos-list',
-  styleUrls: [ 'app/angular/videos/components/list/videos-list.component.css' ],
-  templateUrl: 'app/angular/videos/components/list/videos-list.component.html',
+  styleUrls: [ 'client/app/videos/video-list/video-list.component.css' ],
+  templateUrl: 'client/app/videos/video-list/video-list.component.html',
   directives: [ ROUTER_DIRECTIVES, PAGINATION_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent, LoaderComponent ]
 })
 
-export class VideosListComponent implements OnInit {
+export class VideoListComponent implements OnInit {
   user: User = null;
   videos: Video[] = [];
   pagination: Pagination = {
@@ -36,7 +37,7 @@ export class VideosListComponent implements OnInit {
 
   constructor(
     private _authService: AuthService,
-    private _videosService: VideosService,
+    private _videoService: VideoService,
     private _routeParams: RouteParams,
     private _router: Router
   ) {
@@ -63,9 +64,9 @@ export class VideosListComponent implements OnInit {
     let observable = null;
 
     if (this.search.value !== null) {
-      observable = this._videosService.searchVideos(this.search, this.pagination, this.sort);
+      observable = this._videoService.searchVideos(this.search, this.pagination, this.sort);
     } else {
-      observable = this._videosService.getVideos(this.pagination, this.sort);
+      observable = this._videoService.getVideos(this.pagination, this.sort);
     }
 
     observable.subscribe(