Skip to content

Instantly share code, notes, and snippets.

View sc2-zobka's full-sized avatar

Mathias sc2-zobka

  • Santiago, Chile
View GitHub Profile
@sc2-zobka
sc2-zobka / django template
Created October 22, 2020 23:59
Paginator for django apps
{% if paginator.num_pages > 1%}
<div class="d-flex justify-content-center">
<ul class="pagination">
{% if entity.has_previous %}
<li class="page-item d-none d-sm-block"><a class="page-link" href="?page={{ entity.previous_page_number }}#pagtable">Anterior</a></li>
{% endif %}
{% for page in paginator.page_range %}
{% if forloop.last and page != entity.number and paginator.num_pages > 7 %}
{% if entity.next_page_number != paginator.num_pages%}
<li class="page-item">