feat: wire heatmap JS/CSS into dashboard widget template
This commit is contained in:
parent
6b1c6068fa
commit
ac198ffe6e
1 changed files with 15 additions and 2 deletions
|
|
@ -3,8 +3,21 @@
|
||||||
{{ title }}
|
{{ title }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block box_body %}
|
{% block box_body %}
|
||||||
<div id="heatmap-container" data-url="{{ path('heatmap_data') }}" style="min-height: 150px; padding: 1rem;">
|
<link rel="stylesheet" href="{{ asset('bundles/kimaiheatmap/heatmap.css') }}">
|
||||||
<p style="color: var(--bs-secondary);">Heatmap visualization coming in Phase 3</p>
|
<div id="heatmap-container"
|
||||||
|
data-url="{{ path('heatmap_data') }}"
|
||||||
|
style="min-height: 150px; overflow-x: auto;">
|
||||||
</div>
|
</div>
|
||||||
|
<script src="{{ asset('bundles/kimaiheatmap/heatmap.js') }}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var initHeatmap = function() {
|
||||||
|
KimaiHeatmap.init(document.getElementById('heatmap-container'));
|
||||||
|
};
|
||||||
|
{% if kimai_context is defined and kimai_context.javascriptRequest %}
|
||||||
|
initHeatmap();
|
||||||
|
{% else %}
|
||||||
|
document.addEventListener('kimai.initialized', initHeatmap);
|
||||||
|
{% endif %}
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endembed %}
|
{% endembed %}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue