aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-01 18:56:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-01 18:56:26 +0100
commit202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7 (patch)
tree605df063371b6be32ca0773bf2917b0c5d9163ae
parentc30745f342480b59fb0856a059c8c2fbffbcfc6a (diff)
downloadPeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.gz
PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.tar.zst
PeerTube-202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7.zip
Begin videos of an account
-rw-r--r--client/src/app/account/account-routing.module.ts19
-rw-r--r--client/src/app/account/account-videos/account-videos.component.html9
-rw-r--r--client/src/app/account/account-videos/account-videos.component.scss (renamed from client/src/app/videos/video-list/shared/abstract-video-list.scss)0
-rw-r--r--client/src/app/account/account-videos/account-videos.component.ts35
-rw-r--r--client/src/app/account/account.module.ts4
-rw-r--r--client/src/app/shared/shared.module.ts12
-rw-r--r--client/src/app/shared/video/abstract-video-list.html (renamed from client/src/app/videos/video-list/shared/abstract-video-list.html)0
-rw-r--r--client/src/app/shared/video/abstract-video-list.scss0
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts (renamed from client/src/app/videos/video-list/shared/abstract-video-list.ts)8
-rw-r--r--client/src/app/shared/video/sort-field.type.ts (renamed from client/src/app/videos/shared/sort-field.type.ts)0
-rw-r--r--client/src/app/shared/video/video-details.model.ts (renamed from client/src/app/videos/shared/video-details.model.ts)2
-rw-r--r--client/src/app/shared/video/video-edit.model.ts (renamed from client/src/app/videos/shared/video-edit.model.ts)0
-rw-r--r--client/src/app/shared/video/video-pagination.model.ts (renamed from client/src/app/videos/shared/video-pagination.model.ts)0
-rw-r--r--client/src/app/shared/video/video-thumbnail.component.html10
-rw-r--r--client/src/app/shared/video/video-thumbnail.component.scss28
-rw-r--r--client/src/app/shared/video/video-thumbnail.component.ts12
-rw-r--r--client/src/app/shared/video/video.model.ts (renamed from client/src/app/videos/shared/video.model.ts)2
-rw-r--r--client/src/app/shared/video/video.service.ts (renamed from client/src/app/videos/shared/video.service.ts)32
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.module.ts3
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts22
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts19
-rw-r--r--client/src/app/videos/+video-watch/video-download.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/video-report.component.ts8
-rw-r--r--client/src/app/videos/+video-watch/video-share.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/video-watch.module.ts5
-rw-r--r--client/src/app/videos/shared/index.ts6
-rw-r--r--client/src/app/videos/video-list/shared/index.ts1
-rw-r--r--client/src/app/videos/video-list/shared/video-miniature.component.html11
-rw-r--r--client/src/app/videos/video-list/shared/video-miniature.component.scss29
-rw-r--r--client/src/app/videos/video-list/shared/video-miniature.component.ts4
-rw-r--r--client/src/app/videos/video-list/video-recently-added.component.ts8
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts8
-rw-r--r--client/src/app/videos/videos.module.ts9
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'
6import { LoginGuard } from '../core' 6import { LoginGuard } from '../core'
7import { AccountComponent } from './account.component' 7import { AccountComponent } from './account.component'
8import { AccountSettingsComponent } from './account-settings/account-settings.component' 8import { AccountSettingsComponent } from './account-settings/account-settings.component'
9import { AccountVideosComponent } from './account-videos/account-videos.component'
9 10
10const accountRoutes: Routes = [ 11const 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 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { AbstractVideoList } from '../../shared/video/abstract-video-list'
3import { ActivatedRoute } from '@angular/router'
4import { Router } from '@angular/router'
5import { NotificationsService } from 'angular2-notifications'
6import { 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})
13export 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
6import { AccountSettingsComponent } from './account-settings/account-settings.component' 6import { AccountSettingsComponent } from './account-settings/account-settings.component'
7import { AccountComponent } from './account.component' 7import { AccountComponent } from './account.component'
8import { AccountService } from './account.service' 8import { AccountService } from './account.service'
9import { 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'
20import { UserService } from './users' 20import { UserService } from './users'
21import { VideoAbuseService } from './video-abuse' 21import { VideoAbuseService } from './video-abuse'
22import { VideoBlacklistService } from './video-blacklist' 22import { VideoBlacklistService } from './video-blacklist'
23import { VideoThumbnailComponent } from './video/video-thumbnail.component'
24import { VideoService } from './video/video.service'
25import { 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})
81export class SharedModule { } 89export 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 @@
1import { OnDestroy, OnInit } from '@angular/core' 1import { OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3
4import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
5import { Observable } from 'rxjs/Observable' 4import { Observable } from 'rxjs/Observable'
6import { Subscription } from 'rxjs/Subscription' 5import { Subscription } from 'rxjs/Subscription'
7 6import { SortField } from './sort-field.type'
8import { SortField, Video, VideoPagination } from '../../shared' 7import { VideoPagination } from './video-pagination.model'
8import { Video } from './video.model'
9 9
10export abstract class AbstractVideoList implements OnInit, OnDestroy { 10export 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 @@
1import { Video } from './video.model' 1import { Video } from '../../shared/video/video.model'
2import { AuthUser } from '../../core' 2import { AuthUser } from '../../core'
3import { 3import {
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"
3class="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 @@
1import { Component, Input } from '@angular/core'
2import { 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})
9export 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 @@
1import { Video as VideoServerModel } from '../../../../../shared' 1import { Video as VideoServerModel } from '../../../../../shared'
2import { User } from '../../shared' 2import { User } from '../'
3 3
4export class Video implements VideoServerModel { 4export 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 @@
1import { Injectable } from '@angular/core'
2import { Observable } from 'rxjs/Observable'
3import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' 1import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'
2import { Injectable } from '@angular/core'
4import 'rxjs/add/operator/catch' 3import 'rxjs/add/operator/catch'
5import 'rxjs/add/operator/map' 4import 'rxjs/add/operator/map'
6 5import { Observable } from 'rxjs/Observable'
6import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } from '../../../../../shared'
7import { ResultList } from '../../../../../shared/models/result-list.model'
8import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model'
9import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model'
10import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type'
11import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model'
12import { RestExtractor } from '../rest/rest-extractor.service'
13import { RestService } from '../rest/rest.service'
14import { Search } from '../search/search.model'
15import { UserService } from '../users/user.service'
7import { SortField } from './sort-field.type' 16import { SortField } from './sort-field.type'
8import {
9 RestExtractor,
10 RestService,
11 UserService,
12 Search
13} from '../../shared'
14import { Video } from './video.model'
15import { VideoDetails } from './video-details.model' 17import { VideoDetails } from './video-details.model'
16import { VideoEdit } from './video-edit.model' 18import { VideoEdit } from './video-edit.model'
17import { VideoPagination } from './video-pagination.model' 19import { VideoPagination } from './video-pagination.model'
18import { 20import { 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()
29export class VideoService { 23export 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'
3import { TagInputModule } from 'ngx-chips' 3import { TagInputModule } from 'ngx-chips'
4import { TabsModule } from 'ngx-bootstrap/tabs' 4import { TabsModule } from 'ngx-bootstrap/tabs'
5 5
6import { VideoService, MarkdownService, VideoDescriptionComponent } from '../../shared' 6import { MarkdownService, VideoDescriptionComponent } from '../../shared'
7import { SharedModule } from '../../../shared' 7import { 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 @@
1import { HttpEventType, HttpResponse } from '@angular/common/http'
1import { Component, OnInit, ViewChild } from '@angular/core' 2import { Component, OnInit, ViewChild } from '@angular/core'
2import { FormBuilder, FormGroup } from '@angular/forms' 3import { FormBuilder, FormGroup } from '@angular/forms'
3import { Router } from '@angular/router' 4import { Router } from '@angular/router'
4
5import { NotificationsService } from 'angular2-notifications' 5import { NotificationsService } from 'angular2-notifications'
6 6import { VideoService } from 'app/shared/video/video.service'
7import { VideoCreate } from '../../../../../shared'
8import { AuthService, ServerService } from '../../core'
7import { 9import {
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'
19import { AuthService, ServerService } from '../../core'
20import { VideoService } from '../shared'
21import { VideoCreate } from '../../../../../shared'
22import { 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 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { FormBuilder, FormGroup } from '@angular/forms' 2import { FormBuilder, FormGroup } from '@angular/forms'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import 'rxjs/add/observable/forkJoin'
5
6import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
7 5import 'rxjs/add/observable/forkJoin'
6import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum'
8import { ServerService } from '../../core' 7import { ServerService } from '../../core'
9import { 8import {
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'
19import { VideoEdit, VideoService } from '../shared' 18import { VideoService } from '../../shared/video/video.service'
20import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' 19import { 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 @@
1import { Component, Input, ViewChild } from '@angular/core' 1import { Component, Input, ViewChild } from '@angular/core'
2
3import { ModalDirective } from 'ngx-bootstrap/modal' 2import { ModalDirective } from 'ngx-bootstrap/modal'
4 3import { VideoDetails } from '../../shared/video/video-details.model'
5import { 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 @@
1import { Component, Input, OnInit, ViewChild } from '@angular/core' 1import { Component, Input, OnInit, ViewChild } from '@angular/core'
2import { FormBuilder, FormGroup } from '@angular/forms' 2import { FormBuilder, FormGroup } from '@angular/forms'
3
4import { ModalDirective } from 'ngx-bootstrap/modal'
5import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
6 4import { ModalDirective } from 'ngx-bootstrap/modal'
7import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared' 5import { FormReactive, VIDEO_ABUSE_REASON, VideoAbuseService } from '../../shared'
8import { VideoDetails, VideoService } from '../shared' 6import { 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 @@
1import { Component, Input, ViewChild } from '@angular/core' 1import { Component, Input, ViewChild } from '@angular/core'
2
3import { ModalDirective } from 'ngx-bootstrap/modal' 2import { ModalDirective } from 'ngx-bootstrap/modal'
4 3import { VideoDetails } from '../../shared/video/video-details.model'
5import { 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
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { MetaService } from '@ngx-meta/core' 3import { MetaService } from '@ngx-meta/core'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
5import { VideoService } from 'app/shared/video/video.service'
5import { Observable } from 'rxjs/Observable' 6import { Observable } from 'rxjs/Observable'
6import { Subscription } from 'rxjs/Subscription' 7import { Subscription } from 'rxjs/Subscription'
7import videojs from 'video.js' 8import videojs from 'video.js'
@@ -9,10 +10,11 @@ import { UserVideoRateType, VideoRateType } from '../../../../../shared'
9import '../../../assets/player/peertube-videojs-plugin' 10import '../../../assets/player/peertube-videojs-plugin'
10import { AuthService, ConfirmService } from '../../core' 11import { AuthService, ConfirmService } from '../../core'
11import { VideoBlacklistService } from '../../shared' 12import { VideoBlacklistService } from '../../shared'
12import { MarkdownService, VideoDetails, VideoService } from '../shared' 13import { MarkdownService } from '../shared'
13import { VideoDownloadComponent } from './video-download.component' 14import { VideoDownloadComponent } from './video-download.component'
14import { VideoReportComponent } from './video-report.component' 15import { VideoReportComponent } from './video-report.component'
15import { VideoShareComponent } from './video-share.component' 16import { VideoShareComponent } from './video-share.component'
17import { 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 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2 2
3import { VideoWatchRoutingModule } from './video-watch-routing.module' 3import { VideoWatchRoutingModule } from './video-watch-routing.module'
4import { VideoService, MarkdownService } from '../shared' 4import { MarkdownService } from '../shared'
5import { SharedModule } from '../../shared' 5import { SharedModule } from '../../shared'
6 6
7import { VideoWatchComponent } from './video-watch.component' 7import { 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})
35export class VideoWatchModule { } 34export 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 @@
1export * from './sort-field.type'
2export * from './markdown.service' 1export * from './markdown.service'
3export * from './video.model'
4export * from './video-details.model'
5export * from './video-edit.model'
6export * from './video.service'
7export * from './video-description.component' 2export * from './video-description.component'
8export * 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 @@
1export * from './abstract-video-list'
2export * 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 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2
3import { SortField, Video } from '../../shared'
4import { User } from '../../../shared' 2import { User } from '../../../shared'
3import { SortField } from '../../../shared/video/sort-field.type'
4import { 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 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { VideoService } from '../shared' 4import { VideoService } from '../../shared/video/video.service'
5import { AbstractVideoList } from './shared' 5import { 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})
12export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { 12export 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 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { VideoService } from '../shared' 4import { VideoService } from '../../shared/video/video.service'
5import { AbstractVideoList } from './shared' 5import { 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})
12export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { 12export 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 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { InfiniteScrollModule } from 'ngx-infinite-scroll'
3import { SharedModule } from '../shared' 2import { SharedModule } from '../shared'
4import { VideoService } from './shared'
5import { VideoMiniatureComponent } from './video-list' 3import { VideoMiniatureComponent } from './video-list'
6import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' 4import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
7import { VideoTrendingComponent } from './video-list/video-trending.component' 5import { 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})
34export class VideosModule { } 29export class VideosModule { }