diff options
Diffstat (limited to 'client/angular')
5 files changed, 41 insertions, 6 deletions
diff --git a/client/angular/app/app.component.ts b/client/angular/app/app.component.ts index 3a6df844a..722d0dca0 100644 --- a/client/angular/app/app.component.ts +++ b/client/angular/app/app.component.ts | |||
@@ -53,6 +53,7 @@ export class AppComponent { | |||
53 | constructor(private _friendsService: FriendsService, | 53 | constructor(private _friendsService: FriendsService, |
54 | private _authService: AuthService, | 54 | private _authService: AuthService, |
55 | private _router: Router | 55 | private _router: Router |
56 | |||
56 | ) { | 57 | ) { |
57 | this.isLoggedIn = this._authService.isLoggedIn(); | 58 | this.isLoggedIn = this._authService.isLoggedIn(); |
58 | 59 | ||
@@ -67,7 +68,11 @@ export class AppComponent { | |||
67 | 68 | ||
68 | onSearch(search: Search) { | 69 | onSearch(search: Search) { |
69 | if (search.value !== '') { | 70 | if (search.value !== '') { |
70 | this._router.navigate(['VideosList', { search: search.value, field: search.field }]); | 71 | const params = { |
72 | search: search.value, | ||
73 | field: search.field | ||
74 | }; | ||
75 | this._router.navigate(['VideosList', params]); | ||
71 | } else { | 76 | } else { |
72 | this._router.navigate(['VideosList']); | 77 | this._router.navigate(['VideosList']); |
73 | } | 78 | } |
diff --git a/client/angular/videos/components/list/video-sort.component.html b/client/angular/videos/components/list/video-sort.component.html index b1392ccca..3bece0b22 100644 --- a/client/angular/videos/components/list/video-sort.component.html +++ b/client/angular/videos/components/list/video-sort.component.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <select [(ngModel)]="currentSort" (ngModelChange)="onSortChange()"> | 1 | <select class="form-control input-sm" [(ngModel)]="currentSort" (ngModelChange)="onSortChange()"> |
2 | <option *ngFor="let choice of choiceKeys" [value]="choice"> | 2 | <option *ngFor="let choice of choiceKeys" [value]="choice"> |
3 | {{ getStringChoice(choice) }} | 3 | {{ getStringChoice(choice) }} |
4 | </option> | 4 | </option> |
diff --git a/client/angular/videos/components/list/videos-list.component.html b/client/angular/videos/components/list/videos-list.component.html index 5524ab546..3e30b39b0 100644 --- a/client/angular/videos/components/list/videos-list.component.html +++ b/client/angular/videos/components/list/videos-list.component.html | |||
@@ -1,6 +1,6 @@ | |||
1 | <div class="videos-info"> | 1 | <div class="row videos-info"> |
2 | <span class="videos-total-results"> {{ pagination.total }}</span> | 2 | <div class="col-md-9 videos-total-results"> {{ pagination.total }} videos</div> |
3 | <my-video-sort [currentSort]="sort" (sort)="onSort($event)"></my-video-sort> | 3 | <my-video-sort class="col-md-3" [currentSort]="sort" (sort)="onSort($event)"></my-video-sort> |
4 | </div> | 4 | </div> |
5 | 5 | ||
6 | <div class="videos-miniatures"> | 6 | <div class="videos-miniatures"> |
diff --git a/client/angular/videos/components/list/videos-list.component.scss b/client/angular/videos/components/list/videos-list.component.scss index 05c38b833..2abc47b1b 100644 --- a/client/angular/videos/components/list/videos-list.component.scss +++ b/client/angular/videos/components/list/videos-list.component.scss | |||
@@ -10,3 +10,23 @@ pagination { | |||
10 | display: block; | 10 | display: block; |
11 | text-align: center; | 11 | text-align: center; |
12 | } | 12 | } |
13 | |||
14 | .videos-info { | ||
15 | |||
16 | padding-bottom: 20px; | ||
17 | margin-bottom: 20px; | ||
18 | border-bottom: 1px solid #f1f1f1; | ||
19 | height: 40px; | ||
20 | line-height: 40px; | ||
21 | width: 765px; | ||
22 | margin-left: 15px; | ||
23 | |||
24 | my-video-sort { | ||
25 | padding-right: 0; | ||
26 | } | ||
27 | |||
28 | .videos-total-results { | ||
29 | font-size: 13px; | ||
30 | padding-left: 0; | ||
31 | } | ||
32 | } | ||
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts index db64a856e..94b064e16 100644 --- a/client/angular/videos/components/list/videos-list.component.ts +++ b/client/angular/videos/components/list/videos-list.component.ts | |||
@@ -78,7 +78,17 @@ export class VideosListComponent implements OnInit { | |||
78 | 78 | ||
79 | onSort(sort: SortField) { | 79 | onSort(sort: SortField) { |
80 | this.sort = sort; | 80 | this.sort = sort; |
81 | this._router.navigate(['VideosList', { sort: this.sort }]); | 81 | |
82 | const params: any = { | ||
83 | sort: this.sort | ||
84 | }; | ||
85 | |||
86 | if (this.search.value) { | ||
87 | params.search = this.search.value; | ||
88 | params.field = this.search.field; | ||
89 | } | ||
90 | |||
91 | this._router.navigate(['VideosList', params]); | ||
82 | this.getVideos(); | 92 | this.getVideos(); |
83 | } | 93 | } |
84 | } | 94 | } |