Make the sort/results bar less ugly
This commit is contained in:
parent
aff038cd78
commit
a99593ed9f
|
@ -53,6 +53,7 @@ export class AppComponent {
|
||||||
constructor(private _friendsService: FriendsService,
|
constructor(private _friendsService: FriendsService,
|
||||||
private _authService: AuthService,
|
private _authService: AuthService,
|
||||||
private _router: Router
|
private _router: Router
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.isLoggedIn = this._authService.isLoggedIn();
|
this.isLoggedIn = this._authService.isLoggedIn();
|
||||||
|
|
||||||
|
@ -67,7 +68,11 @@ export class AppComponent {
|
||||||
|
|
||||||
onSearch(search: Search) {
|
onSearch(search: Search) {
|
||||||
if (search.value !== '') {
|
if (search.value !== '') {
|
||||||
this._router.navigate(['VideosList', { search: search.value, field: search.field }]);
|
const params = {
|
||||||
|
search: search.value,
|
||||||
|
field: search.field
|
||||||
|
};
|
||||||
|
this._router.navigate(['VideosList', params]);
|
||||||
} else {
|
} else {
|
||||||
this._router.navigate(['VideosList']);
|
this._router.navigate(['VideosList']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<select [(ngModel)]="currentSort" (ngModelChange)="onSortChange()">
|
<select class="form-control input-sm" [(ngModel)]="currentSort" (ngModelChange)="onSortChange()">
|
||||||
<option *ngFor="let choice of choiceKeys" [value]="choice">
|
<option *ngFor="let choice of choiceKeys" [value]="choice">
|
||||||
{{ getStringChoice(choice) }}
|
{{ getStringChoice(choice) }}
|
||||||
</option>
|
</option>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="videos-info">
|
<div class="row videos-info">
|
||||||
<span class="videos-total-results"> {{ pagination.total }}</span>
|
<div class="col-md-9 videos-total-results"> {{ pagination.total }} videos</div>
|
||||||
<my-video-sort [currentSort]="sort" (sort)="onSort($event)"></my-video-sort>
|
<my-video-sort class="col-md-3" [currentSort]="sort" (sort)="onSort($event)"></my-video-sort>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="videos-miniatures">
|
<div class="videos-miniatures">
|
||||||
|
|
|
@ -10,3 +10,23 @@ pagination {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.videos-info {
|
||||||
|
|
||||||
|
padding-bottom: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-bottom: 1px solid #f1f1f1;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
width: 765px;
|
||||||
|
margin-left: 15px;
|
||||||
|
|
||||||
|
my-video-sort {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.videos-total-results {
|
||||||
|
font-size: 13px;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -78,7 +78,17 @@ export class VideosListComponent implements OnInit {
|
||||||
|
|
||||||
onSort(sort: SortField) {
|
onSort(sort: SortField) {
|
||||||
this.sort = sort;
|
this.sort = sort;
|
||||||
this._router.navigate(['VideosList', { sort: this.sort }]);
|
|
||||||
|
const params: any = {
|
||||||
|
sort: this.sort
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.search.value) {
|
||||||
|
params.search = this.search.value;
|
||||||
|
params.field = this.search.field;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._router.navigate(['VideosList', params]);
|
||||||
this.getVideos();
|
this.getVideos();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user