fix: Dashboard pagination display and AJAX handler syntax error
- Fixed missing closing PHP tag in AJAX method causing syntax error - Updated both AJAX handler and template to always show item count - Fixed pagination display to be consistent between initial load and AJAX updates - Pagination item count now shows even when there's only one page of results 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
797ec10771
commit
ff35b34501
2 changed files with 10 additions and 9 deletions
|
|
@ -359,13 +359,13 @@ class HVAC_Dashboard {
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php if ($pagination['total_pages'] > 1) : ?>
|
|
||||||
<div class="tablenav bottom">
|
<div class="tablenav bottom">
|
||||||
<div class="tablenav-pages">
|
<div class="tablenav-pages">
|
||||||
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
|
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
|
||||||
|
<?php if ($pagination['total_pages'] > 1) : ?>
|
||||||
<span class="pagination-links">
|
<span class="pagination-links">
|
||||||
<?php if ($pagination['has_prev']) : ?>
|
<?php if ($pagination['has_prev']) : ?>
|
||||||
<a class="prev-page button" href="#" data-page="1">
|
<a class="first-page button" href="#" data-page="1">
|
||||||
<span class="screen-reader-text">First page</span>
|
<span class="screen-reader-text">First page</span>
|
||||||
<span aria-hidden="true">«</span>
|
<span aria-hidden="true">«</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -389,7 +389,7 @@ class HVAC_Dashboard {
|
||||||
<span class="screen-reader-text">Next page</span>
|
<span class="screen-reader-text">Next page</span>
|
||||||
<span aria-hidden="true">›</span>
|
<span aria-hidden="true">›</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="next-page button" href="#" data-page="<?php echo esc_attr($pagination['total_pages']); ?>">
|
<a class="last-page button" href="#" data-page="<?php echo esc_attr($pagination['total_pages']); ?>">
|
||||||
<span class="screen-reader-text">Last page</span>
|
<span class="screen-reader-text">Last page</span>
|
||||||
<span aria-hidden="true">»</span>
|
<span aria-hidden="true">»</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -398,9 +398,10 @@ class HVAC_Dashboard {
|
||||||
<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>
|
<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</span>
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif;
|
<?php
|
||||||
|
|
||||||
$html = ob_get_clean();
|
$html = ob_get_clean();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,10 +344,10 @@ get_header(); // Use theme's header
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($pagination['total_pages'] > 1) : ?>
|
|
||||||
<div class="tablenav bottom">
|
<div class="tablenav bottom">
|
||||||
<div class="tablenav-pages">
|
<div class="tablenav-pages">
|
||||||
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
|
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
|
||||||
|
<?php if ($pagination['total_pages'] > 1) : ?>
|
||||||
<span class="pagination-links">
|
<span class="pagination-links">
|
||||||
<?php if ($pagination['has_prev']) : ?>
|
<?php if ($pagination['has_prev']) : ?>
|
||||||
<a class="first-page button" href="#" data-page="1">
|
<a class="first-page button" href="#" data-page="1">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue