{% load i18n static %}
<div style="padding: 10px;min-height: 300px;min-width: 450px">
  <form class="layui-form action-form" action="" method="post" id="{{ model_name }}_{{ action_repr }}">
    {% csrf_token %}
    {% if form %}
      <div>
        {% for fieldset in form %}
          {% include "layui/includes/fieldset.html" %}
        {% endfor %}
      </div>
    {% endif %}
  </form>
</div>
<script>
    $(".layui-layer-btn0").click(function () {
      if (!$("input[name='upgrade_file']").val()){
        $("#id_upgrade_file").css({'border':'solid', 'border-color': 'red', 'border-width': '1px', 'border-radius': '2px'})
      }
    });
</script>
<script>
  layui.use(['form', 'laydate'], function () {
    var form = layui.form;
    var laydate = layui.laydate;
    $("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'});
    });
    {% block form_verify %}
      form.verify({});
    {% endblock %}
    form.render();
  });
</script>
