<div
  class="modal"
  id="export-modal-{{ dataset }}"
  data-export-dataset="{{ dataset }}"
>
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Export {{ dataset|capitalize }}</h5>
        <button
          type="button"
          class="btn-close"
          data-dismiss="modal"
          aria-label="Close"
        ></button>
      </div>
      <form method="post" action="{{ submit_url }}" data-export-form>
        <div class="modal-body">
          <div class="mb-3">
            <label class="form-label" for="export-format">Format</label>
            <select class="form-select" id="export-format" name="format">
              <option value="csv">CSV</option>
              <option value="xlsx">Excel (.xlsx)</option>
            </select>
          </div>
          <div class="form-check">
            <input
              class="form-check-input"
              type="checkbox"
              value="true"
              id="include-metadata"
              name="include_metadata"
            />
            <label class="form-check-label" for="include-metadata">
              Include metadata sheet (Excel only)
            </label>
          </div>
          <small class="form-text text-muted"
            >Filters can be adjusted in the advanced export section.</small
          >
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">
            Cancel
          </button>
          <button type="submit" class="btn btn-primary">Download</button>
        </div>
        <p class="form-error hidden" data-export-error></p>
      </form>
    </div>
  </div>
</div>
