diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-05 16:08:43 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-05 16:08:43 +0200 |
commit | 1f0215a908c3b447cef03c10d4b089c0788922bd (patch) | |
tree | 2968e02707debeb91dfad0c5234da90d1e59ec38 /client/src | |
parent | c24ac1c18e26b6a24a4d294744908fb0c53ddf3c (diff) | |
download | PeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.tar.gz PeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.tar.zst PeerTube-1f0215a908c3b447cef03c10d4b089c0788922bd.zip |
Client: little refractoring
Diffstat (limited to 'client/src')
23 files changed, 57 insertions, 103 deletions
diff --git a/client/src/app/+admin/friends/friends.component.ts b/client/src/app/+admin/friends/friends.component.ts index bc3f54158..5ca29111c 100644 --- a/client/src/app/+admin/friends/friends.component.ts +++ b/client/src/app/+admin/friends/friends.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | 2 | ||
3 | @Component({ | 3 | @Component({ |
4 | template: '<router-outlet></router-outlet>' | 4 | template: '<router-outlet></router-outlet>' |
5 | }) | 5 | }) |
6 | 6 | ||
7 | export class FriendsComponent { | 7 | export class FriendsComponent { |
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index a92f9c231..da540bf9f 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -6,7 +6,6 @@ import { AuthHttp, RestExtractor, RestDataSource, User } from '../../../shared'; | |||
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
8 | export class UserService { | 8 | export class UserService { |
9 | // TODO: merge this constant with account | ||
10 | private static BASE_USERS_URL = '/api/v1/users/'; | 9 | private static BASE_USERS_URL = '/api/v1/users/'; |
11 | 10 | ||
12 | constructor( | 11 | constructor( |
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/users/user-list/user-list.component.scss index e9f61e900..71adef653 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.scss +++ b/client/src/app/+admin/users/user-list/user-list.component.scss | |||
@@ -1,7 +1,3 @@ | |||
1 | .glyphicon-remove { | ||
2 | cursor: pointer; | ||
3 | } | ||
4 | |||
5 | .add-user { | 1 | .add-user { |
6 | margin-top: 10px; | 2 | margin-top: 10px; |
7 | } | 3 | } |
diff --git a/client/src/app/+admin/users/users.component.ts b/client/src/app/+admin/users/users.component.ts index 37e3b158d..91af6c320 100644 --- a/client/src/app/+admin/users/users.component.ts +++ b/client/src/app/+admin/users/users.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | 2 | ||
3 | @Component({ | 3 | @Component({ |
4 | template: '<router-outlet></router-outlet>' | 4 | template: '<router-outlet></router-outlet>' |
5 | }) | 5 | }) |
6 | 6 | ||
7 | export class UsersComponent { | 7 | export class UsersComponent { |
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts index ac64c891f..21fb192e0 100644 --- a/client/src/app/+admin/users/users.routes.ts +++ b/client/src/app/+admin/users/users.routes.ts | |||
@@ -6,32 +6,32 @@ import { UserListComponent } from './user-list'; | |||
6 | 6 | ||
7 | export const UsersRoutes: Routes = [ | 7 | export const UsersRoutes: Routes = [ |
8 | { | 8 | { |
9 | path: 'users', | 9 | path: 'users', |
10 | component: UsersComponent, | 10 | component: UsersComponent, |
11 | children: [ | 11 | children: [ |
12 | { | 12 | { |
13 | path: '', | 13 | path: '', |
14 | redirectTo: 'list', | 14 | redirectTo: 'list', |
15 | pathMatch: 'full' | 15 | pathMatch: 'full' |
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | path: 'list', | 18 | path: 'list', |
19 | component: UserListComponent, | 19 | component: UserListComponent, |
20 | data: { | 20 | data: { |
21 | meta: { | 21 | meta: { |
22 | title: 'Users list' | 22 | title: 'Users list' |
23 | } | ||
24 | } | 23 | } |
25 | }, | 24 | } |
26 | { | 25 | }, |
27 | path: 'add', | 26 | { |
28 | component: UserAddComponent, | 27 | path: 'add', |
29 | data: { | 28 | component: UserAddComponent, |
30 | meta: { | 29 | data: { |
31 | title: 'Add a user' | 30 | meta: { |
32 | } | 31 | title: 'Add a user' |
33 | } | 32 | } |
34 | } | 33 | } |
35 | ] | 34 | } |
36 | } | 35 | ] |
36 | } | ||
37 | ]; | 37 | ]; |
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss deleted file mode 100644 index a094f74b8..000000000 --- a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.scss +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | .cell-id { | ||
2 | width: 40px; | ||
3 | } | ||
4 | |||
5 | .cell-reason { | ||
6 | width: 200px; | ||
7 | } | ||
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts index f59c4fffb..55d82f790 100644 --- a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts | |||
@@ -6,8 +6,7 @@ import { Utils, VideoAbuseService, VideoAbuse } from '../../../shared'; | |||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-video-abuse-list', | 8 | selector: 'my-video-abuse-list', |
9 | templateUrl: './video-abuse-list.component.html', | 9 | templateUrl: './video-abuse-list.component.html' |
10 | styleUrls: [ './video-abuse-list.component.scss' ] | ||
11 | }) | 10 | }) |
12 | export class VideoAbuseListComponent { | 11 | export class VideoAbuseListComponent { |
13 | videoAbusesSource = null; | 12 | videoAbusesSource = null; |
diff --git a/client/src/app/+admin/video-abuses/video-abuses.routes.ts b/client/src/app/+admin/video-abuses/video-abuses.routes.ts index c99e162be..1f19d7885 100644 --- a/client/src/app/+admin/video-abuses/video-abuses.routes.ts +++ b/client/src/app/+admin/video-abuses/video-abuses.routes.ts | |||
@@ -5,24 +5,24 @@ import { VideoAbuseListComponent } from './video-abuse-list'; | |||
5 | 5 | ||
6 | export const VideoAbusesRoutes: Routes = [ | 6 | export const VideoAbusesRoutes: Routes = [ |
7 | { | 7 | { |
8 | path: 'video-abuses', | 8 | path: 'video-abuses', |
9 | component: VideoAbusesComponent | 9 | component: VideoAbusesComponent |
10 | , | 10 | , |
11 | children: [ | 11 | children: [ |
12 | { | 12 | { |
13 | path: '', | 13 | path: '', |
14 | redirectTo: 'list', | 14 | redirectTo: 'list', |
15 | pathMatch: 'full' | 15 | pathMatch: 'full' |
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | path: 'list', | 18 | path: 'list', |
19 | component: VideoAbuseListComponent, | 19 | component: VideoAbuseListComponent, |
20 | data: { | 20 | data: { |
21 | meta: { | 21 | meta: { |
22 | title: 'Video abuses list' | 22 | title: 'Video abuses list' |
23 | } | ||
24 | } | 23 | } |
25 | } | 24 | } |
26 | ] | 25 | } |
27 | } | 26 | ] |
27 | } | ||
28 | ]; | 28 | ]; |
diff --git a/client/src/app/core/menu/menu-admin.component.html b/client/src/app/core/menu/menu-admin.component.html index 027799ee1..0dfe22d84 100644 --- a/client/src/app/core/menu/menu-admin.component.html +++ b/client/src/app/core/menu/menu-admin.component.html | |||
@@ -1,5 +1,4 @@ | |||
1 | <menu> | 1 | <menu> |
2 | |||
3 | <div class="panel-block"> | 2 | <div class="panel-block"> |
4 | <a routerLink="/admin/users/list" routerLinkActive="active"> | 3 | <a routerLink="/admin/users/list" routerLinkActive="active"> |
5 | <span class="hidden-xs glyphicon glyphicon-user"></span> | 4 | <span class="hidden-xs glyphicon glyphicon-user"></span> |
diff --git a/client/src/app/videos/shared/index.ts b/client/src/app/videos/shared/index.ts index beaa528c0..a68491022 100644 --- a/client/src/app/videos/shared/index.ts +++ b/client/src/app/videos/shared/index.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | export * from './loader'; | ||
2 | export * from './sort-field.type'; | 1 | export * from './sort-field.type'; |
3 | export * from './rate-type.type'; | 2 | export * from './rate-type.type'; |
4 | export * from './video.model'; | 3 | export * from './video.model'; |
diff --git a/client/src/app/videos/shared/loader/index.ts b/client/src/app/videos/shared/loader/index.ts deleted file mode 100644 index ab22584e4..000000000 --- a/client/src/app/videos/shared/loader/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './loader.component'; | ||
diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/videos/video-list/index.ts index 1f6d6a4e7..71d3b78e6 100644 --- a/client/src/app/videos/video-list/index.ts +++ b/client/src/app/videos/video-list/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './loader.component'; | ||
1 | export * from './video-list.component'; | 2 | export * from './video-list.component'; |
2 | export * from './video-miniature.component'; | 3 | export * from './video-miniature.component'; |
3 | export * from './video-sort.component'; | 4 | export * from './video-sort.component'; |
diff --git a/client/src/app/videos/shared/loader/loader.component.html b/client/src/app/videos/video-list/loader.component.html index 38d06950e..38d06950e 100644 --- a/client/src/app/videos/shared/loader/loader.component.html +++ b/client/src/app/videos/video-list/loader.component.html | |||
diff --git a/client/src/app/videos/shared/loader/loader.component.scss b/client/src/app/videos/video-list/loader.component.scss index 44cf1f9da..44cf1f9da 100644 --- a/client/src/app/videos/shared/loader/loader.component.scss +++ b/client/src/app/videos/video-list/loader.component.scss | |||
diff --git a/client/src/app/videos/shared/loader/loader.component.ts b/client/src/app/videos/video-list/loader.component.ts index e72d2f3f3..e72d2f3f3 100644 --- a/client/src/app/videos/shared/loader/loader.component.ts +++ b/client/src/app/videos/video-list/loader.component.ts | |||
diff --git a/client/src/app/videos/video-list/video-list.component.scss b/client/src/app/videos/video-list/video-list.component.scss index b48a4f125..4b4409602 100644 --- a/client/src/app/videos/video-list/video-list.component.scss +++ b/client/src/app/videos/video-list/video-list.component.scss | |||
@@ -23,19 +23,6 @@ | |||
23 | 23 | ||
24 | my-video-miniature { | 24 | my-video-miniature { |
25 | text-align: left; | 25 | text-align: left; |
26 | transition: all 0.5s ease; | ||
27 | |||
28 | &.ng-enter { | ||
29 | opacity: 0; | ||
30 | } | ||
31 | |||
32 | &.ng-enter-active { | ||
33 | opacity: 1; | ||
34 | } | ||
35 | |||
36 | &.ng-leave { | ||
37 | opacity: 0; | ||
38 | } | ||
39 | } | 26 | } |
40 | 27 | ||
41 | .no-video { | 28 | .no-video { |
diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index 16e1b5bcc..16a40bdc4 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts | |||
@@ -76,10 +76,7 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
76 | this.loading.next(true); | 76 | this.loading.next(true); |
77 | this.videos = []; | 77 | this.videos = []; |
78 | 78 | ||
79 | this.changeDetector.detectChanges(); | ||
80 | |||
81 | let observable = null; | 79 | let observable = null; |
82 | |||
83 | if (this.search.value) { | 80 | if (this.search.value) { |
84 | observable = this.videoService.searchVideos(this.search, this.pagination, this.sort); | 81 | observable = this.videoService.searchVideos(this.search, this.pagination, this.sort); |
85 | } else { | 82 | } else { |
@@ -150,8 +147,6 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
150 | } else { | 147 | } else { |
151 | this.pagination.currentPage = 1; | 148 | this.pagination.currentPage = 1; |
152 | } | 149 | } |
153 | |||
154 | this.changeDetector.detectChanges(); | ||
155 | } | 150 | } |
156 | 151 | ||
157 | private navigateToNewParams() { | 152 | private navigateToNewParams() { |
diff --git a/client/src/app/videos/video-list/video-miniature.component.html b/client/src/app/videos/video-list/video-miniature.component.html index 1d3451c2b..648ef61b1 100644 --- a/client/src/app/videos/video-list/video-miniature.component.html +++ b/client/src/app/videos/video-list/video-miniature.component.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <div class="video-miniature" (mouseenter)="onHover()" (mouseleave)="onBlur()"> | 1 | <div class="video-miniature"> |
2 | <a | 2 | <a |
3 | [routerLink]="['/videos/watch', video.id]" [attr.title]="video.description" | 3 | [routerLink]="['/videos/watch', video.id]" [attr.title]="video.description" |
4 | class="video-miniature-thumbnail" | 4 | class="video-miniature-thumbnail" |
diff --git a/client/src/app/videos/video-list/video-miniature.component.scss b/client/src/app/videos/video-list/video-miniature.component.scss index f7fecdc35..c2743c3be 100644 --- a/client/src/app/videos/video-list/video-miniature.component.scss +++ b/client/src/app/videos/video-list/video-miniature.component.scss | |||
@@ -1,5 +1,3 @@ | |||
1 | @import "../../../sass/pre-customizations.scss"; | ||
2 | |||
3 | .video-miniature { | 1 | .video-miniature { |
4 | margin-top: 30px; | 2 | margin-top: 30px; |
5 | display: inline-block; | 3 | display: inline-block; |
@@ -71,7 +69,7 @@ | |||
71 | } | 69 | } |
72 | 70 | ||
73 | .video-miniature-tags { | 71 | .video-miniature-tags { |
74 | // Fix for chrome when tags a long | 72 | // Fix for chrome when tags are long |
75 | width: 201px; | 73 | width: 201px; |
76 | 74 | ||
77 | .video-miniature-tag { | 75 | .video-miniature-tag { |
@@ -81,7 +79,6 @@ | |||
81 | top: -2px; | 79 | top: -2px; |
82 | 80 | ||
83 | .label { | 81 | .label { |
84 | line-height: $line-height-base; | ||
85 | transition: background-color 0.2s; | 82 | transition: background-color 0.2s; |
86 | } | 83 | } |
87 | } | 84 | } |
diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts index 13deec381..28601ca7f 100644 --- a/client/src/app/videos/video-list/video-miniature.component.ts +++ b/client/src/app/videos/video-list/video-miniature.component.ts | |||
@@ -17,8 +17,6 @@ export class VideoMiniatureComponent { | |||
17 | @Input() user: User; | 17 | @Input() user: User; |
18 | @Input() video: Video; | 18 | @Input() video: Video; |
19 | 19 | ||
20 | hovering = false; | ||
21 | |||
22 | constructor( | 20 | constructor( |
23 | private notificationsService: NotificationsService, | 21 | private notificationsService: NotificationsService, |
24 | private confirmService: ConfirmService, | 22 | private confirmService: ConfirmService, |
@@ -33,14 +31,6 @@ export class VideoMiniatureComponent { | |||
33 | return this.video.name; | 31 | return this.video.name; |
34 | } | 32 | } |
35 | 33 | ||
36 | onBlur() { | ||
37 | this.hovering = false; | ||
38 | } | ||
39 | |||
40 | onHover() { | ||
41 | this.hovering = true; | ||
42 | } | ||
43 | |||
44 | isVideoNSFWForThisUser() { | 34 | isVideoNSFWForThisUser() { |
45 | return this.video.isVideoNSFWForUser(this.user); | 35 | return this.video.isVideoNSFWForUser(this.user); |
46 | } | 36 | } |
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html index 13f6719bb..62f27ba48 100644 --- a/client/src/app/videos/video-watch/video-watch.component.html +++ b/client/src/app/videos/video-watch/video-watch.component.html | |||
@@ -22,12 +22,14 @@ | |||
22 | <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div> | 22 | <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div> |
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | <!-- P2P informations --> | ||
25 | <div id="torrent-info" class="row"> | 26 | <div id="torrent-info" class="row"> |
26 | <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div> | 27 | <div id="torrent-info-download" class="col-md-4 col-sm-4 col-xs-4">Download: {{ downloadSpeed | bytes }}/s</div> |
27 | <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div> | 28 | <div id="torrent-info-upload" class="col-md-4 col-sm-4 col-xs-4">Upload: {{ uploadSpeed | bytes }}/s</div> |
28 | <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div> | 29 | <div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div> |
29 | </div> | 30 | </div> |
30 | 31 | ||
32 | <!-- Video informations --> | ||
31 | <div *ngIf="video !== null" id="video-info"> | 33 | <div *ngIf="video !== null" id="video-info"> |
32 | <div class="row video-name-views"> | 34 | <div class="row video-name-views"> |
33 | <div class="col-xs-8 col-md-8 video-name"> | 35 | <div class="col-xs-8 col-md-8 video-name"> |
diff --git a/client/src/app/videos/video-watch/video-watch.component.scss b/client/src/app/videos/video-watch/video-watch.component.scss index 767a3ed4e..789260a91 100644 --- a/client/src/app/videos/video-watch/video-watch.component.scss +++ b/client/src/app/videos/video-watch/video-watch.component.scss | |||
@@ -13,6 +13,10 @@ | |||
13 | 13 | ||
14 | .embed-responsive { | 14 | .embed-responsive { |
15 | height: 500px; | 15 | height: 500px; |
16 | |||
17 | @media screen and (max-width: 600px) { | ||
18 | height: 300px; | ||
19 | } | ||
16 | } | 20 | } |
17 | 21 | ||
18 | #torrent-info { | 22 | #torrent-info { |
@@ -25,12 +29,6 @@ | |||
25 | } | 29 | } |
26 | } | 30 | } |
27 | 31 | ||
28 | .embed-responsive { | ||
29 | @media screen and (max-width: 600px) { | ||
30 | height: 300px; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | #video-info { | 32 | #video-info { |
35 | .video-name-views { | 33 | .video-name-views { |
36 | font-weight: bold; | 34 | font-weight: bold; |
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts index 04a06e0a3..adfbe7031 100644 --- a/client/src/app/videos/videos.module.ts +++ b/client/src/app/videos/videos.module.ts | |||
@@ -5,7 +5,7 @@ import { TagInputModule } from 'ng2-tag-input'; | |||
5 | import { VideosRoutingModule } from './videos-routing.module'; | 5 | import { VideosRoutingModule } from './videos-routing.module'; |
6 | import { VideosComponent } from './videos.component'; | 6 | import { VideosComponent } from './videos.component'; |
7 | import { VideoAddComponent, VideoUpdateComponent } from './video-edit'; | 7 | import { VideoAddComponent, VideoUpdateComponent } from './video-edit'; |
8 | import { VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list'; | 8 | import { LoaderComponent, VideoListComponent, VideoMiniatureComponent, VideoSortComponent } from './video-list'; |
9 | import { | 9 | import { |
10 | VideoWatchComponent, | 10 | VideoWatchComponent, |
11 | VideoMagnetComponent, | 11 | VideoMagnetComponent, |
@@ -13,7 +13,7 @@ import { | |||
13 | VideoShareComponent, | 13 | VideoShareComponent, |
14 | WebTorrentService | 14 | WebTorrentService |
15 | } from './video-watch'; | 15 | } from './video-watch'; |
16 | import { LoaderComponent, VideoService } from './shared'; | 16 | import { VideoService } from './shared'; |
17 | import { SharedModule } from '../shared'; | 17 | import { SharedModule } from '../shared'; |
18 | 18 | ||
19 | @NgModule({ | 19 | @NgModule({ |