Empty states: one shared empty state on every list page, drawn by includes/inc_empty_state.php from each page's $empty_state through the new emptyStateHtml() in functions/format.php - a grey round tile with the list's icon, a title, a line on what goes there and the page's own New and Import buttons when nothing has been added, No X match with a Clear filters button that keeps the client, archived and the current tab when a search or filters leave nothing, Nothing in {tab} with the tab's description for an empty pill and a tick for pills that flag trouble, and No archived X for an empty archive; pills count as views rather than filters; replaces the pages' own empty blocks so a filtered-to-nothing list no longer shows two messages; files, notifications and racks use it in their own layouts; adds emptyStateFiltered(), emptyStateClearUrl() and emptyStatePill() and the .itflow-empty-state styles; changelog updated

This commit is contained in:
johnnyq
2026-10-17 00:47:32 -04:00
parent 74df1625e6
commit 59e75764f8
55 changed files with 720 additions and 315 deletions

View File

@@ -359,25 +359,17 @@ $csrf = $_SESSION['csrf_token'];
</table>
</div>
</form>
<?php if (!$users) { ?>
<div class="itflow-asset-empty">
<i class="fas fa-users fa-2x mb-2 opacity-50"></i>
<div>
<?php if ($q !== '' || $role_filter) { ?>
No users match.
<?php } elseif ($show === 'nomfa') { ?>
Everyone active signs in with MFA.
<?php } elseif ($show === 'archived') { ?>
No archived users.
<?php } elseif ($show === 'disabled') { ?>
Nobody is disabled.
<?php } else { ?>
No users here.
<?php } ?>
</div>
</div>
<?php } ?>
<?php require_once "../includes/filter_footer.php"; ?>
<?php
$empty_state = [
'thing' => 'users',
'icon' => 'fa-users',
'filtered' => $q !== '' || $role_filter,
'archived' => $show === 'archived',
'views' => ['show'],
'view' => $show === 'nomfa' ? ['title' => 'Everyone active signs in with MFA', 'icon' => 'fa-check'] : emptyStatePill($shows, $show),
];
require_once "../includes/filter_footer.php";
?>
</div>
<script src="../js/bulk_actions.js"></script>