]> git.lizzy.rs Git - cheatdb.git/commitdiff
Add pagination styling
authorrubenwardy <rw@rubenwardy.com>
Sat, 22 Dec 2018 13:33:27 +0000 (13:33 +0000)
committerrubenwardy <rw@rubenwardy.com>
Sat, 22 Dec 2018 13:33:27 +0000 (13:33 +0000)
app/templates/packages/list.html

index fd2737380e7af0ec1ea237090f921a160eed8130..cc0c6c997af3ce9a64fb856f98c2f11ead417eaa 100644 (file)
@@ -8,10 +8,21 @@
        {% from "macros/packagegridtile.html" import render_pkggrid %}
        {{ render_pkggrid(packages) }}
 
-       <ul class="btnset linedbuttonset">
-               {% if prev_url %}<li><a href="{{ prev_url }}">Previous</a></li>{% endif %}
-               <li>{{ page }} / {{ page_max }}</li>
-               {% if next_url %}<li><a href="{{ next_url }}">Next</a></li> {% endif %}
+       <ul class="pagination mt-4">
+               <li class="page-item {% if not prev_url %}disabled{% endif %}">
+                       <a class="page-link" {% if prev_url %}href="{{ prev_url }}"{% endif %}>&laquo;</a>
+               </li>
+               {% for n in range(1, page_max+1) %}
+                       <li class="page-item {% if n == page %}active{% endif %}">
+                               <a class="page-link"
+                                               href="{{ url_for('packages_page', type=type, q=query, page=n) }}">
+                                       {{ n }}
+                               </a>
+                       </li>
+               {% endfor %}
+               <li class="page-item {% if not next_url %}disabled{% endif %}">
+                       <a class="page-link" {% if next_url %}href="{{ next_url }}"{% endif %}>&raquo;</a>
+               </li>
        </ul>
 
        {% if topics %}