custom/plugins/MoorlForms/src/Resources/views/plugin/moorl-fb/component/element/upload.html.twig line 1

Open in your IDE?
  1. {% sw_extends "@MoorlForms/plugin/moorl-fb/component/element/field.html.twig" %}
  2. {% set sectionConfig = {
  3.     value: element.value,
  4.     mediaUrl: element.media.url,
  5.     mediaId: element.media.id
  6. } %}
  7. {% block input_el %}
  8.     {% if element.media %}
  9.         <input type="hidden" name="{{ elementTechnicalName }}" value='{{ sectionConfig|json_encode|raw }}'>
  10.     {% endif %}
  11.     <div class="custom-file">
  12.         <input type="file"
  13.                accept="{{ element.config.upload.accept|join(',') }}"
  14.                name="{{ elementTechnicalName }}"
  15.                placeholder="{{ element.translated.placeholder ?: element.translated.name }}"
  16.                {% if element.required %}required{% endif %}
  17.                class="custom-file-input"
  18.                id="{{ elementId }}">
  19.         <label class="custom-file-label" title="{{ "moorl-fb.browse"|trans }}"
  20.                for="{{ elementId }}">{{ element.translated.placeholder ?: element.translated.name }}</label>
  21.     </div>
  22. {% endblock %}
  23. {% block input_subline %}
  24.     {% if element.config.upload.mediaType == 'custom' %}
  25.         <small class="text-muted">{{ element.config.upload.accept|join(', ') }}</small>
  26.     {% elseif element.config.upload.mediaType != 'all' %}
  27.         <small class="text-muted">{{ "moorl-fb.mediaType.#{element.config.upload.mediaType}"|trans }}</small>
  28.     {% endif %}
  29. {% endblock %}