From 1c915cd077e7bc4cb52dc761150b702b76f2f038 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 2 Mar 2020 23:07:23 +0100 Subject: [PATCH] chg: [dashboard] views for widgets updated --- app/View/Dashboards/Widgets/BarChart.ctp | 9 +++++---- app/View/Dashboards/Widgets/SimpleList.ctp | 17 +++++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/View/Dashboards/Widgets/BarChart.ctp b/app/View/Dashboards/Widgets/BarChart.ctp index 93d1472c8..822de420b 100644 --- a/app/View/Dashboards/Widgets/BarChart.ctp +++ b/app/View/Dashboards/Widgets/BarChart.ctp @@ -12,18 +12,19 @@ } echo sprintf( '%s%s', - 'text-align:right;width:33%;', + 'text-align:right;width:33%;white-space:nowrap;', h($entry), 'width:100%', sprintf( - '
%s
', + '
%s%s
', h($entry) . ': ' . h($count), sprintf( 'background-color:%s; width:%s; color:white; text-align:center;', (empty($data['colours'][$entry]) ? '#0088cc' : h($data['colours'][$entry])), - 100 * h($value) / $max . '%;' + ($max == 0 ? 0 : 100 * h($value) / $max) . '%;' ), - h($count) + h($count), + !empty($data['output_decorator']) ? '%' : '' ), ' ' ); diff --git a/app/View/Dashboards/Widgets/SimpleList.ctp b/app/View/Dashboards/Widgets/SimpleList.ctp index 56821a0ce..273a6c2ff 100644 --- a/app/View/Dashboards/Widgets/SimpleList.ctp +++ b/app/View/Dashboards/Widgets/SimpleList.ctp @@ -1,9 +1,14 @@ %s: %s%s', - h($element['title']), - empty($element['value']) ? '' : h($element['value']), - empty($element['html']) ? '' : $element['html'] - ); + if (!empty($element['type']) && $element['type'] === 'gap') { + echo '
'; + } else { + echo sprintf( + '
%s: %s%s
', + h($element['title']), + empty($element['class']) ? 'blue' : h($element['class']), + !isset($element['value']) ? '' : h($element['value']), + empty($element['html']) ? '' : $element['html'] + ); + } }