{% extends "layouts/charts_base.html" %} {# Generate all the charts for a row (grid mode only) #} {%- macro chart_row(rownum, modules=None) %}

Add a widget to row {{ rownum }} Delete row

{% if modules %} {% for module in modules %} {{ chart(module=module) }} {% endfor %} {% endif %}
{% endmacro -%} {# Macro to create a new chart template or existing chart from a config #} {%- macro chart(module=None) %} {% if module %} {% set dims = module|get_dims %} {% set fixedcol = view.layout == 'grid' %} {% if fixedcol %} {% set colcount = dims.width|string|replace('col-', '') %}
{% endif %} {% if fixedcol %}
{% endif %} {% endif %} {% endmacro -%} {% block chart_body %}

{% if not demo_mode %} Back {% endif %} {{ view.name }} {% if can_edit and not demo_mode %} {% include "partials/dashboard-options.html" %} {% endif %}

{% if can_edit %}
{% if not view.modules|length %}

It looks like this dashboard has no modules - add some!

{% endif %}
{% include "partials/dashboard-global-form.html" %}
{% include "partials/dashboard-json-form.html" %} {% endif %}
{% if view.layout == 'grid' %} {% for row in modules %} {{ chart_row(loop.index, modules=row) }} {% endfor %} {% else %} {% for module in modules %} {{ chart(module=module) }} {% endfor %} {% endif %}
{# Used as a template to clone from in js only #}
{% include "partials/dashboard-edit-modal.html" %} {% endblock %}