fix(loyalty): use shared pagination macro on card detail transactions
Some checks failed
Some checks failed
Replace custom pagination with the shared pagination_simple macro to match the cards list page pattern. Always shows "Showing X-Y of Z" with Previous/Next — no longer hidden when only 1 page. Uses standard Alpine.js pagination interface (pagination.page, totalPages, startIndex, endIndex, pageNumbers, previousPage, nextPage, goToPage). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{% from 'shared/macros/headers.html' import detail_page_header %}
|
||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||
{% from 'shared/macros/tables.html' import table_wrapper, table_header %}
|
||||
{% from 'shared/macros/pagination.html' import pagination_simple %}
|
||||
|
||||
{% block title %}{{ _('loyalty.store.card_detail.title') }}{% endblock %}
|
||||
|
||||
@@ -152,22 +153,7 @@
|
||||
</tbody>
|
||||
{% endcall %}
|
||||
|
||||
<!-- Pagination -->
|
||||
<div x-show="txPagination.pages > 1" class="px-4 py-3 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between">
|
||||
<button @click="txPreviousPage()" :disabled="txPagination.page <= 1"
|
||||
type="button"
|
||||
class="px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50">
|
||||
{{ _('loyalty.common.previous') }}
|
||||
</button>
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400"
|
||||
x-text="'{{ _('loyalty.store.card_detail.page_x_of_y') }}'.replace('{page}', txPagination.page).replace('{pages}', txPagination.pages)">
|
||||
</span>
|
||||
<button @click="txNextPage()" :disabled="txPagination.page >= txPagination.pages"
|
||||
type="button"
|
||||
class="px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50">
|
||||
{{ _('loyalty.common.next') }}
|
||||
</button>
|
||||
</div>
|
||||
{{ pagination_simple() }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user