{% extends "admin/import_export/base.html" %}
{% load i18n %}
{% load admin_urls %}
{% load import_export_tags %}
{% load simpletags static %}

{% block breadcrumbs_last %}
{% trans "Export" %}
{% endblock %}

{% block extrastyle %}{{ block.super }}
    {% block css %}
        {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
            <link rel="stylesheet" href="{% static '/admin/simpleui-x/elementui/theme-chalk/index.css' %}">
        {% else %}
            <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
        {% endif %}
    {% endblock %}
{% endblock %}

{% block content %}
 <div id="app">
        <el-page-header @back="goBack" content="{{ title }}"/>
    </div>
    <script type="text/javascript" src="{% static '/admin/simpleui-x/js/cookie.js' %}"></script>
    {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
        <script type="text/javascript" src="{% static '/admin/simpleui-x/elementui/index.js' %}"></script>
    {% else %}
        <script src="https://cdn.jsdelivr.net/npm/vue"></script>
        <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    {% endif %}

    <script type="text/javascript">
        function go_back() {
            window.location.href = '{% get_model_url %}';
        }

        new Vue({
            el: '#app',
            methods: {
                goBack: function () {
                    window.go_back()
                }
            }
        })
    </script>
<form action="" method="POST">
  {% csrf_token %}

    <fieldset class="module aligned">
      {% for field in form %}
        <div class="form-row">
          {{ field.errors }}

          {{ field.label_tag }}

          {{ field }}

          {% if field.field.help_text %}
          <p class="help">{{ field.field.help_text|safe }}</p>
          {% endif %}
        </div>
      {% endfor %}
    </fieldset>

    <div class="submit-row">
        <button type="button" onclick="go_back()" class="el-button el-button--button"
                        style="float: left; margin-right: 10px; margin-bottom: 10px;"><!----><i
                        class="el-icon-arrow-left"></i><span><span>返回</span></span></button>
      <input type="submit" class="el-button el-button--primary" value="{% trans "Submit" %}">
    </div>
</form>
{% endblock %}
