Fix Sort Link
Updated conditional to not add filter expression if a search has been performed on the queryset.master
parent
723b66f551
commit
1ed27acbaa
|
|
@ -9,7 +9,7 @@
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
var urlParts = url.split('?');
|
var urlParts = url.split('?');
|
||||||
|
|
||||||
if (urlParts.length === 2) {
|
if (urlParts.length === 2 && urlParts[1].substr(0, 2) !== 'q=') {
|
||||||
$('a#change-order').attr('href', './sort/?filter_expression=' + urlParts[1]);
|
$('a#change-order').attr('href', './sort/?filter_expression=' + urlParts[1]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ class ProjectAdmin(SortableAdmin):
|
||||||
list_display = ['__str__', 'category']
|
list_display = ['__str__', 'category']
|
||||||
list_filter = ('category__title',)
|
list_filter = ('category__title',)
|
||||||
after_sorting_js_callback_name = 'afterSortCallback'
|
after_sorting_js_callback_name = 'afterSortCallback'
|
||||||
|
search_fields = ['title']
|
||||||
sortable_change_list_template = 'adminsortable/custom_change_list.html'
|
sortable_change_list_template = 'adminsortable/custom_change_list.html'
|
||||||
sortable_change_form_template = 'adminsortable/custom_change_form.html'
|
sortable_change_form_template = 'adminsortable/custom_change_form.html'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue