X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-list%2Fvideo-sort.component.ts;h=64916bf1668e5c00217de70e5344612064da22a3;hb=df98563e2104b82b119c00a3cd83cd0dc1242d25;hp=53951deb440f132c4e199466d2c7dc4467254a4a;hpb=99fe265a5fc077cb66c322e7f3d191ff7110aea0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/video-list/video-sort.component.ts b/client/src/app/videos/video-list/video-sort.component.ts index 53951deb4..64916bf16 100644 --- a/client/src/app/videos/video-list/video-sort.component.ts +++ b/client/src/app/videos/video-list/video-sort.component.ts @@ -1,6 +1,6 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core' -import { SortField } from '../shared'; +import { SortField } from '../shared' @Component({ selector: 'my-video-sort', @@ -8,28 +8,32 @@ import { SortField } from '../shared'; }) export class VideoSortComponent { - @Output() sort = new EventEmitter(); + @Output() sort = new EventEmitter() - @Input() currentSort: SortField; + @Input() currentSort: SortField - sortChoices = { + sortChoices: { [ P in SortField ]: string } = { 'name': 'Name - Asc', '-name': 'Name - Desc', 'duration': 'Duration - Asc', '-duration': 'Duration - Desc', 'createdAt': 'Created Date - Asc', - '-createdAt': 'Created Date - Desc' - }; + '-createdAt': 'Created Date - Desc', + 'views': 'Views - Asc', + '-views': 'Views - Desc', + 'likes': 'Likes - Asc', + '-likes': 'Likes - Desc' + } - get choiceKeys() { - return Object.keys(this.sortChoices); + get choiceKeys () { + return Object.keys(this.sortChoices) } - getStringChoice(choiceKey: SortField) { - return this.sortChoices[choiceKey]; + getStringChoice (choiceKey: SortField) { + return this.sortChoices[choiceKey] } - onSortChange() { - this.sort.emit(this.currentSort); + onSortChange () { + this.sort.emit(this.currentSort) } }