{# def form #}
{# Modal dialog - Request storage access #}
{% set storage_source = {
  'model': {
    'ajax': {
      'url': url_for('dashboard', 'all_storage.json'),
      'path': 'data',
    }
  }
} %}
<form method="post"
      action="{{ url_for('dashboard', 'request-storage-access') }}">
  <Modal id="modal-request-storage-access" title={{ _("Request access") }} submit={{ _("Send request") }}>
  <p>{% trans %}Fill out the form below to request access to existing storage shares.{% endtrans %}</p>
  <div class="mb-2">
    {{ form.storage_name.label(class='form-label') }}
    <Typeahead name={{ form.storage_name.name }} source={{ storage_source }} display={{ ["name"] }} placeholder={{ _("Select storage…") }} search_on_focus={{ True }} min_length={{ 0 }} must_select_item={{ True }} submit_button={{ False }} required="required" max_item={{ 1000 }} max_item_per_group={{ 1000 }} generate_on_load={{ True }} />
  </div>
  <Field field={{ form.permission }} />
  <Field field={{ form.reason }} />
  <p>{% trans %}Once submitted, your request will be sent by mail to all owners of the storage share.{% endtrans %}</p>
  </Modal>
</form>
