feat: Add pagination controls to leaderboard

This commit is contained in:
Kerby Martino (aider) committed 2025-05-05 19:21:09 +08:00
1 parent 129791e4c1
commit 096d0e6900
1 file changed
+3 -3
+3 -3
View File
@@ -97,15 +97,15 @@
<!-- Pagination Controls --> <!-- Pagination Controls -->
<div class="flex justify-center font-action mt-4"> <div class="flex justify-center font-action mt-4">
{% if current_page > 1 %} {% if current_page > 1 %}
<a href="?page={{ current_page | minus: 1 }}" class="px-4 py-2 mx-1 bg-primary text-white rounded-md hover:bg-primary-dark">Previous</a> <a href="?page={{ current_page | minus: 1 }}" class="px-4 py-2 mx-1 bg-transparent border border-gray-300 text-gray-700 rounded-md hover:bg-gray-100">Previous</a>
{% endif %} {% endif %}
{% for i in (1..total_pages) %} {% for i in (1..total_pages) %}
<a href="?page={{ i }}" class="px-4 py-2 mx-1 {% if i == current_page %}bg-primary text-white{% else %}bg-gray-200 text-gray-700{% endif %} rounded-md hover:bg-primary-dark">{{ i }}</a> <a href="?page={{ i }}" class="px-4 py-2 mx-1 {% if i == current_page %}bg-primary text-white{% else %}bg-transparent border border-gray-300 text-gray-700{% endif %} rounded-md hover:bg-gray-100">{{ i }}</a>
{% endfor %} {% endfor %}
{% if current_page < total_pages %} {% if current_page < total_pages %}
<a href="?page={{ current_page | plus: 1 }}" class="px-4 py-2 mx-1 bg-primary text-white rounded-md hover:bg-primary-dark">Next</a> <a href="?page={{ current_page | plus: 1 }}" class="px-4 py-2 mx-1 bg-transparent border border-gray-300 text-gray-700 rounded-md hover:bg-gray-100">Next</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>