{% trans_default_domain 'SmartFileUploadBundle' %} {% block smart_file_widget %} {% apply spaceless %}
{% if browse_label is not empty %} {{ block('browse_button') }} {% endif %} {{ form_widget(form.id) }}
{% if placeholder is not empty %} {{ block('image_placeholder') }} {% endif %} {% if display_preview %}
{% for file in files %} {% if file.id %} {{ block('file_preview') }} {% endif %} {% endfor %}
{% endif %}
{{ form_errors(form.file) }} {% if app.request.xmlHttpRequest == true %} {% else %} {{ append_js_code("$(function () {$('#" ~ id ~ "').smartFileUpload(" ~ js_options|raw ~ ");});") }} {% endif %} {% endapply %} {% endblock %} {% block browse_button %} {% apply spaceless %} {{ browse_label|trans({}, translation_domain) }} {{ form_widget(form.file) }} {% if format_restriction is not empty %} {% if size_restriction is not empty %} {{ size_restriction|trans({}, translation_domain)|raw }} {% endif %} {% elseif size_restriction is not empty %} {{ size_restriction|trans({}, translation_domain)|raw }} {% endif %} {% endapply %} {% endblock %} {% block image_placeholder %}
0 %} style="display:none;"{% endif %}>
{% if file_label %}
{{ file_label|trans({}, translation_domain)|raw }}
{% endif %}
{% endblock %} {% block file_preview %}
{% if file and file.mime_type %} {% if file.mime_type matches '{^image/}' and file.mime_type != 'image/x-icon' %} {% else %}
{% endif %} {% elseif placeholder is not empty %} {% endif %}
{% if display_preview_name %} {{ file ? file.name : null }} {% endif %} {% if file_label %}
{{ file_label|trans({}, translation_domain)|raw }}
{% endif %} {% if not disabled %} {% endif %}
{% if not file %}
{% endif %}
{% endblock %}