removed obsolete selectfilter template

django-5.0
Thomas Leichtfuß 2020-09-05 10:39:16 +02:00
parent a7bd28653f
commit 71544f34bb
1 changed files with 0 additions and 36 deletions

View File

@ -1,36 +0,0 @@
{% load i18n %}
<h3>{% blocktrans with filter_title=title %}{{ filter_title }} {% endblocktrans %}</h3>
<ul>
{% for choice in choices %}
<li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string|iriencode }}"{% if choice.id %} id="{{ choice.id }}"{% endif %} title="{{ choice.display }}">{{ choice.display }}</a></li>
{% endfor %}
</ul>
<script>
(function($) {
$('a#selectfilter').click(function(evt) {
var l = [];
$('input.action-select:checked').each(function(){l.push(this.value)});
if (l.length == 0) return false;
var conj = (this.href.slice(-1) == '?') ? '' : '&';
this.href += conj + 'selected=' + l.join()
});
$('a#selectfilter_remove').click(function(evt) {
var l = [];
var a = this;
$('input.action-select:checked').each(function(){l.push(this.value)});
if (l.length == 0) return false;
$.each(l, function() {
var regex = new RegExp('(%2C'+this+'$|'+this+'%2C)');
a.href = a.href.replace(regex, '');
})
});
$('a#selectfilter_add').click(function(evt) {
var l = [];
var a = this;
$('input.action-select:checked').each(function(){l.push(this.value)});
if (l.length == 0) return false;
this.href = this.href.replace('selected=', 'selected=' + l.join() + ',');
});
})(django.jQuery);
</script>