{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load compress %}
{% load staticfiles %}
{% block title %}{% trans "Statistics" %}{% endblock %}
{% block content %}
    <h1>{% trans "Statistics" %}</h1>
    {% if has_orders %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{% trans "Orders by day" %}</h3>
            </div>
            <div class="panel-body">
                <div id="obd_chart" class="chart"></div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{% trans "Revenue over time" %}</h3>
            </div>
            <div class="panel-body">
                <div id="rev_chart" class="chart"></div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{% trans "Orders by product" %}</h3>
            </div>
            <div class="panel-body">
                <div id="obp_chart" class="chart"></div>
            </div>
        </div>
        <script type="application/json" id="obd-data">{{ obd_data|safe }}</script>
        <script type="application/json" id="rev-data">{{ rev_data|safe }}</script>
        <script type="application/json" id="obp-data">{{ obp_data|safe }}</script>
        <script type="application/text" id="currency">{{ request.event.currency }}</script>
        <script type="application/javascript" src="{% static "pretixplugins/statistics/statistics.js" %}"></script>
    {% else %}
        <div class="empty-collection">
            <p>
                <span class="fa big-grey-icon fa-line-chart"></span>
            </p>
            <p>
                {% blocktrans trimmed %}
                    We will show you a variety of statistics about your sales right here, as soon as the first orders
                    are submitted!
                {% endblocktrans %}
            </p>
        </div>
    {% endif %}
{% endblock %}

