mirror of
https://github.com/itflow-org/itflow
synced 2026-12-01 16:48:59 +00:00
QoL 50: sortLink and sortFirstOrder in functions/format.php replace the 48 copied sort_link closures and 115 hand-written header links, the first click on a new column sorts names A-Z and dates, money and counts newest or largest first, with changelog lines
This commit is contained in:
@@ -173,10 +173,6 @@ $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS backup_id, backup_type,
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$type_looks = [
|
||||
BACKUP_TYPE_FULL => ['icon' => 'fa-box-open', 'tone' => 'itflow-asset-tone-server'],
|
||||
@@ -342,10 +338,10 @@ $status_looks = [
|
||||
<table class="table table-hover align-middle mb-0" data-backup-list>
|
||||
<thead class="table-light text-nowrap">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('backup_type', 'Backup') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('backup_created_at', 'Made') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('backup_size', 'Size') ?></th>
|
||||
<th><?= $sort_link('backup_status', 'Status') ?></th>
|
||||
<th class="ps-3"><?= sortLink('backup_type', 'Backup') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('backup_created_at', 'Made') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('backup_size', 'Size') ?></th>
|
||||
<th><?= sortLink('backup_status', 'Status') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user