{% load i18n common %}
<div style="padding: 10px;min-height: 410px;min-width: 650px">
  <form class="layui-form action-form" action="" method="post" id="{{ model_name }}_{{ action_repr }}"
        enctype="multipart/form-data">
    {% csrf_token %}
    {% with form.form as f %}
      <div style="padding-bottom: 20px">{{ f.emp }}</div>
    {% endwith %}
  </form>
</div>
<script>
    $('#{{model_name}}_{{action_repr}}').find('input[id^={{model_name}}][id$=_show]').click(function () {
        $('#{{model_name}}_{{action_repr}}').find('.tree-content')[0].height = '150px';
        $('#{{model_name}}_{{action_repr}}').find('.tree-content').css("max-height", '180px');
    });

    $(".layui-layer-btn0").click(function (e) {
        e.preventDefault();
        var employee_count = layui.table.checkStatus('id-employee-frame-selected').data;
        if (employee_count.length > 5000) {
            e.stopPropagation();
            e.stopImmediatePropagation();
            layer.alert(gettext('The maximum number of Employees allowed is 5000.'), {
                title: gettext('system_exception')
                , icon: 5
                , btn: gettext('btn_confirm')
            });
            return false;
        }
    });
</script>
