aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/search-filters.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-24 10:13:54 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:04:05 +0200
commitcddf45035389cc7d9003ea2b64fff3c28cd368d9 (patch)
tree89e1485a34264b6a2d8052c4cc0c179cbfbd8381 /client/src/app/search/search-filters.component.ts
parent8cd72bd37724054f8942f2fefc7aa2e60eca74cf (diff)
downloadPeerTube-cddf45035389cc7d9003ea2b64fff3c28cd368d9.tar.gz
PeerTube-cddf45035389cc7d9003ea2b64fff3c28cd368d9.tar.zst
PeerTube-cddf45035389cc7d9003ea2b64fff3c28cd368d9.zip
Add ability to sort the search
Diffstat (limited to 'client/src/app/search/search-filters.component.ts')
-rw-r--r--client/src/app/search/search-filters.component.ts22
1 files changed, 19 insertions, 3 deletions
diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts
index 4219f99a9..a40648eb4 100644
--- a/client/src/app/search/search-filters.component.ts
+++ b/client/src/app/search/search-filters.component.ts
@@ -23,6 +23,7 @@ export class SearchFiltersComponent implements OnInit {
23 videoLanguages: VideoConstant<string>[] = [] 23 videoLanguages: VideoConstant<string>[] = []
24 24
25 publishedDateRanges: { id: string, label: string }[] = [] 25 publishedDateRanges: { id: string, label: string }[] = []
26 sorts: { id: string, label: string }[] = []
26 durationRanges: { id: string, label: string }[] = [] 27 durationRanges: { id: string, label: string }[] = []
27 28
28 publishedDateRange: string 29 publishedDateRange: string
@@ -59,15 +60,30 @@ export class SearchFiltersComponent implements OnInit {
59 this.durationRanges = [ 60 this.durationRanges = [
60 { 61 {
61 id: 'short', 62 id: 'short',
62 label: this.i18n('Short (< 4 minutes)') 63 label: this.i18n('Short (< 4 min)')
63 }, 64 },
64 { 65 {
65 id: 'long', 66 id: 'long',
66 label: this.i18n('Long (> 10 minutes)') 67 label: this.i18n('Long (> 10 min)')
67 }, 68 },
68 { 69 {
69 id: 'medium', 70 id: 'medium',
70 label: this.i18n('Medium (4-10 minutes)') 71 label: this.i18n('Medium (4-10 min)')
72 }
73 ]
74
75 this.sorts = [
76 {
77 id: '-match',
78 label: this.i18n('Relevance')
79 },
80 {
81 id: '-publishedAt',
82 label: this.i18n('Publish date')
83 },
84 {
85 id: '-views',
86 label: this.i18n('Views')
71 } 87 }
72 ] 88 ]
73 } 89 }