Add pagination controls to hero buttons

This commit is contained in:
Jake Howard 2023-10-22 16:07:04 +01:00
parent 5d7d84249b
commit fcbdb248fa
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 14 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{% extends "common/content_page.html" %}
{% load wagtailroutablepage_tags %}
{% load wagtailroutablepage_tags wagtailadmin_tags %}
{% block extra_head %}
{{ block.super }}
@ -9,6 +9,15 @@
{% block hero_buttons %}
<a class="button is-radiusless" href="{% routablepageurl page 'feed' %}" title="View feed"><i class="fas fa-rss" aria-hidden="true"></i></a>
{% if listing_pages.has_previous %}
<a class="button is-radiusless" href="{% querystring page=listing_pages.previous_page_number %}" title="Previous page"><i class="fas fa-arrow-left" aria-hidden="true"></i></a>
{% endif %}
{% if listing_pages.has_next %}
<a class="button is-radiusless" href="{% querystring page=listing_pages.next_page_number %}" title="Next page"><i class="fas fa-arrow-right" aria-hidden="true"></i></a>
{% endif %}
{{ block.super }}
{% endblock %}

View file

@ -2,15 +2,15 @@
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
{% if page.has_previous %}
<a class="pagination-previous" href="{% querystring page=page.previous_page_number %}">&larr;</a>
<a class="pagination-previous" href="{% querystring page=page.previous_page_number %}"><i class="fas fa-arrow-left" aria-hidden="true"></i></a>
{% else %}
<span class="pagination-previous is-disabled">&larr;</span>
<span class="pagination-previous is-disabled"><i class="fas fa-arrow-left" aria-hidden="true"></i></span>
{% endif %}
{% if page.has_next %}
<a class="pagination-next" href="{% querystring page=page.next_page_number %}">&rarr;</a>
<a class="pagination-next" href="{% querystring page=page.next_page_number %}"><i class="fas fa-arrow-right" aria-hidden="true"></i></a>
{% else %}
<span class="pagination-next is-disabled">&rarr;</span>
<span class="pagination-next is-disabled"><i class="fas fa-arrow-right" aria-hidden="true"></i></span>
{% endif %}
<ul class="pagination-list">