Skip to content

Commit

Permalink
Merge pull request #288 from nossas/hotfix/set-limit-numbers-pagination
Browse files Browse the repository at this point in the history
fix(vote): Adjusted pagination layout at profile search
  • Loading branch information
sergiomario authored Sep 6, 2024
2 parents 7b0e1b9 + 470034c commit 252f6a8
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,23 @@ <h5 class="text-uppercase fw-bold text-center">Infelizmente nenhuma candidatura
Page {{ page_obj.number }} of {{ page_obj.paginator.page_range }}.
</span> -->
{% for page_number in page_obj.paginator.page_range %}
<li class="page-item{% if page_number == page_obj.number %} active{% endif %}">
<a class="page-link"{% if page_number != page_obj.number %} href="?{% url_replace page=page_number %}"{% endif %}>
{{ page_number }}
</a>
</li>
{% if page_number == 1 or page_number == page_obj.paginator.num_pages %}
<li class="page-item{% if page_number == page_obj.number %} active{% endif %}">
<a class="page-link"{% if page_number != page_obj.number %} href="?{% url_replace page=page_number %}"{% endif %}>
{{ page_number }}
</a>
</li>
{% elif page_number >= page_obj.number|add:'-3' and page_number <= page_obj.number|add:'3' %}
<li class="page-item{% if page_number == page_obj.number %} active{% endif %}">
<a class="page-link"{% if page_number != page_obj.number %} href="?{% url_replace page=page_number %}"{% endif %}>
{{ page_number }}
</a>
</li>
{% elif page_number == page_obj.number|add:'-4' or page_number == page_obj.number|add:'4' %}
<li class="page-item disabled">
<span class="page-link">...</span>
</li>
{% endif %}
{% endfor %}

<li class="page-item{% if not page_obj.has_next %} disabled{% endif %}">
Expand Down

0 comments on commit 252f6a8

Please sign in to comment.