Update heading by selected module
This commit is contained in:
@@ -14,6 +14,15 @@ function render_auth_home_page(array $user): void
|
|||||||
],
|
],
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
);
|
);
|
||||||
|
$moduleHeadings = json_encode(
|
||||||
|
[
|
||||||
|
'Übersicht' => 'Willkommen bei Naurua Übersicht',
|
||||||
|
'ERP' => 'Willkommen bei Naurua ERP',
|
||||||
|
'Buchhaltung' => 'Willkommen bei Naurua Buchhaltung',
|
||||||
|
'Kundenberatung' => 'Willkommen bei Naurua Kundenberatung',
|
||||||
|
],
|
||||||
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
|
);
|
||||||
|
|
||||||
echo '<!doctype html>';
|
echo '<!doctype html>';
|
||||||
echo '<html lang="de">';
|
echo '<html lang="de">';
|
||||||
@@ -52,7 +61,7 @@ function render_auth_home_page(array $user): void
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</header>';
|
echo '</header>';
|
||||||
echo '</article>';
|
echo '</article>';
|
||||||
echo '<h1 class="sg-main-heading">Willkommen im Naurua ERP</h1>';
|
echo '<h1 class="sg-main-heading" data-main-heading aria-live="polite">Willkommen bei Naurua ERP</h1>';
|
||||||
echo '<section class="sg-left-navigation-pattern" aria-label="Linke Navigation">';
|
echo '<section class="sg-left-navigation-pattern" aria-label="Linke Navigation">';
|
||||||
echo '<div class="sg-left-navigation-pattern__layout" aria-label="Left Navigation Demo">';
|
echo '<div class="sg-left-navigation-pattern__layout" aria-label="Left Navigation Demo">';
|
||||||
echo '<aside class="sg-group-card sg-left-navigation-pattern__group-card sg-left-navigation-pattern__group-card--navigation" data-component="group-card" aria-label="Navigation">';
|
echo '<aside class="sg-group-card sg-left-navigation-pattern__group-card sg-left-navigation-pattern__group-card--navigation" data-component="group-card" aria-label="Navigation">';
|
||||||
@@ -72,6 +81,11 @@ function render_auth_home_page(array $user): void
|
|||||||
echo '</section>';
|
echo '</section>';
|
||||||
echo '<script>';
|
echo '<script>';
|
||||||
echo 'const portalModuleNavigation = ' . $moduleNavigation . ';';
|
echo 'const portalModuleNavigation = ' . $moduleNavigation . ';';
|
||||||
|
echo 'const portalModuleHeadings = ' . $moduleHeadings . ';';
|
||||||
|
echo "const renderMainHeading = (moduleName) => {";
|
||||||
|
echo " const heading = document.querySelector('[data-main-heading]');";
|
||||||
|
echo " if (heading && portalModuleHeadings[moduleName]) { heading.textContent = portalModuleHeadings[moduleName]; }";
|
||||||
|
echo "};";
|
||||||
echo "const renderLeftNavigation = (moduleName) => {";
|
echo "const renderLeftNavigation = (moduleName) => {";
|
||||||
echo " const title = document.querySelector('[data-left-navigation-title]');";
|
echo " const title = document.querySelector('[data-left-navigation-title]');";
|
||||||
echo " const menu = document.getElementById('left-navigation-menu');";
|
echo " const menu = document.getElementById('left-navigation-menu');";
|
||||||
@@ -105,6 +119,7 @@ function render_auth_home_page(array $user): void
|
|||||||
echo " otherButton.setAttribute('aria-selected', String(isActive));";
|
echo " otherButton.setAttribute('aria-selected', String(isActive));";
|
||||||
echo " otherButton.dataset.componentState = isActive ? 'active' : 'inactive';";
|
echo " otherButton.dataset.componentState = isActive ? 'active' : 'inactive';";
|
||||||
echo " });";
|
echo " });";
|
||||||
|
echo " renderMainHeading(button.textContent.trim());";
|
||||||
echo " renderLeftNavigation(button.textContent.trim());";
|
echo " renderLeftNavigation(button.textContent.trim());";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " });";
|
echo " });";
|
||||||
@@ -160,6 +175,7 @@ function render_auth_home_page(array $user): void
|
|||||||
echo " syncMode();";
|
echo " syncMode();";
|
||||||
echo " mediaQuery.addEventListener('change', syncMode);";
|
echo " mediaQuery.addEventListener('change', syncMode);";
|
||||||
echo "})();";
|
echo "})();";
|
||||||
|
echo "renderMainHeading('ERP');";
|
||||||
echo "renderLeftNavigation('ERP');";
|
echo "renderLeftNavigation('ERP');";
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
echo '</body>';
|
echo '</body>';
|
||||||
|
|||||||
@@ -4,3 +4,7 @@
|
|||||||
--text-tab-selected: var(--color-font-light);
|
--text-tab-selected: var(--color-font-light);
|
||||||
--text-tab-unselected: var(--color-dark-grey);
|
--text-tab-unselected: var(--color-dark-grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sg-vsf-list-overview-page-v2 .sg-main-heading {
|
||||||
|
font-weight: var(--font-weight-regular);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user