dashboard widgets are configurable via config (#269)

This commit is contained in:
Kevin Papst
2018-08-17 23:17:02 +02:00
committed by GitHub
parent 7804ef83ce
commit dbbb434723
49 changed files with 2011 additions and 938 deletions

View File

@@ -9,26 +9,11 @@
{% block main %}
{% for row in widget_rows %}
{% if row.title %}
{{ widgets.page_header(row.title) }}
{% if row.type == constant('App\\Model\\DashboardSection::TYPE_CHART') %}
{% embed 'dashboard/section-chart.html.twig' with { section: row } %}{% endembed %}
{% else %}
{% embed 'dashboard/section-simple.html.twig' with { section: row } %}{% endembed %}
{% endif %}
{% set width = row.widgets|length %}
{% set rawWidth = 12 / width %}
{% set columnWidth = rawWidth|round(0, 'floor') %}
<div class="row">
{% for widgetTemplate in row.widgets %}
<div class="col-md-{{ columnWidth }} col-sm-{{ columnWidth * 2 }} col-xs-{{ columnWidth * 4 }}">
{{
include(
template_from_string(
'{% import "macros/widgets.html.twig" as widgets %}' ~ widgetTemplate
)
)
}}
</div>
{% endfor %}
</div>
{% endfor %}
{% endblock %}