27
templates/dashboard/index.html.twig
Normal file
27
templates/dashboard/index.html.twig
Normal file
@@ -0,0 +1,27 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'dashboard.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'dashboard.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% for settings in dashboard_widgets %}
|
||||
{% if settings.header %}
|
||||
{{ widgets.page_header(settings.header) }}
|
||||
{% endif %}
|
||||
|
||||
{% set width = settings.widgets|length %}
|
||||
{% set rawWidth = 12 / width %}
|
||||
{% set columnWidth = rawWidth|round(0, 'floor') %}
|
||||
<div class="row">
|
||||
{% for widgetTemplate in settings.widgets %}
|
||||
<div class="col-md-{{ columnWidth }} col-sm-{{ columnWidth * 2 }} col-xs-{{ columnWidth * 4 }}">
|
||||
{% set widgetString = '{% import "macros/widgets.html.twig" as widgets %}' ~ widgetTemplate %}
|
||||
{{ include(template_from_string(widgetString)) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user