summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauréline Guérin <zebuline@entrouvert.com>2020-05-05 11:51:26 (GMT)
committerLauréline Guérin <zebuline@entrouvert.com>2020-05-11 14:29:47 (GMT)
commit5b4b10c81fbcc80b586388a7b30ab7251f397135 (patch)
tree7c7ba7c716251ac71a4a2c0f06b3c2e45d55563c
parenta57951805e859859dd3d6f91a994d2a5da432b68 (diff)
downloadgadjo-wip/42441-logs-pagination-log-id.zip
gadjo-wip/42441-logs-pagination-log-id.tar.gz
gadjo-wip/42441-logs-pagination-log-id.tar.bz2
pagination: add optional 'without_key' in template (#42441)v0.91wip/42441-logs-pagination-log-id
-rw-r--r--gadjo/templates/gadjo/pagination.html9
1 files changed, 5 insertions, 4 deletions
diff --git a/gadjo/templates/gadjo/pagination.html b/gadjo/templates/gadjo/pagination.html
index 810f23f..aec4916 100644
--- a/gadjo/templates/gadjo/pagination.html
+++ b/gadjo/templates/gadjo/pagination.html
@@ -7,6 +7,7 @@ Expected context variables:
- page_obj: Paginator page object
- page_key (optional): name of page parameter (default: page)
- anchor (optional): anchor to use in links
+ - without_key (optional): key to remove in GET params
{% endcomment %}
{% if page_obj.paginator.num_pages > 1 %}
@@ -15,24 +16,24 @@ Expected context variables:
<p class="paginator">
{% if page_obj.number > 1 %}
{% if page_obj.previous_page_number != 1 %}
- <a href="{% querystring page_key=1 %}{{ anchor }}">1</a>
+ <a href="{% querystring page_key=1 without without_key %}{{ anchor }}">1</a>
{% endif %}
{% endif %}
{% if page_obj.has_previous %}
- <a href="{% querystring page_key=page_obj.previous_page_number %}{{ anchor }}">{{ page_obj.previous_page_number }}</a>
+ <a href="{% querystring page_key=page_obj.previous_page_number without without_key %}{{ anchor }}">{{ page_obj.previous_page_number }}</a>
{% endif %}
<span class="this-page">{{ page_obj.number }}</span>
{% if page_obj.has_next %}
- <a href="{% querystring page_key=page_obj.next_page_number %}{{ anchor }}">{{ page_obj.next_page_number }}</a>
+ <a href="{% querystring page_key=page_obj.next_page_number without without_key %}{{ anchor }}">{{ page_obj.next_page_number }}</a>
{% endif %}
{% if page_obj.number != page_obj.paginator.num_pages %}
{% if page_obj.next_page_number != page_obj.paginator.num_pages %}
- <a href="{% querystring page_key=page_obj.paginator.num_pages %}{{ anchor }}">{{ page_obj.paginator.num_pages }}</a>
+ <a href="{% querystring page_key=page_obj.paginator.num_pages without without_key %}{{ anchor }}">{{ page_obj.paginator.num_pages }}</a>
{% endif %}
{% endif %}
</p>