2021-04-28 22:25:35 +01:00
|
|
|
{% set thumbnail_parameters = {'id': attachment.getId(), 'w': config('thumbnail','width'), 'h': config('thumbnail','height')} %}
|
2021-07-22 20:49:12 +01:00
|
|
|
{% if attachment.getIsLocal() %}
|
|
|
|
{% set handled = false %}
|
|
|
|
{% for block in handle_event('ViewAttachment' ~ attachment.getMimetypeMajor() | capitalize , {'attachment': attachment, 'thumbnail_parameters': thumbnail_parameters}) %}
|
|
|
|
{% set handled = true %}
|
|
|
|
{{ block | raw }}
|
|
|
|
{% endfor %}
|
|
|
|
{% if not handled %}
|
2021-04-30 02:51:03 +01:00
|
|
|
<div>
|
|
|
|
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
|
|
|
|
</div>
|
2021-07-22 20:49:12 +01:00
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% for block in handle_event('ViewRemoteAttachment', {'attachment': attachment, 'thumbnail_parameters': thumbnail_parameters}) %}
|
|
|
|
{{ block | raw }}
|
2021-04-30 02:51:03 +01:00
|
|
|
{% endfor %}
|
2021-04-28 22:25:35 +01:00
|
|
|
{% endif %}
|