diff options
Diffstat (limited to 'client/src/app/videos/video-list/shared/video-sort.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/shared/video-sort.component.ts | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/client/src/app/videos/video-list/shared/video-sort.component.ts b/client/src/app/videos/video-list/shared/video-sort.component.ts deleted file mode 100644 index 8aa89d32b..000000000 --- a/client/src/app/videos/video-list/shared/video-sort.component.ts +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | import { Component, EventEmitter, Input, Output } from '@angular/core' | ||
2 | |||
3 | import { SortField } from '../../shared' | ||
4 | |||
5 | @Component({ | ||
6 | selector: 'my-video-sort', | ||
7 | templateUrl: './video-sort.component.html' | ||
8 | }) | ||
9 | |||
10 | export class VideoSortComponent { | ||
11 | @Output() sort = new EventEmitter<any>() | ||
12 | |||
13 | @Input() currentSort: SortField | ||
14 | |||
15 | sortChoices: { [ P in SortField ]: string } = { | ||
16 | 'name': 'Name - Asc', | ||
17 | '-name': 'Name - Desc', | ||
18 | 'duration': 'Duration - Asc', | ||
19 | '-duration': 'Duration - Desc', | ||
20 | 'createdAt': 'Created Date - Asc', | ||
21 | '-createdAt': 'Created Date - Desc', | ||
22 | 'views': 'Views - Asc', | ||
23 | '-views': 'Views - Desc', | ||
24 | 'likes': 'Likes - Asc', | ||
25 | '-likes': 'Likes - Desc' | ||
26 | } | ||
27 | |||
28 | get choiceKeys () { | ||
29 | return Object.keys(this.sortChoices) | ||
30 | } | ||
31 | |||
32 | getStringChoice (choiceKey: SortField) { | ||
33 | return this.sortChoices[choiceKey] | ||
34 | } | ||
35 | |||
36 | onSortChange () { | ||
37 | this.sort.emit(this.currentSort) | ||
38 | } | ||
39 | } | ||