Ajout ChantDoc.lien (alternative à fichier)

This commit is contained in:
Claude Paroz 2025-10-30 11:53:17 +01:00
parent 75f024feaf
commit bbea558cc2
7 changed files with 60 additions and 4 deletions

View file

@ -11,7 +11,13 @@
{% for subform in form.formset %}
<div class="card text-bg-secondary mt-2">
<div class="card-body">
{{ subform }}
{% if subform.fichier %}{{ subform.fichier.as_field_group }}
{% elif subform.instance.fichier %}
<div>Fichier: <a href="{{ subform.instance.fichier.url }}">{{ subform.instance.fichier }}</a></div>
{% endif %}
{{ subform.lien.as_field_group }}
{{ subform.titre.as_field_group }}
{{ subform.DELETE.as_field_group }}
</div>
</div>
{% endfor %}

View file

@ -11,9 +11,16 @@
<td>{{ chant.numero }}</td>
<td>{{ chant.titre }}</td>
<td>{% for doc in chant.chantdoc_set.all %}
{% if doc.fichier %}
<a href="{{ doc.fichier.url }}">
<img src="{{ doc.fichier.path|icon_url }}" title="{{ doc.titre }}" data-bs-toggle="tooltip">
</a>{% endfor %}
<img src="{{ doc.fichier.path|icon_url }}" title="{{ doc.titre }}" class="icon" data-bs-toggle="tooltip">
</a>
{% else %}
<a href="{{ doc.lien }}">
<img src="{% static 'img/web-icon.svg' %}" title="{{ doc.titre }}" class="icon" data-bs-toggle="tooltip">
</a>
{% endif %}
{% endfor %}
</td>
<td>{{ chant.particularite }}</td>
{% if perms.beesgospel.change_chant %}