feat: Add pagination controls to leaderboard
This commit is contained in:
1 parent
129791e4c1
commit
096d0e6900
1 file changed
+3
-3
@@ -97,15 +97,15 @@
|
||||
<!-- Pagination Controls -->
|
||||
<div class="flex justify-center font-action mt-4">
|
||||
{% 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 %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% 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 %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user