Move breadcrumb rendering from individual page templates into the core topbar. Each page now sets $breadcrumbs in its action .php file; the topbar renders it automatically via the shared partial. - Remove global back/forward buttons and app-nav-history.js component - Remove Alt+Arrow keyboard shortcuts for history navigation - Render breadcrumb in topbar-left section (replaces button area) - Clean up breadcrumb CSS: context-neutral base (flex, no margin) - Recalculate sticky titlebar offset in details container - Migrate all 41 pages (core + helpdesk, audit, addressbook, api-docs) - Add missing breadcrumbs to addressbook detail view - Update architecture contract tests (nav-history references removed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89 lines
3.1 KiB
PHTML
89 lines
3.1 KiB
PHTML
<?php
|
|
use MintyPHP\Router;
|
|
use MintyPHP\Http\Request;
|
|
|
|
$canCreateDepartments = (bool) ($canCreateDepartments ?? false);
|
|
$toolbarFilterSchema = is_array($toolbarFilterSchema ?? null) ? $toolbarFilterSchema : [];
|
|
$searchToolbarFilterSchema = is_array($searchToolbarFilterSchema ?? null) ? $searchToolbarFilterSchema : [];
|
|
$drawerToolbarFilterSchema = is_array($drawerToolbarFilterSchema ?? null) ? $drawerToolbarFilterSchema : [];
|
|
$toolbarFilterState = is_array($toolbarFilterState ?? null) ? $toolbarFilterState : [];
|
|
$filterChipMeta = is_array($filterChipMeta ?? null) ? $filterChipMeta : [];
|
|
$clientFilterSchema = is_array($clientFilterSchema ?? null) ? $clientFilterSchema : [];
|
|
$searchConfig = is_array($searchConfig ?? null) ? $searchConfig : null;
|
|
$activeTenant = (string) ($activeTenant ?? ($toolbarFilterState['tenant'] ?? ''));
|
|
$showTenantTabs = isset($tenants) && is_array($tenants) && count($tenants) > 1;
|
|
?>
|
|
<?php
|
|
$listTitle = t('Departments');
|
|
ob_start();
|
|
?>
|
|
<?php if ($canCreateDepartments): ?>
|
|
<a role="button" class="app-action-success" href="<?php e(requestPathWithReturnTarget('admin/departments/create', Request::pathWithQuery())); ?>">
|
|
<i class="bi bi-plus"></i> <?php e(t('Create department')); ?>
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php
|
|
$listTitleActionsHtml = ob_get_clean();
|
|
require templatePath('partials/app-list-titlebar.phtml');
|
|
?>
|
|
<?php if ($showTenantTabs): ?>
|
|
<?php
|
|
$listTabsId = 'departments-tabs';
|
|
$listTabsItems = [
|
|
[
|
|
'href' => 'admin/departments',
|
|
'label' => t('All'),
|
|
'active' => $activeTenant === '',
|
|
],
|
|
];
|
|
foreach ($tenants ?? [] as $tenant) {
|
|
$tenantUuid = (string) ($tenant['uuid'] ?? '');
|
|
if ($tenantUuid === '') {
|
|
continue;
|
|
}
|
|
|
|
$listTabsItems[] = [
|
|
'href' => 'admin/departments?tenant=' . rawurlencode($tenantUuid),
|
|
'label' => (string) ($tenant['description'] ?? ''),
|
|
'active' => $activeTenant === $tenantUuid,
|
|
];
|
|
}
|
|
require templatePath('partials/app-list-tabs.phtml');
|
|
?>
|
|
<?php endif; ?>
|
|
<?php
|
|
$filterUiNamespace = 'departments';
|
|
require templatePath('partials/app-list-filters.phtml');
|
|
?>
|
|
<div class="app-list-table">
|
|
<div id="departments-grid"></div>
|
|
</div>
|
|
|
|
<?php
|
|
$gridLang = json_decode(appBufferValue('grid_lang'), true);
|
|
if (!is_array($gridLang)) {
|
|
$gridLang = [];
|
|
}
|
|
$pageConfig = [
|
|
'gridSearch' => $searchConfig,
|
|
'filterSchema' => $clientFilterSchema,
|
|
'filterChipMeta' => $filterChipMeta,
|
|
'gridLang' => $gridLang,
|
|
'labels' => [
|
|
'description' => t('Description'),
|
|
'status' => t('Status'),
|
|
'code' => t('Code'),
|
|
'costCenter' => t('Cost center'),
|
|
'activeUsers' => t('Active users'),
|
|
'inactiveUsers' => t('Inactive users'),
|
|
'created' => t('Created'),
|
|
'modified' => t('Modified'),
|
|
'active' => t('Active'),
|
|
'inactive' => t('Inactive'),
|
|
],
|
|
];
|
|
?>
|
|
<script src="<?php e(assetVersion('vendor/gridjs/gridjs.umd.js')); ?>"></script>
|
|
<script type="application/json" id="page-config-admin-departments-index"><?php gridJsonForJs($pageConfig); ?></script>
|
|
<script type="module" src="<?php e(assetVersion('js/pages/admin-departments-index.js')); ?>"></script>
|