File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed
app/server/static/components Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ div.columns(v-cloak="")
55
55
div.main.pt0.pb0.pr20.pl20
56
56
span About {{ count }} results (page {{ paginationPage }} of {{ paginationPages }})
57
57
58
+ div.main.pt0.pb0.pr20.pl20
59
+ div.select
60
+ select( v-model ="ordering" )
61
+ option( value ="" , disabled , selected ) Sort by
62
+ option( value ="created_at" ) Created : Ascending
63
+ option( value ="-created_at" ) Created : Descending
64
+ option( value ="updated_at" ) Updated : Ascending
65
+ option( value ="-updated_at" ) Updated : Descending
66
+
58
67
div.main.sidebar-scrollable
59
68
a.item (
60
69
v-for ="(doc, index) in docs"
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export default {
87
87
url : '' ,
88
88
offset : getOffsetFromUrl ( window . location . href ) ,
89
89
picked : 'all' ,
90
+ ordering : '' ,
90
91
count : 0 ,
91
92
prevLimit : 0 ,
92
93
paginationPages : 0 ,
@@ -188,7 +189,7 @@ export default {
188
189
189
190
async submit ( ) {
190
191
const state = this . getState ( ) ;
191
- this . url = `docs?q=${ this . searchQuery } &is_checked=${ state } &offset=${ this . offset } ` ;
192
+ this . url = `docs?q=${ this . searchQuery } &is_checked=${ state } &offset=${ this . offset } &ordering= ${ this . ordering } ` ;
192
193
await this . search ( ) ;
193
194
this . pageNumber = 0 ;
194
195
} ,
@@ -234,6 +235,11 @@ export default {
234
235
this . submit ( ) ;
235
236
} ,
236
237
238
+ ordering ( ) {
239
+ this . offset = 0 ;
240
+ this . submit ( ) ;
241
+ } ,
242
+
237
243
annotations ( ) {
238
244
// fetch progress info.
239
245
HTTP . get ( 'statistics' ) . then ( ( response ) => {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export default {
64
64
65
65
async submit () {
66
66
const state = this .getState ();
67
- this .url = ` docs?q=${ this .searchQuery } &doc_annotations__isnull=${ state} &offset=${ this .offset } ` ;
67
+ this .url = ` docs?q=${ this .searchQuery } &doc_annotations__isnull=${ state} &offset=${ this .offset } &ordering= ${ this . ordering } ` ;
68
68
await this .search ();
69
69
this .pageNumber = 0 ;
70
70
},
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ export default {
105
105
106
106
async submit () {
107
107
const state = this .getState ();
108
- this .url = ` docs?q=${ this .searchQuery } &seq2seq_annotations__isnull=${ state} &offset=${ this .offset } ` ;
108
+ this .url = ` docs?q=${ this .searchQuery } &seq2seq_annotations__isnull=${ state} &offset=${ this .offset } &ordering= ${ this . ordering } ` ;
109
109
await this .search ();
110
110
this .pageNumber = 0 ;
111
111
},
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export default {
66
66
67
67
async submit () {
68
68
const state = this .getState ();
69
- this .url = ` docs?q=${ this .searchQuery } &seq_annotations__isnull=${ state} &offset=${ this .offset } ` ;
69
+ this .url = ` docs?q=${ this .searchQuery } &seq_annotations__isnull=${ state} &offset=${ this .offset } &ordering= ${ this . ordering } ` ;
70
70
await this .search ();
71
71
this .pageNumber = 0 ;
72
72
},
You can’t perform that action at this time.
0 commit comments