[TWIG] Improving view template structure

This commit is contained in:
rainydaysavings 2020-09-05 06:37:30 +01:00 committed by Hugo Sales
parent 3a4d3fc1e2
commit 8e17dd1829
1 changed files with 13 additions and 3 deletions

View File

@ -10,11 +10,21 @@
<div class="note-attachments">
{% for attachment in note.getAttachments() %}
{% if attachment.mimetype starts with 'image/' %}
<img src="{{ path('attachment_inline', {'id': attachment.getId()}) }}"> {{ attachment.getTitle() }} </img>
<div>
<img src="{{ path('attachment_inline', {'id': attachment.getId()}) }}" alt="{{ attachment.getTitle() }}">
<i> {{ attachment.getTitle() }} </i>
</img>
</div>
{% elseif attachment.mimetype starts with 'video/' %}
<video src="{{ path('attachment_inline', {'id': attachment.getId()}) }}"> {{ attachment.getTitle() }} </img>
<div>
<video src="{{ path('attachment_inline', {'id': attachment.getId()}) }}">
<i> {{ attachment.getTitle() }} </i>
</video>
</div>
{% else %}
<i> {{ attachment.getTitle() }} </i>
<div>
<i> {{ attachment.getTitle() }} </i>
</div>
{% endif %}
{% endfor %}
</div>