diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 14:46:22 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-01 14:46:22 +0100 |
commit | 9bf9d2a5c223bf006496ae7adf0c0bd7a7975108 (patch) | |
tree | 7e72814af43176ad96841046a9310af001d23a14 /client/src/app/videos/video-list/shared/video-sort.component.ts | |
parent | 26c6ee80d0fecfce595e8970f15717560b4f4ceb (diff) | |
download | PeerTube-9bf9d2a5c223bf006496ae7adf0c0bd7a7975108.tar.gz PeerTube-9bf9d2a5c223bf006496ae7adf0c0bd7a7975108.tar.zst PeerTube-9bf9d2a5c223bf006496ae7adf0c0bd7a7975108.zip |
Begin videos list new design
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 | } | ||