{% load i18n static %}
{% load iclock_tags %}
{% load common %}

<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 %}
        {% with adminform.form as f %}
            <div>
                <div class="layui-form-item">
                    {% layui_inline f.name %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline f.task %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline f.interval %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline f.crontab %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline_hidden f.args %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline_hidden f.kwargs %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline f.enabled %}
                </div>
                <div class="layui-form-item">
                    {% layui_inline f.description %}
                </div>
            </div>
        {% endwith %}

        {% 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>
