2024-09-02 15:43:41 +00:00
|
|
|
{% load param_utils %}
|
2024-08-09 10:42:54 +00:00
|
|
|
<div class="shadow-md sm:rounded-lg" hx-boost="false">
|
2024-08-13 06:36:40 +00:00
|
|
|
<div class="relative overflow-x-auto sm:rounded-lg">
|
2024-08-09 10:42:54 +00:00
|
|
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
|
|
|
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
|
|
|
<tr>
|
|
|
|
{% for column in columns %}<th scope="col" class="px-6 py-3">{{ column }}</th>{% endfor %}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-09-02 15:43:41 +00:00
|
|
|
{% for row in rows %}<c-table-row :data=row />{% endfor %}
|
2024-08-09 10:42:54 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2024-08-19 19:58:43 +00:00
|
|
|
{% if page_obj and elided_page_range %}
|
2024-08-09 10:42:54 +00:00
|
|
|
<nav class="flex items-center flex-column md:flex-row justify-between px-6 py-4"
|
2024-08-09 10:23:22 +00:00
|
|
|
aria-label="Table navigation">
|
|
|
|
<span class="text-sm font-normal text-gray-500 dark:text-gray-400 mb-4 md:mb-0 block w-full md:inline md:w-auto">Showing <span class="font-semibold text-gray-900 dark:text-white">{{ page_obj.start_index }}</span>—<span class="font-semibold text-gray-900 dark:text-white">{{ page_obj.end_index }}</span> of <span class="font-semibold text-gray-900 dark:text-white">{{ page_obj.paginator.count }}</span></span>
|
|
|
|
<ul class="inline-flex -space-x-px rtl:space-x-reverse text-sm h-8">
|
|
|
|
<li>
|
|
|
|
{% if page_obj.has_previous %}
|
2024-09-02 15:43:41 +00:00
|
|
|
<a href="?{% param_replace page=page_obj.previous_page_number %}"
|
2024-08-09 10:23:22 +00:00
|
|
|
class="flex items-center justify-center px-3 h-8 ms-0 leading-tight text-gray-500 bg-white border border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">Previous</a>
|
|
|
|
{% else %}
|
|
|
|
<a aria-current="page"
|
2024-08-09 10:42:54 +00:00
|
|
|
class="cursor-not-allowed flex items-center justify-center px-3 h-8 leading-tight text-gray-300 bg-white border border-gray-300 rounded-s-lg dark:bg-gray-800 dark:border-gray-700 dark:text-gray-600">Previous</a>
|
2024-08-09 10:23:22 +00:00
|
|
|
{% endif %}
|
|
|
|
{% for page in elided_page_range %}
|
|
|
|
<li>
|
|
|
|
{% if page != page_obj.number %}
|
2024-09-02 15:43:41 +00:00
|
|
|
<a href="?{% param_replace page=page %}"
|
2024-08-09 10:23:22 +00:00
|
|
|
class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">{{ page }}</a>
|
|
|
|
{% else %}
|
|
|
|
<a aria-current="page"
|
2024-08-09 10:42:54 +00:00
|
|
|
class="cursor-not-allowed flex items-center justify-center px-3 h-8 leading-tight text-white border bg-gray-400 border-gray-300 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-200">{{ page }}</a>
|
2024-08-09 10:23:22 +00:00
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
{% if page_obj.has_next %}
|
2024-09-02 15:43:41 +00:00
|
|
|
<a href="?{% param_replace page=page_obj.next_page_number %}"
|
2024-08-09 10:23:22 +00:00
|
|
|
class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">Next</a>
|
|
|
|
{% else %}
|
|
|
|
<a aria-current="page"
|
2024-08-09 10:42:54 +00:00
|
|
|
class="cursor-not-allowed flex items-center justify-center px-3 h-8 leading-tight text-gray-300 bg-white border border-gray-300 rounded-e-lg dark:bg-gray-800 dark:border-gray-700 dark:text-gray-600">Next</a>
|
2024-08-09 10:23:22 +00:00
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{% endif %}
|
2024-08-08 18:17:43 +00:00
|
|
|
</div>
|