2021-04-28 22:25:35 +01:00
|
|
|
{% set thumbnail_parameters = {'id': attachment.getId(), 'w': config('thumbnail','width'), 'h': config('thumbnail','height')} %}
|
|
|
|
{% if attachment.mimetype starts with 'image/' %}
|
|
|
|
<div>
|
2021-04-30 02:51:03 +01:00
|
|
|
<figure>
|
|
|
|
<img src="{{ path('attachment_thumbnail', thumbnail_parameters) }}" alt="{{ attachment.getTitle() }}">
|
|
|
|
<figcaption><a
|
|
|
|
href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a>
|
|
|
|
</figcaption>
|
|
|
|
</figure>
|
2021-04-28 22:25:35 +01:00
|
|
|
</div>
|
2021-04-30 02:51:03 +01:00
|
|
|
{% elseif attachment.mimetype starts with 'video/' %}
|
2021-04-28 22:25:35 +01:00
|
|
|
<div>
|
2021-04-30 02:51:03 +01:00
|
|
|
<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>
|
2021-04-28 22:25:35 +01:00
|
|
|
</div>
|
2021-04-30 02:51:03 +01:00
|
|
|
{% else %}
|
|
|
|
{% for show in handle_event('ShowAttachment', attachment) %}
|
|
|
|
<div>
|
|
|
|
{{ show | raw }}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div>
|
|
|
|
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2021-04-28 22:25:35 +01:00
|
|
|
{% endif %}
|