kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix #179: fixed broken ordering in front-end lists
rodzic
54008aa37c
commit
47cc2a3920
|
@ -153,11 +153,11 @@ class TrackViewSet(TagViewSetMixin, viewsets.ReadOnlyModelViewSet):
|
|||
filter_class = filters.TrackFilter
|
||||
ordering_fields = (
|
||||
'creation_date',
|
||||
'title__unaccent',
|
||||
'album__title__unaccent',
|
||||
'title',
|
||||
'album__title',
|
||||
'album__release_date',
|
||||
'position',
|
||||
'artist__name__unaccent',
|
||||
'artist__name',
|
||||
)
|
||||
|
||||
def get_queryset(self):
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixed broken ordering in front-end lists (#179)
|
|
@ -26,7 +26,7 @@
|
|||
<div class="field">
|
||||
<i18next tag="label" path="Ordering direction"/>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value=""><i18next path="Ascending"/></option>
|
||||
<option value="+"><i18next path="Ascending"/></option>
|
||||
<option value="-"><i18next path="Descending"/></option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -74,7 +74,7 @@ export default {
|
|||
Pagination
|
||||
},
|
||||
data () {
|
||||
let defaultOrdering = this.getOrderingFromString(this.defaultOrdering || 'artist__name')
|
||||
let defaultOrdering = this.getOrderingFromString(this.defaultOrdering || '-creation_date')
|
||||
return {
|
||||
results: null,
|
||||
isLoading: false,
|
||||
|
@ -82,9 +82,10 @@ export default {
|
|||
previousLink: null,
|
||||
page: parseInt(this.defaultPage),
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 25),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
orderingOptions: [
|
||||
['creation_date', 'Creation date'],
|
||||
['title', 'Track name'],
|
||||
['album__title', 'Album name'],
|
||||
['artist__name', 'Artist name']
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="field">
|
||||
<i18next tag="label" path="Ordering direction"/>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value="">Ascending</option>
|
||||
<option value="+">Ascending</option>
|
||||
<option value="-">Descending</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -95,7 +95,7 @@ export default {
|
|||
page: parseInt(this.defaultPage),
|
||||
query: this.defaultQuery,
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 12),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
orderingOptions: [
|
||||
['creation_date', 'Creation date'],
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="field">
|
||||
<i18next tag="label" path="Ordering direction"/>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value=""><i18next path="Ascending"/></option>
|
||||
<option value="+"><i18next path="Ascending"/></option>
|
||||
<option value="-"><i18next path="Descending"/></option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -99,7 +99,7 @@ export default {
|
|||
page: parseInt(this.defaultPage),
|
||||
query: this.defaultQuery,
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 12),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
orderingOptions: [
|
||||
['creation_date', 'Creation date'],
|
||||
|
|
|
@ -13,13 +13,17 @@ export default {
|
|||
}
|
||||
} else {
|
||||
return {
|
||||
direction: '',
|
||||
direction: '+',
|
||||
field: s
|
||||
}
|
||||
}
|
||||
},
|
||||
getOrderingAsString () {
|
||||
return [this.orderingDirection, this.ordering].join('')
|
||||
let direction = this.orderingDirection
|
||||
if (direction === '+') {
|
||||
direction = ''
|
||||
}
|
||||
return [direction, this.ordering].join('')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<div class="field">
|
||||
<label>{{ $t('Ordering direction') }}</label>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value="">Ascending</option>
|
||||
<option value="+">Ascending</option>
|
||||
<option value="-">Descending</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -106,7 +106,7 @@ export default {
|
|||
page: parseInt(this.defaultPage),
|
||||
query: this.defaultQuery,
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 12),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
status: this.defaultStatus || 'any'
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<div class="field">
|
||||
<label>{{ $t('Ordering direction') }}</label>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value="">{{ $t('Ascending') }}</option>
|
||||
<option value="+">{{ $t('Ascending') }}</option>
|
||||
<option value="-">{{ $t('Descending') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -102,7 +102,7 @@ export default {
|
|||
page: parseInt(this.defaultPage),
|
||||
query: this.defaultQuery,
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 50),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
orderingOptions: [
|
||||
['creation_date', 'Creation date'],
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<div class="field">
|
||||
<label>{{ $t('Ordering direction') }}</label>
|
||||
<select class="ui dropdown" v-model="orderingDirection">
|
||||
<option value="">{{ $t('Ascending') }}</option>
|
||||
<option value="+">{{ $t('Ascending') }}</option>
|
||||
<option value="-">{{ $t('Descending') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -83,7 +83,7 @@ export default {
|
|||
page: parseInt(this.defaultPage),
|
||||
query: this.defaultQuery,
|
||||
paginateBy: parseInt(this.defaultPaginateBy || 12),
|
||||
orderingDirection: defaultOrdering.direction,
|
||||
orderingDirection: defaultOrdering.direction || '+',
|
||||
ordering: defaultOrdering.field,
|
||||
orderingOptions: [
|
||||
['creation_date', 'Creation date'],
|
||||
|
|
Ładowanie…
Reference in New Issue