Added asc/desc sort toggle in the filter form

This commit is contained in:
Fabio Manganiello 2025-03-30 14:26:28 +02:00
parent 76a01f9f47
commit 23942224d4
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 13 additions and 2 deletions
frontend/src/components

View file

@ -474,7 +474,7 @@ export default {
this.hasPrevPage = true
}
newQuery.order = 'desc'
newQuery.order = newQuery.order || 'desc'
this.setQuery(
{
...newQuery,

View file

@ -99,6 +99,17 @@
</div>
</div>
<div class="order-container">
<label for="order">Order</label>
<select id="order"
name="order"
v-model="newFilter.order"
:disabled="disabled">
<option value="asc">Oldest points first</option>
<option value="desc">Newest points first</option>
</select>
</div>
<div class="resolution-container">
<label for="resolution">
<p class="title">
@ -239,7 +250,7 @@ export default {
},
handleSubmit() {
this.$emit('refresh', this.newFilter)
this.$emit('refresh', new LocationQuery(this.newFilter))
if (this.newResolution !== this.resolution) {
this.$emit('set-resolution', this.newResolution)
}