Make load more button not do a refresh

This commit is contained in:
Andrew Godwin 2022-12-24 10:27:34 -07:00
parent 801c807a2b
commit a6c973337c
3 changed files with 6 additions and 6 deletions

View File

@ -23,12 +23,12 @@
{% endfor %}
<div class="pagination">
{% if page_obj.has_previous %}
{% if page_obj.has_previous and not request.htmx %}
<a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a>
{% endif %}
{% if page_obj.has_next %}
<a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a>
<a class="button" href=".?page={{ page_obj.next_page_number }}" hx-get=".?page={{ page_obj.next_page_number }}" hx-select=".left-column > *:not(.view-options)" hx-target=".pagination" hx-swap="outerHTML">Next Page</a>
{% endif %}
</div>
{% endblock %}

View File

@ -10,12 +10,12 @@
{% endfor %}
<div class="pagination">
{% if page_obj.has_previous %}
{% if page_obj.has_previous and not request.htmx %}
<a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a>
{% endif %}
{% if page_obj.has_next %}
<a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a>
<a class="button" href=".?page={{ page_obj.next_page_number }}" hx-get=".?page={{ page_obj.next_page_number }}" hx-select=".left-column > *:not(.view-options)" hx-target=".pagination" hx-swap="outerHTML">Next Page</a>
{% endif %}
</div>
{% endblock %}

View File

@ -33,12 +33,12 @@
{% endfor %}
<div class="pagination">
{% if page_obj.has_previous %}
{% if page_obj.has_previous and not request.htmx %}
<a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a>
{% endif %}
{% if page_obj.has_next %}
<a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a>
<a class="button" href=".?page={{ page_obj.next_page_number }}" hx-get=".?page={{ page_obj.next_page_number }}" hx-select=".left-column > *:not(.view-options)" hx-target=".pagination" hx-swap="outerHTML">Next Page</a>
{% endif %}
</div>
{% endblock %}