{% load i18n common %}

<style>
  #id_exportForm dl { max-height:100px; }
</style>

<div>
  <form id="id_exportForm" class="layui-form export-form" style="padding: 5px 20px" lay-filter="exportForm">
    {% csrf_token %}
    <input type="hidden" value="{{ is_virtual }}" name="is_virtual">
    <input type="hidden" value="{{ page_size }}" name="page_size">
    <input type="hidden" value="{{ export_type }}" name="export_type">
    <div class="layui-form-item">
      <label class="layui-form-label" for="" style="padding: 9px 5px;width: 140px;">{% trans 'exportForm_itemLabel_scope' %}</label>
      <div class="layui-input-block">
        <input type="radio" name="page" value="{{ page }}" title="{% trans 'exportForm_exportScope_optionCurPage' %}">
        <input type="radio" name="page" value="" title="{% trans 'exportForm_exportScope_optionAll' %}">
      </div>
    </div>
    {% if export_type|available_style %}
      {% block exportForm_item_extra %}
      <div class="layui-form-item">
        <label class="layui-form-label" for="id_export_style" style="width: 140px;">{% trans 'exportForm_itemLabel_exportStyle' %}</label>
        <div class="layui-input-inline ">
          <select class="layui-input" name="export_style" id="id_export_style">
            <option value="">{% trans 'exportForm_exportStyle_optionDefault' %}</option>
          </select>
        </div>
      </div>
      {% endblock %}
    {% endif %}
    {% if export_type == 'pdf' %}
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 140px;">{% trans 'pdfExport_pageSize' %}</label>
      <div class="layui-input-inline">
        <select class="layui-input" name="pdf-page-size">
          <option value="Default">{% trans 'exportForm_exportStyle_optionDefault' %}</option>
          <option value="Auto">{% trans 'pdfExport_auto' %}</option>
          <option value="A0">A0</option>
          <option value="A1">A1</option>
          <option value="A2">A2</option>
          <option value="A3">A3</option>
          <option value="A4">A4</option>
          <option value="A5">A5</option>
          <option value="B0">B0</option>
          <option value="B1">B1</option>
          <option value="B2">B2</option>
          <option value="B3">B3</option>
          <option value="B4">B4</option>
          <option value="B5">B5</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" style="width: 140px;">{% trans 'pdfExport_orientation' %}</label>
      <div class="layui-input-inline">
        <select name="orientation">
          <option value="Default">{% trans 'exportForm_exportStyle_optionDefault' %}</option>
          <option value="Portrait">{% trans 'pdfExport_orientation_portrait' %}</option>
          <option value="Landscape">{% trans 'pdfExport_orientation_landscape' %}</option>
        </select>
      </div>
    </div>
    {% endif %}
  </form>
</div>
<script>
  layui.use(['form'], function(){
    var form = layui.form;
    form.render();
    form.val('exportForm', {page: '{{ page }}'})
  })
</script>
