chg: [UI] Asset loader for statistics

pull/8319/head
Jakub Onderka 2022-04-20 11:57:26 +02:00
parent b6aac6347a
commit 9827449a37
7 changed files with 21 additions and 25 deletions

View File

@ -2138,7 +2138,6 @@ class UsersController extends AppController
}
$treemap['children'][] = $newElement;
}
$taxonomyColourCodes = array();
$taxonomies = array_merge(array('custom'), $taxonomies);
if ($this->_isRest()) {
$data = array(
@ -2147,12 +2146,11 @@ class UsersController extends AppController
);
return $this->RestResponse->viewData($data, $this->response->type());
} else {
$this->set('taxonomyColourCodes', $taxonomyColourCodes);
$this->set('taxonomies', $taxonomies);
$this->set('flatData', $flatData);
$this->set('treemap', $treemap);
$this->set('tags', $tags);
$this->layout = 'treemap';
$this->layout = false;
$this->render('ajax/tag_statistics_graph');
}
}

View File

@ -1,3 +0,0 @@
<?php
echo $this->Html->css('treemap');
echo $content_for_layout;

View File

@ -1,5 +1,7 @@
<?php
echo $this->Html->script('d3');
<?= $this->element('genericElements/assetLoader', [
'css' => ['treemap'],
'js' => ['d3', 'treemap'],
]);
?>
<div id="treemapSettings">
<div class="row">
@ -25,4 +27,3 @@
var taxonomies = <?php echo json_encode($taxonomies); ?>;
var hiddenTaxonomies = [];
</script>
<?php echo $this->Html->script('treemap'); ?>

View File

@ -1,7 +1,7 @@
<?php
echo $this->Html->script('d3');
echo $this->Html->script('cal-heatmap');
echo $this->Html->css('cal-heatmap');
<?= $this->element('genericElements/assetLoader', [
'css' => ['cal-heatmap'],
'js' => ['d3', 'cal-heatmap'],
]);
?>
<div class = "index">
<h2><?php echo __('Statistics');?></h2>

View File

@ -1,7 +1,7 @@
<?php
echo $this->Html->script('d3');
echo $this->Html->script('cal-heatmap');
echo $this->Html->css('cal-heatmap');
<?= $this->element('genericElements/assetLoader', [
'css' => ['cal-heatmap'],
'js' => ['d3', 'cal-heatmap'],
]);
?>
<div class = "index">
<h2><?php echo __('Statistics');?></h2>

View File

@ -1,7 +1,7 @@
<?php
echo $this->Html->script('d3');
echo $this->Html->script('cal-heatmap');
echo $this->Html->css('cal-heatmap');
<?= $this->element('genericElements/assetLoader', [
'css' => ['cal-heatmap'],
'js' => ['d3', 'cal-heatmap'],
]);
?>
<div class = "index">
<h2><?php echo __('Statistics');?></h2>

View File

@ -1,7 +1,7 @@
<?php
echo $this->Html->script('d3');
echo $this->Html->script('cal-heatmap');
echo $this->Html->css('cal-heatmap');
<?= $this->element('genericElements/assetLoader', [
'css' => ['cal-heatmap'],
'js' => ['d3', 'cal-heatmap'],
]);
?>
<div class = "index">
<h2><?php echo __('Statistics');?></h2>