{% extends basetpl %}
{% load i18n %}
{% load static %}
{% block inner %}
    <h2>{% trans "Import result" %}</h2>
    {% if job.state == "running" or job.state == "pending" %}
        <div class="empty-collection" data-job-waiting data-job-waiting-url="{% if request.event %}{% url "plugins:banktransfer:import.job" event=request.event.slug organizer=request.event.organizer.slug job=job.pk %}{% else %}{% url "plugins:banktransfer:import.job" organizer=request.organizer.slug job=job.pk %}{% endif %}?ajax=1">
            <p>
                <span class="fa big-grey-icon fa-cog fa big-rotating-icon"></span>
            </p>
            <p>
                {% trans "The result of your import is in progress. Please be patient while we process the data …" %}
            </p>
        </div>
    {% else %}
        {% if job.state == "error" %}
            <div class="alert alert-danger">
                {% trans "An internal error occurred during processing your data." %}
                {% trans "Some transactions might be missing, please try to re-import the file." %}
            </div>
        {% elif transactions_ignored == 0 and transactions_invalid == 0 and transactions_valid == 0 %}
            <div class="alert alert-info">
                {% trans "Your import did not contain any transactions that you did not import before." %}
            </div>
        {% endif %}

        <table class="table table-condensed">
            <tr class="success">
                <td>{{ transactions_valid }}</td>
                <td>{% trans "Orders marked as paid" %}</td>
            </tr>
            <tr class="warning">
                <td>{{ transactions_invalid }}</td>
                <td>{% trans "Invalid payments" %}</td>
            </tr>
            <tr class="info">
                <td>{{ transactions_ignored }}</td>
                <td>{% trans "Ignored payments" %}</td>
            </tr>
        </table>
        {% if transactions_ignored or transactions_invalid %}
            <a href="{% if request.event %}{% url "plugins:banktransfer:import" event=request.event.slug organizer=request.organizer.slug %}{% else %}{% url "plugins:banktransfer:import" organizer=request.organizer.slug %}{% endif %}"
                class="btn btn-primary">
                {% trans "Review invalid and ignored payments" %} &raquo;
            </a>
        {% endif %}

    {% endif %}
    <script type="application/javascript" src="{% static "pretixplugins/banktransfer/ui.js" %}"></script>
{% endblock %}
