[UI] Use thumbnail path for thumbs

This commit is contained in:
2021-04-19 12:20:10 +01:00
committed by Hugo Sales
parent e1995f44ce
commit 3afa872cec
4 changed files with 20 additions and 5 deletions

View File

@@ -23,16 +23,17 @@
</div>
<div class="note-attachments">
{% for attachment in note.getAttachments() %}
{% set thumbnail_parameters = {'id': attachment.getId(), 'w': config('thumbnail','width'), 'h': config('thumbnail','height')} %}
{% if attachment.mimetype starts with 'image/' %}
<div>
<figure>
<img src="{{ path('attachment_view', {'id': attachment.getId()}) }}" alt="{{ attachment.getTitle() }}">
<img src="{{ path('attachment_thumbnail', thumbnail_parameters) }}" alt="{{ attachment.getTitle() }}">
<figcaption> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </figcaption>
</figure>
</div>
{% elseif attachment.mimetype starts with 'video/' %}
<div>
<video src="{{ path('attachment_view', {'id': attachment.getId()}) }}">
<video src="{{ path('attachment_view', {'id': attachment.getId()}) }}" controls poster="{{ path('attachment_thumbnail') }}, thumbnail_parameters">
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
</video>
</div>