Add OTC order basic card
This commit is contained in:
@@ -14,6 +14,12 @@ function render_auth_home_page(array $user): void
|
|||||||
],
|
],
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
);
|
);
|
||||||
|
$moduleContentCards = json_encode(
|
||||||
|
[
|
||||||
|
'Bestellungen' => '<article class="sg-card" data-component="basic-card"><div class="sg-card-segment sg-card-segment--body sg-card-segment--gray" data-component-part="card-body"><div class="sg-component-row sg-basic-card__actions"><button class="sg-interaction-element sg-button sg-button--active" type="button" data-component="button" data-component-state="active">OTC-Bestellung erfassen</button></div></div></article>',
|
||||||
|
],
|
||||||
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
|
||||||
|
);
|
||||||
$moduleHeadings = json_encode(
|
$moduleHeadings = json_encode(
|
||||||
[
|
[
|
||||||
'Übersicht' => 'Willkommen bei Naurua Übersicht',
|
'Übersicht' => 'Willkommen bei Naurua Übersicht',
|
||||||
@@ -81,12 +87,22 @@ function render_auth_home_page(array $user): void
|
|||||||
echo '<div class="sg-group-card__header-row sg-left-navigation-pattern__header-row">';
|
echo '<div class="sg-group-card__header-row sg-left-navigation-pattern__header-row">';
|
||||||
echo '<h2 class="sg-heading-h2 sg-text-on-dark sg-group-card__heading" data-left-navigation-content-title aria-live="polite">Bestellungen</h2>';
|
echo '<h2 class="sg-heading-h2 sg-text-on-dark sg-group-card__heading" data-left-navigation-content-title aria-live="polite">Bestellungen</h2>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
echo '<div data-left-navigation-content-body>';
|
||||||
|
echo '<article class="sg-card" data-component="basic-card">';
|
||||||
|
echo '<div class="sg-card-segment sg-card-segment--body sg-card-segment--gray" data-component-part="card-body">';
|
||||||
|
echo '<div class="sg-component-row sg-basic-card__actions">';
|
||||||
|
echo '<button class="sg-interaction-element sg-button sg-button--active" type="button" data-component="button" data-component-state="active">OTC-Bestellung erfassen</button>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</article>';
|
||||||
|
echo '</div>';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
echo '<script>';
|
echo '<script>';
|
||||||
echo 'const portalModuleNavigation = ' . $moduleNavigation . ';';
|
echo 'const portalModuleNavigation = ' . $moduleNavigation . ';';
|
||||||
|
echo 'const portalModuleContentCards = ' . $moduleContentCards . ';';
|
||||||
echo 'const portalModuleHeadings = ' . $moduleHeadings . ';';
|
echo 'const portalModuleHeadings = ' . $moduleHeadings . ';';
|
||||||
echo "const renderMainHeading = (moduleName) => {";
|
echo "const renderMainHeading = (moduleName) => {";
|
||||||
echo " const heading = document.querySelector('[data-main-heading]');";
|
echo " const heading = document.querySelector('[data-main-heading]');";
|
||||||
@@ -95,11 +111,14 @@ function render_auth_home_page(array $user): void
|
|||||||
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 contentTitle = document.querySelector('[data-left-navigation-content-title]');";
|
echo " const contentTitle = document.querySelector('[data-left-navigation-content-title]');";
|
||||||
|
echo " const contentBody = document.querySelector('[data-left-navigation-content-body]');";
|
||||||
echo " const menu = document.getElementById('left-navigation-menu');";
|
echo " const menu = document.getElementById('left-navigation-menu');";
|
||||||
echo " if (title) { title.textContent = moduleName; }";
|
echo " if (title) { title.textContent = moduleName; }";
|
||||||
echo " if (!menu) { return; }";
|
echo " if (!menu) { return; }";
|
||||||
echo " const entries = portalModuleNavigation[moduleName] || [];";
|
echo " const entries = portalModuleNavigation[moduleName] || [];";
|
||||||
echo " if (contentTitle) { contentTitle.textContent = entries[0] || ''; }";
|
echo " const activeEntry = entries[0] || '';";
|
||||||
|
echo " if (contentTitle) { contentTitle.textContent = activeEntry; }";
|
||||||
|
echo " if (contentBody) { contentBody.innerHTML = portalModuleContentCards[activeEntry] || ''; }";
|
||||||
echo " menu.innerHTML = '';";
|
echo " menu.innerHTML = '';";
|
||||||
echo " entries.forEach((entry, index) => {";
|
echo " entries.forEach((entry, index) => {";
|
||||||
echo " const button = document.createElement('button');";
|
echo " const button = document.createElement('button');";
|
||||||
@@ -116,7 +135,9 @@ function render_auth_home_page(array $user): void
|
|||||||
echo " menu.querySelectorAll('.sg-tab-button').forEach((otherButton) => {";
|
echo " menu.querySelectorAll('.sg-tab-button').forEach((otherButton) => {";
|
||||||
echo " otherButton.setAttribute('aria-selected', String(otherButton === button));";
|
echo " otherButton.setAttribute('aria-selected', String(otherButton === button));";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " if (contentTitle) { contentTitle.textContent = button.textContent.trim(); }";
|
echo " const entryName = button.textContent.trim();";
|
||||||
|
echo " if (contentTitle) { contentTitle.textContent = entryName; }";
|
||||||
|
echo " if (contentBody) { contentBody.innerHTML = portalModuleContentCards[entryName] || ''; }";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo "};";
|
echo "};";
|
||||||
|
|||||||
@@ -8,3 +8,8 @@
|
|||||||
.sg-vsf-list-overview-page-v2 .sg-main-heading {
|
.sg-vsf-list-overview-page-v2 .sg-main-heading {
|
||||||
font-weight: var(--font-weight-regular);
|
font-weight: var(--font-weight-regular);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sg-basic-card__actions {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user