chg: [home] Added link to index for each panels
parent
8548332762
commit
3f4e2ae4b8
|
@ -13,7 +13,7 @@ $routes->plugin(
|
||||||
['controller' => 'Tags']
|
['controller' => 'Tags']
|
||||||
);
|
);
|
||||||
|
|
||||||
// $routes->get('/', ['controller' => 'Tags']);
|
$routes->get('/', ['controller' => 'Tags', 'action' => 'index']);
|
||||||
// $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']);
|
// $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']);
|
||||||
// $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']);
|
// $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
// $Parsedown = new Parsedown();
|
// $Parsedown = new Parsedown();
|
||||||
// echo $Parsedown->text($md);
|
// echo $Parsedown->text($md);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<h2><?= __('Home') ?></h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php foreach ($statistics as $modelName => $statistics): ?>
|
<?php foreach ($statistics as $modelName => $statistics): ?>
|
||||||
<div class="col-sm-6 col-md-4 col-l-3 col-xl-2 mb-2">
|
<div class="col-sm-6 col-md-4 col-l-3 col-xl-2 mb-2">
|
||||||
<?php
|
<?php
|
||||||
$modelName = explode('.', $modelName);
|
$exploded = explode('.', $modelName);
|
||||||
$modelName = $modelName[count($modelName)-1];
|
$modelForDisplay = $exploded[count($exploded)-1];
|
||||||
|
$panelTitle = $this->Html->link(
|
||||||
|
h($modelForDisplay),
|
||||||
|
$this->Url->build([
|
||||||
|
'controller' => $modelForDisplay,
|
||||||
|
'action' => 'index',
|
||||||
|
]),
|
||||||
|
['class' => 'text-white']
|
||||||
|
);
|
||||||
echo $this->element('widgets/highlight-panel', [
|
echo $this->element('widgets/highlight-panel', [
|
||||||
'title' => $modelName,
|
'titleHtml' => $panelTitle,
|
||||||
'number' => $statistics['amount'],
|
'number' => $statistics['amount'],
|
||||||
'variation' => $statistics['variation'] ?? '',
|
'variation' => $statistics['variation'] ?? '',
|
||||||
'chartData' => $statistics['timeline'] ?? []
|
'chartData' => $statistics['timeline'] ?? []
|
||||||
|
|
|
@ -14,51 +14,48 @@ foreach ($chartData as $i => $entry) {
|
||||||
|
|
||||||
<div id="<?= $chartId ?>"></div>
|
<div id="<?= $chartId ?>"></div>
|
||||||
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
|
||||||
<script>
|
<script>
|
||||||
(function() {
|
$(document).ready(function() {
|
||||||
const passedOptions = <?= json_encode($chartOptions) ?>;
|
const passedOptions = <?= json_encode($chartOptions) ?>;
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
chart: {
|
chart: {
|
||||||
id: '<?= $chartId ?>',
|
id: '<?= $chartId ?>',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
sparkline: {
|
sparkline: {
|
||||||
enabled: true
|
enabled: true
|
||||||
|
},
|
||||||
|
dropShadow: {
|
||||||
|
enabled: true,
|
||||||
|
top: 1,
|
||||||
|
left: 1,
|
||||||
|
blur: 2,
|
||||||
|
opacity: 0.2,
|
||||||
|
},
|
||||||
|
animations: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
dropShadow: {
|
series: [{
|
||||||
enabled: true,
|
data: <?= json_encode($data) ?>,
|
||||||
top: 1,
|
}],
|
||||||
left: 1,
|
colors: ['var(--success)'],
|
||||||
blur: 2,
|
tooltip: {
|
||||||
opacity: 0.2,
|
x: {
|
||||||
},
|
show: false
|
||||||
animations: {
|
},
|
||||||
enabled: false
|
y: {
|
||||||
},
|
title: {
|
||||||
},
|
formatter: function formatter(val) {
|
||||||
series: [{
|
return '';
|
||||||
data: <?= json_encode($data) ?>,
|
}
|
||||||
}],
|
|
||||||
colors: ['var(--success)'],
|
|
||||||
tooltip: {
|
|
||||||
x: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
y: {
|
|
||||||
title: {
|
|
||||||
formatter: function formatter(val) {
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
theme: '<?= !empty($darkMode) ? 'dark' : 'light' ?>'
|
||||||
},
|
},
|
||||||
theme: '<?= !empty($darkMode) ? 'dark' : 'light' ?>'
|
}
|
||||||
},
|
const chartOptions = Object.assign({}, defaultOptions, passedOptions)
|
||||||
}
|
new ApexCharts(document.querySelector('#<?= $chartId ?>'), chartOptions).render();
|
||||||
const chartOptions = Object.assign({}, defaultOptions, passedOptions)
|
})
|
||||||
new ApexCharts(document.querySelector('#<?= $chartId ?>'), chartOptions).render();
|
|
||||||
|
|
||||||
})()
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -17,8 +17,9 @@ $variationHtml = sprintf('<div class="%s"><span class="%s mr-2"></span>%s</div>'
|
||||||
!empty($variation) ? h($variation) : ''
|
!empty($variation) ? h($variation) : ''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$titleHtml = isset($title) ? h($title) : ($titleHtml ?? '');
|
||||||
$leftContent = sprintf('<div class="">%s</div><h2 class="my-2">%s</h2>%s',
|
$leftContent = sprintf('<div class="">%s</div><h2 class="my-2">%s</h2>%s',
|
||||||
h($title ?? ''),
|
$titleHtml,
|
||||||
h($number ?? ''),
|
h($number ?? ''),
|
||||||
$variationHtml
|
$variationHtml
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
:root {
|
||||||
|
--cerebrate: #924da6;
|
||||||
|
}
|
||||||
|
|
||||||
.pagination li.page-item > a.page-link > .ellipsis {
|
.pagination li.page-item > a.page-link > .ellipsis {
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
Loading…
Reference in New Issue