modalité uploder des ficher avec VichUploaderBundle

This commit is contained in:
maher
2026-01-11 16:33:43 +01:00
parent 1d2b4fbb6b
commit 756cae51d2
16 changed files with 849 additions and 5 deletions

View File

@@ -168,10 +168,29 @@
</div>
{% endfor %}
</div>
<div class="card-body">
<div class="attachments-container" data-prototype="{{ form_widget(formQtn.attachments.vars.prototype)|e('html_attr') }}" data-index="{{ formQtn.attachments|length }}" >
{% for attachment in formQtn.attachments %}
<div class="attachment-item" id="attachment-{{ loop.index0 }}">
{{ form_row(attachment.file, { 'row_attr': {'class': 'mb-0'} }) }}
<button type="button" class="btn btn-outline-danger btn-sm remove-attachment mt-2">
<i class="fas fa-trash"></i> Supprimer
</button>
</div>
{% else %}
<p class="text-muted">Aucun fichier ajouté</p>
{% endfor %}
</div>
</div>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-primary add-modality">Ajouter une modalité</button>
<button type="button" class="btn btn-outline-primary add-attachment mt-3"><i class="fas fa-plus"></i> Ajouter un fichier</button>
</div>
</div>