chg: [home] Added link to index for each panels
parent
8548332762
commit
3f4e2ae4b8
|
@ -13,7 +13,7 @@ $routes->plugin(
|
|||
['controller' => 'Tags']
|
||||
);
|
||||
|
||||
// $routes->get('/', ['controller' => 'Tags']);
|
||||
$routes->get('/', ['controller' => 'Tags', 'action' => 'index']);
|
||||
// $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']);
|
||||
// $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
<?php
|
||||
// $Parsedown = new Parsedown();
|
||||
// echo $Parsedown->text($md);
|
||||
|
||||
?>
|
||||
|
||||
<h2><?= __('Home') ?></h2>
|
||||
<div class="row">
|
||||
<?php foreach ($statistics as $modelName => $statistics): ?>
|
||||
<div class="col-sm-6 col-md-4 col-l-3 col-xl-2 mb-2">
|
||||
<?php
|
||||
$modelName = explode('.', $modelName);
|
||||
$modelName = $modelName[count($modelName)-1];
|
||||
$exploded = explode('.', $modelName);
|
||||
$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', [
|
||||
'title' => $modelName,
|
||||
'titleHtml' => $panelTitle,
|
||||
'number' => $statistics['amount'],
|
||||
'variation' => $statistics['variation'] ?? '',
|
||||
'chartData' => $statistics['timeline'] ?? []
|
||||
|
|
|
@ -14,10 +14,8 @@ foreach ($chartData as $i => $entry) {
|
|||
|
||||
<div id="<?= $chartId ?>"></div>
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
||||
<script>
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
const passedOptions = <?= json_encode($chartOptions) ?>;
|
||||
const defaultOptions = {
|
||||
chart: {
|
||||
|
@ -57,8 +55,7 @@ foreach ($chartData as $i => $entry) {
|
|||
}
|
||||
const chartOptions = Object.assign({}, defaultOptions, passedOptions)
|
||||
new ApexCharts(document.querySelector('#<?= $chartId ?>'), chartOptions).render();
|
||||
|
||||
})()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -17,8 +17,9 @@ $variationHtml = sprintf('<div class="%s"><span class="%s mr-2"></span>%s</div>'
|
|||
!empty($variation) ? h($variation) : ''
|
||||
);
|
||||
|
||||
$titleHtml = isset($title) ? h($title) : ($titleHtml ?? '');
|
||||
$leftContent = sprintf('<div class="">%s</div><h2 class="my-2">%s</h2>%s',
|
||||
h($title ?? ''),
|
||||
$titleHtml,
|
||||
h($number ?? ''),
|
||||
$variationHtml
|
||||
);
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
:root {
|
||||
--cerebrate: #924da6;
|
||||
}
|
||||
|
||||
.pagination li.page-item > a.page-link > .ellipsis {
|
||||
line-height: 12px;
|
||||
vertical-align: top;
|
||||
|
|
Loading…
Reference in New Issue