[TWIG] Improving view template structure

This commit is contained in:
rainydaysavings 2020-09-05 06:37:30 +01:00 committed by Hugo Sales
parent 099c4220d2
commit a69c9a4f25
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
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>