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=ca94b07c2e7aa190ee061eb68c0493825883917c;hpb=ec8d8440a893ba64075da2e57ea04c7976e0b303;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 ca94b07c2..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', - 'createdDate': 'Created Date - Asc', - '-createdDate': 'Created Date - Desc' - }; + 'createdAt': 'Created Date - Asc', + '-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) } }