Skip to content

Commit

Permalink
Don't insert an empty div on the index when there's no pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tsileo committed Nov 30, 2022
1 parent 436d5cc commit a68b3e7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@
{% endfor %}
</div>

<div class="box">
{% if has_previous_page %}
<a href="{{ url_for("index") }}?page={{ current_page - 1 }}">Previous</a>
{% endif %}

{% if has_next_page %}
<a href="{{ url_for("index") }}?page={{ current_page + 1 }}">Next</a>
{% endif %}
</div>
{% if has_previous_page or has_next_page %}
<div class="box">
{% if has_previous_page %}
<a href="{{ url_for("index") }}?page={{ current_page - 1 }}">Previous</a>
{% endif %}

{% if has_next_page %}
<a href="{{ url_for("index") }}?page={{ current_page + 1 }}">Next</a>
{% endif %}
</div>
{% endif %}

{% else %}
<div class="empty-state">
Expand Down

0 comments on commit a68b3e7

Please sign in to comment.