Files
notifications-admin/app/templates/components/file-upload.html
Chris Hill-Scott 97a3bf9225 Remove the ‘manage templates’ page
The ‘manage templates’ page was almost identical to the ‘send text messages’
page.

This commit consolidates them into one and makes them all hang together.

Part of this means tweaks to the javascript so that files upload as soon as
you’ve chosen them.
2016-02-22 13:39:02 +00:00

25 lines
780 B
HTML

{% macro file_upload(field, button_text="Choose file") %}
<div class="form-group{% if field.errors %} error{% endif %}" data-module="file-upload">
<label class="file-upload-label" for="{{ field.name }}">
<span class="visually-hidden">{{ field.label }}</span>
{% if hint %}
<span class="form-hint">
{{ hint }}
</span>
{% endif %}
{% if field.errors %}
<span class="error-message">
{{ field.errors[0] }}
</span>
{% endif %}
</label>
{{ field(**{
'class': 'file-upload-field'
}) }}
<label class="file-upload-button" for="{{ field.name }}">
{{ button_text }}
</label>
<label class="file-upload-filename" for="{{ field.name }}"></label>
</div>
{% endmacro %}