From 4faecfbbd7ff86457d1a9f4ab0f8f11f2a64d2aa Mon Sep 17 00:00:00 2001 From: mokaddem Date: Sat, 18 Sep 2021 10:22:59 +0200 Subject: [PATCH] chg: [instance:home] Slightly improved UI --- src/Model/Table/InstanceTable.php | 2 +- templates/Instance/home.php | 4 ++-- templates/element/charts/bar.php | 2 +- templates/element/widgets/highlight-panel.php | 14 +++++++++----- webroot/css/main.css | 13 +++++++++++++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Model/Table/InstanceTable.php b/src/Model/Table/InstanceTable.php index 6de1cde..1110597 100644 --- a/src/Model/Table/InstanceTable.php +++ b/src/Model/Table/InstanceTable.php @@ -24,7 +24,7 @@ class InstanceTable extends AppTable return $validator; } - public function getStatistics($days=7): array + public function getStatistics($days=30): array { $models = ['Individuals', 'Organisations', 'Alignments', 'EncryptionKeys', 'SharingGroups', 'Users', 'Tags.Tags']; foreach ($models as $model) { diff --git a/templates/Instance/home.php b/templates/Instance/home.php index d574419..d576185 100644 --- a/templates/Instance/home.php +++ b/templates/Instance/home.php @@ -6,7 +6,7 @@

$statistics): ?> -
+
$modelForDisplay, 'action' => 'index', ]), - ['class' => 'text-white'] + ['class' => 'text-white text-decoration-none fw-light stretched-link'] ); echo $this->element('widgets/highlight-panel', [ 'titleHtml' => $panelTitle, diff --git a/templates/element/charts/bar.php b/templates/element/charts/bar.php index ea3f56a..573a61b 100644 --- a/templates/element/charts/bar.php +++ b/templates/element/charts/bar.php @@ -38,7 +38,7 @@ foreach ($chartData as $i => $entry) { series: [{ data: , }], - colors: ['var(--success)'], + colors: ['var(--bs-light)'], tooltip: { x: { show: false diff --git a/templates/element/widgets/highlight-panel.php b/templates/element/widgets/highlight-panel.php index 6f6881a..4aae72f 100644 --- a/templates/element/widgets/highlight-panel.php +++ b/templates/element/widgets/highlight-panel.php @@ -5,13 +5,13 @@ if ($variation == 0) { $variationIcon = 'minus'; } elseif ($variation > 0) { $variationIcon = 'arrow-up'; - $variationClass = 'text-success'; + $variationClass = 'bg-success'; } else { $variationIcon = 'arrow-down'; - $variationClass = 'text-danger'; + $variationClass = 'bg-danger'; } -$variationHtml = sprintf('
%s
', +$variationHtml = sprintf('
%s
', $variationClass, $this->FontAwesome->getClass($variationIcon), !empty($variation) ? h($variation) : '' @@ -24,7 +24,10 @@ $leftContent = sprintf('
%s

%s

%s', $variationHtml ); $rightContent = sprintf('
%s
', $this->element('charts/bar', [ - 'chartData' => $chartData + 'chartData' => $chartData, + 'chartOptions' => [ + + ] ])); $cardContent = sprintf('
%s
%s
', $leftContent, $rightContent); @@ -32,7 +35,8 @@ $cardContent = sprintf('