summaryrefslogtreecommitdiff
path: root/libretube-theme/templates/pagination.html
diff options
context:
space:
mode:
authorsrv <enmanuel.saravia.externo@pandero.com.pe>2025-04-28 17:11:28 -0500
committersrv <enmanuel.saravia.externo@pandero.com.pe>2025-04-28 17:11:28 -0500
commitf35a7b0e70032de2feec9f3bda09da44cf0e1073 (patch)
tree1e0e09581dd3707d0ceb93346452dd14451a8423 /libretube-theme/templates/pagination.html
first commit
Diffstat (limited to 'libretube-theme/templates/pagination.html')
-rw-r--r--libretube-theme/templates/pagination.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/libretube-theme/templates/pagination.html b/libretube-theme/templates/pagination.html
new file mode 100644
index 0000000..ec99498
--- /dev/null
+++ b/libretube-theme/templates/pagination.html
@@ -0,0 +1,78 @@
+{% if DEFAULT_PAGINATION %}
+ <nav class="mt-5">
+ <ul class="pagination pagination-circle pg-red justify-content-center">
+
+ <!-- Previous -->
+ {% if articles_page.has_previous() %}
+ <li class="page-item">
+ <a href="{{ SITEURL }}/{{ articles_previous_page.url }}" class="page-link" aria-label="Previous">
+ <span aria-hidden="true">&laquo;</span>
+ </a>
+ </li>
+ {% else %}
+ <li class="page-item disabled">
+ <a class="page-link" aria-label="Previous">
+ <span aria-hidden="true">&laquo;</span>
+ </a>
+ </li>
+ {% endif %}
+ <!-- /Previous -->
+
+ {% for num in range(1, 1 + articles_paginator.num_pages) %}
+ {% set print_number = False %}
+ {% set dots_before = True %}
+ {% if num == 1 %}
+ {% set print_number = True %}
+ {% set dots_before = False %}
+ {% elif (articles_page.number - PAGINATOR_LIMIT / 2) <= num < (articles_page.number - PAGINATOR_LIMIT / 2 + 1) %}
+ {% set print_number = True %}
+ {% if num == 2 %}
+ {% set dots_before = False %}
+ {% endif %}
+ {% elif (articles_page.number - PAGINATOR_LIMIT / 2 + 1) <= num <= (articles_page.number + PAGINATOR_LIMIT / 2) %}
+ {% set print_number = True %}
+ {% set dots_before = False %}
+ {% elif num == articles_paginator.num_pages %}
+ {% set print_number = True %}
+ {% if (articles_page.number + PAGINATOR_LIMIT / 2) <= num <= (articles_page.number + PAGINATOR_LIMIT / 2 + 1)%}
+ {% set dots_before = False %}
+ {% endif %}
+ {% endif %}
+ {% if print_number %}
+ {% if dots_before %}
+ <li><span class="pagination-ellipsis">&hellip;</span></li>
+ {% endif %}
+ {% if num == articles_page.number %}
+ <li class="page-item active">
+ <a class="page-link"
+ aria-label="Page {{ num }}">{{ num }}</a>
+ </li>
+ {% else %}
+
+ <li class="page-item">
+ <a class="page-link" aria-label="Goto page {{ num }}"
+ href="{{ SITEURL }}/{{ articles_paginator.page(num).url }}">{{ num }}
+ </a>
+ </li>
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+
+ <!-- Next -->
+ {% if articles_page.has_next() %}
+ <li class="page-item">
+ <a href="{{ SITEURL }}/{{ articles_next_page.url }}" class="page-link" aria-label="Next">
+ <span aria-hidden="true">&raquo;</span>
+ </a>
+ </li>
+ {% else %}
+ <li class="page-item disabled">
+ <a class="page-link" aria-label="Next">
+ <span aria-hidden="true">&raquo;</span>
+ </a>
+ </li>
+ {% endif %}
+ <!-- /Next -->
+ </ul>
+ </nav>
+{% endif %}