gnu-social/templates/attachments/view.html.twig
Diogo Peralta Cordeiro 41dcef3c7b
[Media] EncoderPlugins should handle the views that concern them
Ensure the intended filetypes and mimetypes during Vips conversions (part 2)
Sanitize Attachments instead of Validate (part 2)
Various bug fixes
2021-09-14 13:13:04 +01:00

18 lines
833 B
Twig

{% set thumbnail_parameters = {'id': attachment.getId(), 'w': config('thumbnail','width'), 'h': config('thumbnail','height')} %}
{% 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 %}
<div>
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
</div>
{% endif %}
{% else %}
{% for block in handle_event('ViewRemoteAttachment', {'attachment': attachment, 'thumbnail_parameters': thumbnail_parameters}) %}
{{ block | raw }}
{% endfor %}
{% endif %}