-
Guillaume Perréal authoredc4ca67f3
{% block file_upload_progress_prototype %}
<div class="template-upload">
<p>
<span class="progress-text pull-right" style="display: none"></span>
<button class="btn btn-xs btn-danger cancel" title="{% trans %}button.cancel{% endtrans %}">
{{ irstea_icon('remove') }}
</button> <span class="name"></span> (<span class="size"></span>)
<span class="error danger"></span>
</p>
<p class="progress" style="display: none">
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
</p>
</div>
{% endblock %}
{% block file_upload_widget %}
<div id="{{ id }}" {{ block('widget_container_attributes') }} {{ block('widget_only_attributes') -}}
data-download-prototype="{{ block('file_upload_entry_prototype')|e }}"
data-upload-prototype="{{ block('file_upload_progress_prototype')|e }}"
{% if disabled %}data-disabled="disabled"{% endif -%}
{% if read_only %}data-readonly="readonly"{% endif -%}
>
<div class="fileinput-entries">
{%- if value is not empty %}
{%- if multiple %}
{% for file in value %}
{{ block('file_upload_entry_prototype') }}
{% endfor %}
{%- else %}
{%- set file = value %}
{%- block file_upload_entry_prototype %}
{%- set file = file|default([]) %}
<p class="template-download">
<input type="hidden" name="{{ full_name }}{% if multiple %}[]{% endif %}" value="{{ file.id|default }}"/>
<button class="btn btn-xs btn-danger delete" title="{% trans %}button.delete{% endtrans %}" {%- if disabled or read_only %} disabled="disabled"{% endif -%}>
{{- irstea_icon('trash') -}}
</button> <span class="name">
<a{% if file %} href="{{ path('file_upload_get', {id: file.id, token: csrfToken}) }}"{% endif %}>{{ file.originalFilename|default }}</a>
</span> (<span class="size">
{{- file.size|default -}}
</span>)
<span class="error danger"></span>
</p>
{% endblock -%}
{% endif -%}
{% endif -%}
</div>
<span class="btn btn-primary fileinput-button">
<span>{{ irstea_icon('upload') }} {% trans %}button.upload{% endtrans %}</span>
<input type="file" name="_hack_{{ full_name }}"
{%- if multiple %} multiple="multiple"{% endif -%}
{%- if disabled or read_only %} disabled="disabled"{% endif -%}
/>
</span>
</div>
{% endblock file_upload_widget %}