{% load i18n static simpletags sptags %}
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
  <meta charset="UTF-8">
  <title>{{ cl.opts.app_config.verbose_name }}-{{title}}</title>

   {% block css %}
        {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
            <link rel="stylesheet" href="{% static '/admin/simpleui-x/elementui/theme-chalk/index.css' %}?_={% get_sp_version %}">
            <link rel="stylesheet" href="{% static '/admin/simpleui-x/fontawesome-free-5.8.1-web/css/all.min.css' %}?_={% get_sp_version %}">
        {% else %}
            <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
            <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/5.8.1/css/all.min.css">
        {% endif %}
            <link rel="stylesheet" href="{% static '/admin/simplepro/css/list.css' %}?_={% get_sp_version %}">
    {% endblock %}
    {% if media.css %}
        {% for css in media.css %}
        <link rel="stylesheet" href="{% static css %}">
        {% endfor %}
    {% endif %}
</head>
<body class="body">
      {% block body_js %}
        <script type="text/javascript">
            if(parent.progress){
                parent.progress.start();
            }
        </script>
      {% endblock %}

    <div id="theme">
        <link v-if="theme && theme!=''" rel="stylesheet" :href="theme">
        {% if "SIMPLEUI_DEFAULT_THEME"|get_config %}
        <link v-else rel="stylesheet" href="{% static 'admin/simpleui-x/theme/' %}{{ "SIMPLEUI_DEFAULT_THEME"|get_config }}">
        {% endif %}
    </div>
    {% csrf_token %}
    <script type="text/javascript">
        var searchModels={{searchModels|safe}};
        var tz='{% get_tz_suffix %}';
        var messages={{ mlist|safe }};
        var has_editor = '{{ has_editor }}';
    </script>
    <div id="app" v-cloak>
        <div class="panel">
            <div class="panel-body">
                {% block panel-body %}

                <!-- search form -->
                {% include 'admin/results/form.html' %}
                <!-- toolbar -->
                {% include 'admin/results/toolbar.html' %}
                <!-- table -->
                {% include 'admin/results/table.html' %}
                <!-- pagination -->
                {% include 'admin/results/pagination.html' %}

                {% endblock %}
            </div>
        </div>

        <el-dialog @closed="dialogClose" title="编辑" :visible.sync="dialog.visible">
            <iframe ref="editorFrame" :src="dialog.url" frameborder="0" height="50%" width="100%"></iframe>
             <span slot="footer" class="dialog-footer">
                <el-button @click="dialog.visible = false">取 消</el-button>
                <el-button type="primary" @click="iframeSubmit()">确 定</el-button>
              </span>
        </el-dialog>

    </div>
     {% if media.js %}
        {% for js in media.js %}
        <script type="text/javascript" src="{% static js %}"></script>
        {% endfor %}
    {% endif %}
    {% block js %}
        <script type="text/javascript" src="{% static '/admin/simpleui-x/js/cookie.js' %}?_={% get_sp_version %}"></script>
        {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
            <script type="text/javascript" src="{% static '/admin/simpleui-x/js/vue.min.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" src="{% static '/admin/simplepro/js/axios.min.js' %}?_={% get_sp_version %}"></script>
            <script type="text/javascript" src="{% static '/admin/simplepro/js/list.js' %}?_={% get_sp_version %}"></script>
            <script type="text/javascript" src="{% static '/admin/simplepro/js/gotop.js' %}?_={% get_sp_version %}"></script>
            <div id="gotop">
                <gotop></gotop>
            </div>
            <script type="text/javascript">
                window.addEventListener('load',__=>{
                    new Vue({el: '#gotop'});
                });
            </script>
    {% endblock %}
</body>
</html>