From 9ba044cc4081e7c7daa1863ce7cb1c3803e6ec8a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 29 Mar 2024 15:25:59 +0000 Subject: [PATCH] started with template fixes --- Theme/Backend/balance-dashboard.tpl.php | 26 +++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Theme/Backend/balance-dashboard.tpl.php b/Theme/Backend/balance-dashboard.tpl.php index fdd8952..97c973c 100644 --- a/Theme/Backend/balance-dashboard.tpl.php +++ b/Theme/Backend/balance-dashboard.tpl.php @@ -14,15 +14,18 @@ declare(strict_types=1); use phpOMS\Localization\ISO639Enum; -function render_accounts(array $accounts) : string +function render_accounts(array $accounts, int $depth = 0) : string { + $padding = $depth * 10; + $width = 200 - $padding; + $row = ''; foreach ($accounts as $account) { $row .= <<
-
{$account->code} - {$account->getL11n()}
+
{$account->code} - {$account->getL11n()}
123,456.00
123,456.00
123,456.00
@@ -45,12 +48,15 @@ function render_accounts(array $accounts) : string return $row; } -function render_elements(array $elements, ?int $parent = null) : string +function render_elements(array $elements, ?int $parent = null, int $depth = 0) : string { $row = ''; $fn = 'render_elements'; $acc = 'render_accounts'; + $padding = $depth > 0 ? 10 : 0; + $width = 200 - $padding * $depth; + foreach ($elements as $element) { if ($element->parent !== $parent) { continue; @@ -69,11 +75,11 @@ function render_elements(array $elements, ?int $parent = null) : string $expanded = $element->expanded ? ' checked' : ''; $row .= << +
{$expand}
-
{$element->getL11n()}
+
{$element->getL11n()}
123,456.00
123,456.00
123,456.00
@@ -92,8 +98,8 @@ function render_elements(array $elements, ?int $parent = null) : string
- {$fn($elements, $element->id)} - {$acc($element->accounts)} + {$fn($elements, $element->id, $depth + 1)} + {$acc($element->accounts, $depth)}
ROW; @@ -188,8 +194,8 @@ echo $this->data['nav']->render(); } .name-col { - width: 150px; - min-width: 150px; + width: 200px; + min-width: 200px; padding-left: 0px; border-right: 1px solid #000; overflow: clip; @@ -307,7 +313,7 @@ echo $this->data['nav']->render();
-
getHtml('Category'); ?>
+
getHtml('Category'); ?>
1
2
3