diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 18:56:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 18:56:26 +0100 |
commit | 202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7 (patch) | |
tree | 605df063371b6be32ca0773bf2917b0c5d9163ae /client/src/app | |
parent | c30745f342480b59fb0856a059c8c2fbffbcfc6a (diff) | |
download | PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.gz PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.zst PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.zip |
Begin videos of an account
Diffstat (limited to 'client/src/app')
34 files changed, 179 insertions, 139 deletions
diff --git a/client/src/app/account/account-routing.module.ts b/client/src/app/account/account-routing.module.ts index 2e9de1cfb..070b9b5c5 100644 --- a/client/src/app/account/account-routing.module.ts +++ b/client/src/app/account/account-routing.module.ts | |||
@@ -6,6 +6,7 @@ import { MetaGuard } from '@ngx-meta/core' | |||
6 | import { LoginGuard } from '../core' | 6 | import { LoginGuard } from '../core' |
7 | import { AccountComponent } from './account.component' | 7 | import { AccountComponent } from './account.component' |
8 | import { AccountSettingsComponent } from './account-settings/account-settings.component' | 8 | import { AccountSettingsComponent } from './account-settings/account-settings.component' |
9 | import { AccountVideosComponent } from './account-videos/account-videos.component' | ||
9 | 10 | ||
10 | const accountRoutes: Routes = [ | 11 | const accountRoutes: Routes = [ |
11 | { | 12 | { |
@@ -22,15 +23,15 @@ const accountRoutes: Routes = [ | |||
22 | } | 23 | } |
23 | } | 24 | } |
24 | }, | 25 | }, |
25 | // { | 26 | { |
26 | // path: 'videos', | 27 | path: 'videos', |
27 | // component: AccountVideosComponent, | 28 | component: AccountVideosComponent, |
28 | // data: { | 29 | data: { |
29 | // meta: { | 30 | meta: { |
30 | // title: 'Account videos' | 31 | title: 'Account videos' |
31 | // } | 32 | } |
32 | // } | 33 | } |
33 | // } | 34 | } |
34 | ] | 35 | ] |
35 | } | 36 | } |
36 | ] | 37 | ] |
diff --git a/client/src/app/account/account-videos/account-videos.component.html b/client/src/app/account/account-videos/account-videos.component.html new file mode 100644 index 000000000..6c8ac4508 --- /dev/null +++ b/client/src/app/account/account-videos/account-videos.component.html | |||
@@ -0,0 +1,9 @@ | |||
1 | <div | ||
2 | infiniteScroll | ||
3 | [infiniteScrollDistance]="0.5" | ||
4 | (scrolled)="onNearOfBottom()" | ||
5 | > | ||
6 | <div *ngFor="let video of videos"> | ||
7 | <my-video-thumbnail [video]="video"></my-video-thumbnail> | ||
8 | </div> | ||
9 | </div> | ||
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.scss b/client/src/app/account/account-videos/account-videos.component.scss index e69de29bb..e69de29bb 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.scss +++ b/client/src/app/account/account-videos/account-videos.component.scss | |||
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..ff945825d --- /dev/null +++ b/client/src/app/account/account-videos/account-videos.component.ts | |||
@@ -0,0 +1,35 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
3 | import { ActivatedRoute } from '@angular/router' | ||
4 | import { Router } from '@angular/router' | ||
5 | import { NotificationsService } from 'angular2-notifications' | ||
6 | import { VideoService } from '../../shared/video/video.service' | ||
7 | |||
8 | @Component({ | ||
9 | selector: 'my-account-videos', | ||
10 | templateUrl: './account-videos.component.html', | ||
11 | styleUrls: [ './account-videos.component.scss' ] | ||
12 | }) | ||
13 | export class AccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { | ||
14 | titlePage = 'My videos' | ||
15 | currentRoute = '/account/videos' | ||
16 | |||
17 | constructor (protected router: Router, | ||
18 | protected route: ActivatedRoute, | ||
19 | protected notificationsService: NotificationsService, | ||
20 | private videoService: VideoService) { | ||
21 | super() | ||
22 | } | ||
23 | |||
24 | ngOnInit () { | ||
25 | super.ngOnInit() | ||
26 | } | ||
27 | |||
28 | ngOnDestroy () { | ||
29 | super.ngOnDestroy() | ||
30 | } | ||
31 | |||
32 | getVideosObservable () { | ||
33 | return this.videoService.getMyVideos(this.pagination, this.sort) | ||
34 | } | ||
35 | } | ||
diff --git a/client/src/app/account/account.module.ts b/client/src/app/account/account.module.ts index ff444ddeb..020199e23 100644 --- a/client/src/app/account/account.module.ts +++ b/client/src/app/account/account.module.ts | |||
@@ -6,6 +6,7 @@ import { AccountDetailsComponent } from './account-settings/account-details/acco | |||
6 | import { AccountSettingsComponent } from './account-settings/account-settings.component' | 6 | import { AccountSettingsComponent } from './account-settings/account-settings.component' |
7 | import { AccountComponent } from './account.component' | 7 | import { AccountComponent } from './account.component' |
8 | import { AccountService } from './account.service' | 8 | import { AccountService } from './account.service' |
9 | import { AccountVideosComponent } from './account-videos/account-videos.component' | ||
9 | 10 | ||
10 | @NgModule({ | 11 | @NgModule({ |
11 | imports: [ | 12 | imports: [ |
@@ -17,7 +18,8 @@ import { AccountService } from './account.service' | |||
17 | AccountComponent, | 18 | AccountComponent, |
18 | AccountSettingsComponent, | 19 | AccountSettingsComponent, |
19 | AccountChangePasswordComponent, | 20 | AccountChangePasswordComponent, |
20 | AccountDetailsComponent | 21 | AccountDetailsComponent, |
22 | AccountVideosComponent | ||
21 | ], | 23 | ], |
22 | 24 | ||
23 | exports: [ | 25 | exports: [ |
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index 7618748e9..e76f7636a 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts | |||
@@ -20,6 +20,9 @@ import { SearchComponent, SearchService } from './search' | |||
20 | import { UserService } from './users' | 20 | import { UserService } from './users' |
21 | import { VideoAbuseService } from './video-abuse' | 21 | import { VideoAbuseService } from './video-abuse' |
22 | import { VideoBlacklistService } from './video-blacklist' | 22 | import { VideoBlacklistService } from './video-blacklist' |
23 | import { VideoThumbnailComponent } from './video/video-thumbnail.component' | ||
24 | import { VideoService } from './video/video.service' | ||
25 | import { InfiniteScrollModule } from 'ngx-infinite-scroll' | ||
23 | 26 | ||
24 | @NgModule({ | 27 | @NgModule({ |
25 | imports: [ | 28 | imports: [ |
@@ -34,7 +37,8 @@ import { VideoBlacklistService } from './video-blacklist' | |||
34 | ProgressbarModule.forRoot(), | 37 | ProgressbarModule.forRoot(), |
35 | 38 | ||
36 | DataTableModule, | 39 | DataTableModule, |
37 | PrimeSharedModule | 40 | PrimeSharedModule, |
41 | InfiniteScrollModule | ||
38 | ], | 42 | ], |
39 | 43 | ||
40 | declarations: [ | 44 | declarations: [ |
@@ -42,6 +46,7 @@ import { VideoBlacklistService } from './video-blacklist' | |||
42 | KeysPipe, | 46 | KeysPipe, |
43 | SearchComponent, | 47 | SearchComponent, |
44 | LoaderComponent, | 48 | LoaderComponent, |
49 | VideoThumbnailComponent, | ||
45 | NumberFormatterPipe, | 50 | NumberFormatterPipe, |
46 | FromNowPipe | 51 | FromNowPipe |
47 | ], | 52 | ], |
@@ -58,11 +63,13 @@ import { VideoBlacklistService } from './video-blacklist' | |||
58 | ProgressbarModule, | 63 | ProgressbarModule, |
59 | DataTableModule, | 64 | DataTableModule, |
60 | PrimeSharedModule, | 65 | PrimeSharedModule, |
66 | InfiniteScrollModule, | ||
61 | BytesPipe, | 67 | BytesPipe, |
62 | KeysPipe, | 68 | KeysPipe, |
63 | 69 | ||
64 | SearchComponent, | 70 | SearchComponent, |
65 | LoaderComponent, | 71 | LoaderComponent, |
72 | VideoThumbnailComponent, | ||
66 | 73 | ||
67 | NumberFormatterPipe, | 74 | NumberFormatterPipe, |
68 | FromNowPipe | 75 | FromNowPipe |
@@ -75,7 +82,8 @@ import { VideoBlacklistService } from './video-blacklist' | |||
75 | SearchService, | 82 | SearchService, |
76 | VideoAbuseService, | 83 | VideoAbuseService, |
77 | VideoBlacklistService, | 84 | VideoBlacklistService, |
78 | UserService | 85 | UserService, |
86 | VideoService | ||
79 | ] | 87 | ] |
80 | }) | 88 | }) |
81 | export class SharedModule { } | 89 | export class SharedModule { } |
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html index bd4f6b1f8..bd4f6b1f8 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.html +++ b/client/src/app/shared/video/abstract-video-list.html | |||
diff --git a/client/src/app/shared/video/abstract-video-list.scss b/client/src/app/shared/video/abstract-video-list.scss new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/client/src/app/shared/video/abstract-video-list.scss | |||
diff --git a/client/src/app/videos/video-list/shared/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index a684ffef4..cf717cf4c 100644 --- a/client/src/app/videos/video-list/shared/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { OnDestroy, OnInit } from '@angular/core' | 1 | import { OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | |||
4 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
5 | import { Observable } from 'rxjs/Observable' | 4 | import { Observable } from 'rxjs/Observable' |
6 | import { Subscription } from 'rxjs/Subscription' | 5 | import { Subscription } from 'rxjs/Subscription' |
7 | 6 | import { SortField } from './sort-field.type' | |
8 | import { SortField, Video, VideoPagination } from '../../shared' | 7 | import { VideoPagination } from './video-pagination.model' |
8 | import { Video } from './video.model' | ||
9 | 9 | ||
10 | export abstract class AbstractVideoList implements OnInit, OnDestroy { | 10 | export abstract class AbstractVideoList implements OnInit, OnDestroy { |
11 | pagination: VideoPagination = { | 11 | pagination: VideoPagination = { |
@@ -76,7 +76,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
76 | protected hasMoreVideos () { | 76 | protected hasMoreVideos () { |
77 | if (!this.pagination.totalItems) return true | 77 | if (!this.pagination.totalItems) return true |
78 | 78 | ||
79 | const maxPage = this.pagination.totalItems/this.pagination.itemsPerPage | 79 | const maxPage = this.pagination.totalItems / this.pagination.itemsPerPage |
80 | return maxPage > this.pagination.currentPage | 80 | return maxPage > this.pagination.currentPage |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/client/src/app/videos/shared/sort-field.type.ts b/client/src/app/shared/video/sort-field.type.ts index 776f360f8..776f360f8 100644 --- a/client/src/app/videos/shared/sort-field.type.ts +++ b/client/src/app/shared/video/sort-field.type.ts | |||
diff --git a/client/src/app/videos/shared/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 64cb4f847..93c380b73 100644 --- a/client/src/app/videos/shared/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Video } from './video.model' | 1 | import { Video } from '../../shared/video/video.model' |
2 | import { AuthUser } from '../../core' | 2 | import { AuthUser } from '../../core' |
3 | import { | 3 | import { |
4 | VideoDetails as VideoDetailsServerModel, | 4 | VideoDetails as VideoDetailsServerModel, |
diff --git a/client/src/app/videos/shared/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index 88d23a59f..88d23a59f 100644 --- a/client/src/app/videos/shared/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts | |||
diff --git a/client/src/app/videos/shared/video-pagination.model.ts b/client/src/app/shared/video/video-pagination.model.ts index 9e71769cb..9e71769cb 100644 --- a/client/src/app/videos/shared/video-pagination.model.ts +++ b/client/src/app/shared/video/video-pagination.model.ts | |||
diff --git a/client/src/app/shared/video/video-thumbnail.component.html b/client/src/app/shared/video/video-thumbnail.component.html new file mode 100644 index 000000000..5c698e8f6 --- /dev/null +++ b/client/src/app/shared/video/video-thumbnail.component.html | |||
@@ -0,0 +1,10 @@ | |||
1 | <a | ||
2 | [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" | ||
3 | class="video-thumbnail" | ||
4 | > | ||
5 | <img [attr.src]="video.thumbnailUrl" alt="video thumbnail" [ngClass]="{ 'blur-filter': nsfw }" /> | ||
6 | |||
7 | <div class="video-thumbnail-overlay"> | ||
8 | {{ video.durationLabel }} | ||
9 | </div> | ||
10 | </a> | ||
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/video/video-thumbnail.component.scss new file mode 100644 index 000000000..ab4f9bcb1 --- /dev/null +++ b/client/src/app/shared/video/video-thumbnail.component.scss | |||
@@ -0,0 +1,28 @@ | |||
1 | .video-thumbnail { | ||
2 | display: inline-block; | ||
3 | position: relative; | ||
4 | border-radius: 4px; | ||
5 | overflow: hidden; | ||
6 | |||
7 | &:hover { | ||
8 | text-decoration: none !important; | ||
9 | } | ||
10 | |||
11 | img.blur-filter { | ||
12 | filter: blur(5px); | ||
13 | transform : scale(1.03); | ||
14 | } | ||
15 | |||
16 | .video-thumbnail-overlay { | ||
17 | position: absolute; | ||
18 | right: 5px; | ||
19 | bottom: 5px; | ||
20 | display: inline-block; | ||
21 | background-color: rgba(0, 0, 0, 0.7); | ||
22 | color: #fff; | ||
23 | font-size: 12px; | ||
24 | font-weight: $font-bold; | ||
25 | border-radius: 3px; | ||
26 | padding: 0 5px; | ||
27 | } | ||
28 | } | ||
diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/video/video-thumbnail.component.ts new file mode 100644 index 000000000..e543e9903 --- /dev/null +++ b/client/src/app/shared/video/video-thumbnail.component.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import { Component, Input } from '@angular/core' | ||
2 | import { Video } from './video.model' | ||
3 | |||
4 | @Component({ | ||
5 | selector: 'my-video-thumbnail', | ||
6 | styleUrls: [ './video-thumbnail.component.scss' ], | ||
7 | templateUrl: './video-thumbnail.component.html' | ||
8 | }) | ||
9 | export class VideoThumbnailComponent { | ||
10 | @Input() video: Video | ||
11 | @Input() nsfw = false | ||
12 | } | ||
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/shared/video/video.model.ts index 0dd41d71b..6929c8755 100644 --- a/client/src/app/videos/shared/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Video as VideoServerModel } from '../../../../../shared' | 1 | import { Video as VideoServerModel } from '../../../../../shared' |
2 | import { User } from '../../shared' | 2 | import { User } from '../' |
3 | 3 | ||
4 | export class Video implements VideoServerModel { | 4 | export class Video implements VideoServerModel { |
5 | account: string | 5 | account: string |
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/shared/video/video.service.ts index 5d25a26d4..b2a26417c 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -1,29 +1,23 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Observable } from 'rxjs/Observable' | ||
3 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' | 1 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | ||
4 | import 'rxjs/add/operator/catch' | 3 | import 'rxjs/add/operator/catch' |
5 | import 'rxjs/add/operator/map' | 4 | import 'rxjs/add/operator/map' |
6 | 5 | import { Observable } from 'rxjs/Observable' | |
6 | import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } from '../../../../../shared' | ||
7 | import { ResultList } from '../../../../../shared/models/result-list.model' | ||
8 | import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model' | ||
9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' | ||
10 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' | ||
11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' | ||
12 | import { RestExtractor } from '../rest/rest-extractor.service' | ||
13 | import { RestService } from '../rest/rest.service' | ||
14 | import { Search } from '../search/search.model' | ||
15 | import { UserService } from '../users/user.service' | ||
7 | import { SortField } from './sort-field.type' | 16 | import { SortField } from './sort-field.type' |
8 | import { | ||
9 | RestExtractor, | ||
10 | RestService, | ||
11 | UserService, | ||
12 | Search | ||
13 | } from '../../shared' | ||
14 | import { Video } from './video.model' | ||
15 | import { VideoDetails } from './video-details.model' | 17 | import { VideoDetails } from './video-details.model' |
16 | import { VideoEdit } from './video-edit.model' | 18 | import { VideoEdit } from './video-edit.model' |
17 | import { VideoPagination } from './video-pagination.model' | 19 | import { VideoPagination } from './video-pagination.model' |
18 | import { | 20 | import { Video } from './video.model' |
19 | UserVideoRate, | ||
20 | VideoRateType, | ||
21 | VideoUpdate, | ||
22 | UserVideoRateUpdate, | ||
23 | Video as VideoServerModel, | ||
24 | VideoDetails as VideoDetailsServerModel, | ||
25 | ResultList | ||
26 | } from '../../../../../shared' | ||
27 | 21 | ||
28 | @Injectable() | 22 | @Injectable() |
29 | export class VideoService { | 23 | export class VideoService { |
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts index c64cea920..cdab694f9 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts | |||
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core' | |||
3 | import { TagInputModule } from 'ngx-chips' | 3 | import { TagInputModule } from 'ngx-chips' |
4 | import { TabsModule } from 'ngx-bootstrap/tabs' | 4 | import { TabsModule } from 'ngx-bootstrap/tabs' |
5 | 5 | ||
6 | import { VideoService, MarkdownService, VideoDescriptionComponent } from '../../shared' | 6 | import { MarkdownService, VideoDescriptionComponent } from '../../shared' |
7 | import { SharedModule } from '../../../shared' | 7 | import { SharedModule } from '../../../shared' |
8 | 8 | ||
9 | @NgModule({ | 9 | @NgModule({ |
@@ -26,7 +26,6 @@ import { SharedModule } from '../../../shared' | |||
26 | ], | 26 | ], |
27 | 27 | ||
28 | providers: [ | 28 | providers: [ |
29 | VideoService, | ||
30 | MarkdownService | 29 | MarkdownService |
31 | ] | 30 | ] |
32 | }) | 31 | }) |
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 76bfbb515..989addbd7 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -1,25 +1,23 @@ | |||
1 | import { HttpEventType, HttpResponse } from '@angular/common/http' | ||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { FormBuilder, FormGroup } from '@angular/forms' | 3 | import { FormBuilder, FormGroup } from '@angular/forms' |
3 | import { Router } from '@angular/router' | 4 | import { Router } from '@angular/router' |
4 | |||
5 | import { NotificationsService } from 'angular2-notifications' | 5 | import { NotificationsService } from 'angular2-notifications' |
6 | 6 | import { VideoService } from 'app/shared/video/video.service' | |
7 | import { VideoCreate } from '../../../../../shared' | ||
8 | import { AuthService, ServerService } from '../../core' | ||
7 | import { | 9 | import { |
8 | FormReactive, | 10 | FormReactive, |
9 | VIDEO_NAME, | ||
10 | VIDEO_CATEGORY, | 11 | VIDEO_CATEGORY, |
11 | VIDEO_LICENCE, | ||
12 | VIDEO_LANGUAGE, | ||
13 | VIDEO_DESCRIPTION, | ||
14 | VIDEO_TAGS, | ||
15 | VIDEO_CHANNEL, | 12 | VIDEO_CHANNEL, |
13 | VIDEO_DESCRIPTION, | ||
16 | VIDEO_FILE, | 14 | VIDEO_FILE, |
17 | VIDEO_PRIVACY | 15 | VIDEO_LANGUAGE, |
16 | VIDEO_LICENCE, | ||
17 | VIDEO_NAME, | ||
18 | VIDEO_PRIVACY, | ||
19 | VIDEO_TAGS | ||
18 | } from '../../shared' | 20 | } from '../../shared' |
19 | import { AuthService, ServerService } from '../../core' | ||
20 | import { VideoService } from '../shared' | ||
21 | import { VideoCreate } from '../../../../../shared' | ||
22 | import { HttpEventType, HttpResponse } from '@angular/common/http' | ||
23 | 21 | ||
24 | @Component({ | 22 | @Component({ |
25 | selector: 'my-videos-add', | 23 | selector: 'my-videos-add', |
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 0e966cb50..017781866 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -1,23 +1,22 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { FormBuilder, FormGroup } from '@angular/forms' | 2 | import { FormBuilder, FormGroup } from '@angular/forms' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import 'rxjs/add/observable/forkJoin' | ||
5 | |||
6 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
7 | 5 | import 'rxjs/add/observable/forkJoin' | |
6 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | ||
8 | import { ServerService } from '../../core' | 7 | import { ServerService } from '../../core' |
9 | import { | 8 | import { |
10 | FormReactive, | 9 | FormReactive, |
11 | VIDEO_NAME, | ||
12 | VIDEO_CATEGORY, | 10 | VIDEO_CATEGORY, |
13 | VIDEO_LICENCE, | ||
14 | VIDEO_LANGUAGE, | ||
15 | VIDEO_DESCRIPTION, | 11 | VIDEO_DESCRIPTION, |
16 | VIDEO_TAGS, | 12 | VIDEO_LANGUAGE, |
17 | VIDEO_PRIVACY | 13 | VIDEO_LICENCE, |
14 | VIDEO_NAME, | ||
15 | VIDEO_PRIVACY, | ||
16 | VIDEO_TAGS | ||
18 | } from '../../shared' | 17 | } from '../../shared' |
19 | import { VideoEdit, VideoService } from '../shared' | 18 | import { VideoService } from '../../shared/video/video.service' |
20 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | 19 | import { VideoEdit } from '../../shared/video/video-edit.model' |
21 | 20 | ||
22 | @Component({ | 21 | @Component({ |
23 | selector: 'my-videos-update', | 22 | selector: 'my-videos-update', |
diff --git a/client/src/app/videos/+video-watch/video-download.component.ts b/client/src/app/videos/+video-watch/video-download.component.ts index c32f8d586..010a246cd 100644 --- a/client/src/app/videos/+video-watch/video-download.component.ts +++ b/client/src/app/videos/+video-watch/video-download.component.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | 1 | import { Component, Input, ViewChild } from '@angular/core' |
2 | |||
3 | import { ModalDirective } from 'ngx-bootstrap/modal' | 2 | import { ModalDirective } from 'ngx-bootstrap/modal' |
4 | 3 | import { VideoDetails } from '../../shared/video/video-details.model' | |
5 | import { VideoDetails } from '../shared' | ||
6 | 4 | ||
7 | @Component({ | 5 | @Component({ |
8 | selector: 'my-video-download', | 6 | selector: 'my-video-download', |
diff --git a/client/src/app/videos/+video-watch/video-report.component.ts b/client/src/app/videos/+video-watch/video-report.component.ts index fc9b5a9d4..b94e4144e 100644 --- a/client/src/app/videos/+video-watch/video-report.component.ts +++ b/client/src/app/videos/+video-watch/video-report.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Component, Input, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, Input, OnInit, ViewChild } from '@angular/core' |
2 | import { FormBuilder, FormGroup } from '@angular/forms' | 2 | import { FormBuilder, FormGroup } from '@angular/forms' |
3 | |||
4 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
5 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
6 | 4 | import { ModalDirective } from 'ngx-bootstrap/modal' | |
7 | import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared' | 5 | import { FormReactive, VIDEO_ABUSE_REASON, VideoAbuseService } from '../../shared' |
8 | import { VideoDetails, VideoService } from '../shared' | 6 | import { VideoDetails } from '../../shared/video/video-details.model' |
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-video-report', | 9 | selector: 'my-video-report', |
diff --git a/client/src/app/videos/+video-watch/video-share.component.ts b/client/src/app/videos/+video-watch/video-share.component.ts index aeef65ecf..4df9adf29 100644 --- a/client/src/app/videos/+video-watch/video-share.component.ts +++ b/client/src/app/videos/+video-watch/video-share.component.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | 1 | import { Component, Input, ViewChild } from '@angular/core' |
2 | |||
3 | import { ModalDirective } from 'ngx-bootstrap/modal' | 2 | import { ModalDirective } from 'ngx-bootstrap/modal' |
4 | 3 | import { VideoDetails } from '../../shared/video/video-details.model' | |
5 | import { VideoDetails } from '../shared' | ||
6 | 4 | ||
7 | @Component({ | 5 | @Component({ |
8 | selector: 'my-video-share', | 6 | selector: 'my-video-share', |
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index b26f3092f..eac676be8 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -2,6 +2,7 @@ import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/co | |||
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { MetaService } from '@ngx-meta/core' | 3 | import { MetaService } from '@ngx-meta/core' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { VideoService } from 'app/shared/video/video.service' | ||
5 | import { Observable } from 'rxjs/Observable' | 6 | import { Observable } from 'rxjs/Observable' |
6 | import { Subscription } from 'rxjs/Subscription' | 7 | import { Subscription } from 'rxjs/Subscription' |
7 | import videojs from 'video.js' | 8 | import videojs from 'video.js' |
@@ -9,10 +10,11 @@ import { UserVideoRateType, VideoRateType } from '../../../../../shared' | |||
9 | import '../../../assets/player/peertube-videojs-plugin' | 10 | import '../../../assets/player/peertube-videojs-plugin' |
10 | import { AuthService, ConfirmService } from '../../core' | 11 | import { AuthService, ConfirmService } from '../../core' |
11 | import { VideoBlacklistService } from '../../shared' | 12 | import { VideoBlacklistService } from '../../shared' |
12 | import { MarkdownService, VideoDetails, VideoService } from '../shared' | 13 | import { MarkdownService } from '../shared' |
13 | import { VideoDownloadComponent } from './video-download.component' | 14 | import { VideoDownloadComponent } from './video-download.component' |
14 | import { VideoReportComponent } from './video-report.component' | 15 | import { VideoReportComponent } from './video-report.component' |
15 | import { VideoShareComponent } from './video-share.component' | 16 | import { VideoShareComponent } from './video-share.component' |
17 | import { VideoDetails } from '../../shared/video/video-details.model' | ||
16 | 18 | ||
17 | @Component({ | 19 | @Component({ |
18 | selector: 'my-video-watch', | 20 | selector: 'my-video-watch', |
diff --git a/client/src/app/videos/+video-watch/video-watch.module.ts b/client/src/app/videos/+video-watch/video-watch.module.ts index 1b983200d..0b1dd5c15 100644 --- a/client/src/app/videos/+video-watch/video-watch.module.ts +++ b/client/src/app/videos/+video-watch/video-watch.module.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | 2 | ||
3 | import { VideoWatchRoutingModule } from './video-watch-routing.module' | 3 | import { VideoWatchRoutingModule } from './video-watch-routing.module' |
4 | import { VideoService, MarkdownService } from '../shared' | 4 | import { MarkdownService } from '../shared' |
5 | import { SharedModule } from '../../shared' | 5 | import { SharedModule } from '../../shared' |
6 | 6 | ||
7 | import { VideoWatchComponent } from './video-watch.component' | 7 | import { VideoWatchComponent } from './video-watch.component' |
@@ -28,8 +28,7 @@ import { VideoDownloadComponent } from './video-download.component' | |||
28 | ], | 28 | ], |
29 | 29 | ||
30 | providers: [ | 30 | providers: [ |
31 | MarkdownService, | 31 | MarkdownService |
32 | VideoService | ||
33 | ] | 32 | ] |
34 | }) | 33 | }) |
35 | export class VideoWatchModule { } | 34 | export class VideoWatchModule { } |
diff --git a/client/src/app/videos/shared/index.ts b/client/src/app/videos/shared/index.ts index 3f1458088..3c72ed895 100644 --- a/client/src/app/videos/shared/index.ts +++ b/client/src/app/videos/shared/index.ts | |||
@@ -1,8 +1,2 @@ | |||
1 | export * from './sort-field.type' | ||
2 | export * from './markdown.service' | 1 | export * from './markdown.service' |
3 | export * from './video.model' | ||
4 | export * from './video-details.model' | ||
5 | export * from './video-edit.model' | ||
6 | export * from './video.service' | ||
7 | export * from './video-description.component' | 2 | export * from './video-description.component' |
8 | export * from './video-pagination.model' | ||
diff --git a/client/src/app/videos/video-list/shared/index.ts b/client/src/app/videos/video-list/shared/index.ts index 170ca4832..2778f2d9e 100644 --- a/client/src/app/videos/video-list/shared/index.ts +++ b/client/src/app/videos/video-list/shared/index.ts | |||
@@ -1,2 +1 @@ | |||
1 | export * from './abstract-video-list' | ||
2 | export * from './video-miniature.component' | export * from './video-miniature.component' | |
diff --git a/client/src/app/videos/video-list/shared/video-miniature.component.html b/client/src/app/videos/video-list/shared/video-miniature.component.html index aea85b6c6..f2756ca3d 100644 --- a/client/src/app/videos/video-list/shared/video-miniature.component.html +++ b/client/src/app/videos/video-list/shared/video-miniature.component.html | |||
@@ -1,14 +1,5 @@ | |||
1 | <div class="video-miniature"> | 1 | <div class="video-miniature"> |
2 | <a | 2 | <my-video-thumbnail [video]="video" [nsfw]="isVideoNSFWForThisUser()"></my-video-thumbnail> |
3 | [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.description" | ||
4 | class="video-miniature-thumbnail" | ||
5 | > | ||
6 | <img [attr.src]="video.thumbnailUrl" alt="video thumbnail" [ngClass]="{ 'blur-filter': isVideoNSFWForThisUser() }" /> | ||
7 | |||
8 | <div class="video-miniature-thumbnail-overlay"> | ||
9 | {{ video.durationLabel }} | ||
10 | </div> | ||
11 | </a> | ||
12 | 3 | ||
13 | <div class="video-miniature-information"> | 4 | <div class="video-miniature-information"> |
14 | <span class="video-miniature-name"> | 5 | <span class="video-miniature-name"> |
diff --git a/client/src/app/videos/video-list/shared/video-miniature.component.scss b/client/src/app/videos/video-list/shared/video-miniature.component.scss index ed15864d9..658d7af9d 100644 --- a/client/src/app/videos/video-list/shared/video-miniature.component.scss +++ b/client/src/app/videos/video-list/shared/video-miniature.component.scss | |||
@@ -5,35 +5,6 @@ | |||
5 | height: 175px; | 5 | height: 175px; |
6 | vertical-align: top; | 6 | vertical-align: top; |
7 | 7 | ||
8 | .video-miniature-thumbnail { | ||
9 | display: inline-block; | ||
10 | position: relative; | ||
11 | border-radius: 4px; | ||
12 | overflow: hidden; | ||
13 | |||
14 | &:hover { | ||
15 | text-decoration: none !important; | ||
16 | } | ||
17 | |||
18 | img.blur-filter { | ||
19 | filter: blur(5px); | ||
20 | transform : scale(1.03); | ||
21 | } | ||
22 | |||
23 | .video-miniature-thumbnail-overlay { | ||
24 | position: absolute; | ||
25 | right: 5px; | ||
26 | bottom: 5px; | ||
27 | display: inline-block; | ||
28 | background-color: rgba(0, 0, 0, 0.7); | ||
29 | color: #fff; | ||
30 | font-size: 12px; | ||
31 | font-weight: $font-bold; | ||
32 | border-radius: 3px; | ||
33 | padding: 0 5px; | ||
34 | } | ||
35 | } | ||
36 | |||
37 | .video-miniature-information { | 8 | .video-miniature-information { |
38 | width: 200px; | 9 | width: 200px; |
39 | margin-top: 2px; | 10 | margin-top: 2px; |
diff --git a/client/src/app/videos/video-list/shared/video-miniature.component.ts b/client/src/app/videos/video-list/shared/video-miniature.component.ts index e5a87907b..e8fc8e911 100644 --- a/client/src/app/videos/video-list/shared/video-miniature.component.ts +++ b/client/src/app/videos/video-list/shared/video-miniature.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | |||
3 | import { SortField, Video } from '../../shared' | ||
4 | import { User } from '../../../shared' | 2 | import { User } from '../../../shared' |
3 | import { SortField } from '../../../shared/video/sort-field.type' | ||
4 | import { Video } from '../../../shared/video/video.model' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-video-miniature', | 7 | selector: 'my-video-miniature', |
diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts index 9bf69bd78..d48804414 100644 --- a/client/src/app/videos/video-list/video-recently-added.component.ts +++ b/client/src/app/videos/video-list/video-recently-added.component.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { VideoService } from '../shared' | 4 | import { VideoService } from '../../shared/video/video.service' |
5 | import { AbstractVideoList } from './shared' | 5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-videos-recently-added', | 8 | selector: 'my-videos-recently-added', |
9 | styleUrls: [ './shared/abstract-video-list.scss' ], | 9 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], |
10 | templateUrl: './shared/abstract-video-list.html' | 10 | templateUrl: '../../shared/video/abstract-video-list.html' |
11 | }) | 11 | }) |
12 | export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { | 12 | export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { |
13 | titlePage = 'Recently added' | 13 | titlePage = 'Recently added' |
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index a1df68711..9108289c9 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { VideoService } from '../shared' | 4 | import { VideoService } from '../../shared/video/video.service' |
5 | import { AbstractVideoList } from './shared' | 5 | import { AbstractVideoList } from 'app/shared/video/abstract-video-list' |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-videos-trending', | 8 | selector: 'my-videos-trending', |
9 | styleUrls: [ './shared/abstract-video-list.scss' ], | 9 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], |
10 | templateUrl: './shared/abstract-video-list.html' | 10 | templateUrl: '../../shared/video/abstract-video-list.html' |
11 | }) | 11 | }) |
12 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { | 12 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { |
13 | titlePage = 'Trending' | 13 | titlePage = 'Trending' |
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts index 1d6194158..6d846fd3b 100644 --- a/client/src/app/videos/videos.module.ts +++ b/client/src/app/videos/videos.module.ts | |||
@@ -1,7 +1,5 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { InfiniteScrollModule } from 'ngx-infinite-scroll' | ||
3 | import { SharedModule } from '../shared' | 2 | import { SharedModule } from '../shared' |
4 | import { VideoService } from './shared' | ||
5 | import { VideoMiniatureComponent } from './video-list' | 3 | import { VideoMiniatureComponent } from './video-list' |
6 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' | 4 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
7 | import { VideoTrendingComponent } from './video-list/video-trending.component' | 5 | import { VideoTrendingComponent } from './video-list/video-trending.component' |
@@ -11,8 +9,7 @@ import { VideosComponent } from './videos.component' | |||
11 | @NgModule({ | 9 | @NgModule({ |
12 | imports: [ | 10 | imports: [ |
13 | VideosRoutingModule, | 11 | VideosRoutingModule, |
14 | SharedModule, | 12 | SharedModule |
15 | InfiniteScrollModule | ||
16 | ], | 13 | ], |
17 | 14 | ||
18 | declarations: [ | 15 | declarations: [ |
@@ -27,8 +24,6 @@ import { VideosComponent } from './videos.component' | |||
27 | VideosComponent | 24 | VideosComponent |
28 | ], | 25 | ], |
29 | 26 | ||
30 | providers: [ | 27 | providers: [] |
31 | VideoService | ||
32 | ] | ||
33 | }) | 28 | }) |
34 | export class VideosModule { } | 29 | export class VideosModule { } |