{% extends "freeadmin/generic_form.html" %}
{% block form %}
    {% if state == 'ABORTED'  %}
        Import of Volume {{ arguments.0 }} Aborted by the User
    {% elif state == 'FAILED' %}
        Import of Volume {{ arguments.0 }} Failed.<br /><br />
        Reason: {{ error }}
        {% if traceback %}
            <br>
            <div class="disclosure-title" onclick="disclosureToggle(this)">Traceback</div>
            <div class="disclosure-wrapper"><div class="disclosure-content">{{ traceback|linebreaks }}</div></div>
        {% endif %}
    {% else %}
        Import of Volume {{ arguments.0 }} Successfully Done
    {% endif %}
    {% if logs_excerpt %}
        <br>
        <div class="disclosure-title" onclick="disclosureToggle(this)">Import's Rsync Log</div>
        <div class="disclosure-wrapper"><div class="disclosure-content">{{ logs_excerpt|linebreaks }}

See full log file at {{ logs_path }}</div></div>
    {% endif %}
{% endblock %}
<br />
{% block buttons %}
    {% if state == 'ABORTED' %}
        <button id="btn_A_Close" data-dojo-type="dijit.form.Button"type="button">
            {% trans "Done" %}
            <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
                cancelDialog(this);
            </script>
        </button>
    {% else %}
        <button id="btn_Import_Done" data-dojo-type="dijit.form.Button" type="submit" data-dojo-props="type:'submit'" class="submitform">
            {% trans "OK" %}
        </button>
    {% endif %}
{% endblock %}

{% block onSubmit %}
doSubmit({
    form: this,
    event: e,
    url: '{% url 'storage_volimport_abort' %}'
});
{% endblock %}