apostrophe-forms
Version:
Build forms for ApostropheCMS in a simple user interface.
17 lines • 1.27 kB
HTML
{
{% set id = apos.utils.generateId() %}
{% set widget = data.widget %}
{% set classPrefix = data.widget.classPrefix %}
<label for="{{ id }}" class="apos-forms-label {{classPrefix + '__label' if classPrefix }}">
{{ widget.fieldLabel}}
{% if widget.required %}
<span class="apos-forms-field-required"> {{ __("(Required)") }}</span>
{% else %}
<span class="apos-forms-field-optional"> {{ __("(Optional)") }}</span>
{% endif %}
<span class="apos-forms-label-message {{ classPrefix + '__label-message' if classPrefix }}" data-apos-input-message="{{ widget.fieldName}}" hidden></span>
<span class="apos-forms-label-message {{ classPrefix + '__label-message' if classPrefix }}" data-apos-forms-file-spinner hidden>Uploading...</span>
<span class="apos-forms-error apos-forms-label-message {{classPrefix + '__error' if classPrefix }} {{ classPrefix + '__label-message' if classPrefix }}" data-apos-forms-file-error role="alert" hidden>An error occurred uploading the file. It may be too large or of an inappropriate type.</span>
</label>
<input class="apos-forms-input {{ classPrefix + '__input' if classPrefix }}" type="file" id="{{ id }}" multiple
name="{{ widget.fieldName}}" {% if widget.required %}required{% endif %}>