{% load i18n %}

{% if module.error %}
    <ul>
        <li>
            {{ module.error }}
        </li>
    </ul>
{% elif module.children %}
    <div class="padding center">
        <canvas id="chart_{{ module.model.pk }}" style="width: 100%;">
            <div class="chart-fillColor"></div>
            <div class="chart-strokeColor"></div>
            <div class="chart-pointColor"></div>
            <div class="chart-pointHighlightFill"></div>
            <div class="chart-scaleGridLineColor"></div>
            <div class="chart-scaleLineColor"></div>
            <div class="chart-scaleFontColor"></div>
            <div class="chart-data">
                {% for data in module.children %}
                    <div class="chart-data-item" data-date="{{ data.0|date:"d/m" }}" data-value="{{ data.1 }}"></div>
                {% endfor %}
            </div>
        </canvas>
        <script>jet.jQuery('#chart_{{ module.model.pk }}').yandexMetrikaChart();</script>
    </div>
{% else %}
    <ul>
        <li>
            {% trans "Nothing to show" %}
        </li>
    </ul>
{% endif %}
