On corrige la navigation dans les fixed
This commit is contained in:
parent
509a9d5379
commit
483036bc33
@ -503,6 +503,27 @@ class DuplicatedEventsFilter(django_filters.FilterSet):
|
||||
model = DuplicatedEvents
|
||||
fields = []
|
||||
|
||||
def get_cleaned_data(self, name):
|
||||
try:
|
||||
return self.form.cleaned_data[name]
|
||||
except AttributeError:
|
||||
return {}
|
||||
except KeyError:
|
||||
return {}
|
||||
|
||||
def get_fixed_url(self):
|
||||
if "fixed" in self.form.cleaned_data:
|
||||
if self.form.cleaned_data["fixed"] is None:
|
||||
return "fixed=unknown"
|
||||
else:
|
||||
if self.form.cleaned_data["fixed"]:
|
||||
return "fixed=true"
|
||||
else:
|
||||
return "fixed=false"
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
def fixed_qs(self, queryset, name, value):
|
||||
return DuplicatedEvents.not_fixed_qs(queryset, value)
|
||||
|
@ -41,8 +41,8 @@
|
||||
<footer>
|
||||
<span>
|
||||
{% if paginator_filter.has_previous %}
|
||||
<a href="?page=1" role="button">« premier</a>
|
||||
<a href="?page={{ paginator_filter.previous_page_number }}" role="button">< précédent</a>
|
||||
<a href="?page=1&{{ filter.get_fixed_url }}" role="button">« premier</a>
|
||||
<a href="?page={{ paginator_filter.previous_page_number }}&{{ filter.get_fixed_url }}" role="button">< précédent</a>
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
@ -50,8 +50,8 @@
|
||||
</span>
|
||||
|
||||
{% if paginator_filter.has_next %}
|
||||
<a href="?page={{ paginator_filter.next_page_number }}" role="button">suivant ></a>
|
||||
<a href="?page={{ paginator_filter.paginator.num_pages }}" role="button">dernier »</a>
|
||||
<a href="?page={{ paginator_filter.next_page_number }}&{{ filter.get_fixed_url }}" role="button">suivant ></a>
|
||||
<a href="?page={{ paginator_filter.paginator.num_pages }}&{{ filter.get_fixed_url }}" role="button">dernier »</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</footer>
|
||||
|
Loading…
x
Reference in New Issue
Block a user