{% load i18n static %}
<style>
    .layui-layer-page .layui-layer-content {
        position: initial;
        height: 510px !important;
    }
</style>
<div id="{{ model_name }}_edit_form" style="{% block form_style %}padding: 10px;{% endblock %}">
    {% block edit_form %}
    <form class="layui-form data-form" action="" method="post"  enctype="multipart/form-data">
        {% csrf_token %}
        <div style='height:400px;'>
            {% for fieldset in adminform %}
              {% include "layui/includes/fieldset_2c.html" %}
            {% endfor %}
        </div>
        {% block add_fields %}
        {% endblock %}
    </form>
    {% endblock %}
</div>
<script>
    layui.use(['form', 'laydate'], function() {
        var form = layui.form, laydate = layui.laydate;
        form.render();
        $("form.layui-form input.layui-datetime").each(function(){
            laydate.render({elem: this, type: 'datetime'});
        });
        $("form.layui-form input.layui-date").each(function(){
            laydate.render({elem: this, type: 'date'});
        });
        $("form.layui-form input.layui-time").each(function(){
            laydate.render({elem: this, type: 'time'});
        });
    });
</script>
