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
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
59
68
a.item (
60
69
v-for ="(doc, index) in docs"
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default {
52
52
url : '' ,
53
53
offset : getOffsetFromUrl ( window . location . href ) ,
54
54
picked : 'all' ,
55
+ ordering : '' ,
55
56
count : 0 ,
56
57
isSuperuser : false ,
57
58
isMetadataActive : false ,
@@ -109,7 +110,7 @@ export default {
109
110
110
111
async submit ( ) {
111
112
const state = this . getState ( ) ;
112
- this . url = `docs?q=${ this . searchQuery } &is_checked=${ state } &offset=${ this . offset } ` ;
113
+ this . url = `docs?q=${ this . searchQuery } &is_checked=${ state } &offset=${ this . offset } &ordering= ${ this . ordering } ` ;
113
114
await this . search ( ) ;
114
115
this . pageNumber = 0 ;
115
116
} ,
@@ -155,6 +156,11 @@ export default {
155
156
this . submit ( ) ;
156
157
} ,
157
158
159
+ ordering ( ) {
160
+ this . offset = 0 ;
161
+ this . submit ( ) ;
162
+ } ,
163
+
158
164
annotations ( ) {
159
165
// fetch progress info.
160
166
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