treebird/templates/attachment.tt
nekobit 025036832a Attachments, Emoji reactions, reply id's
FossilOrigin-Name: 58d7a2add5fc05eac12f8bacd7071095d91d0c9d3f481454202898b1cf5c115a
2022-07-30 06:19:17 +00:00

30 lines
1.2 KiB
Text

<div class="attachment-container
[%- IF attachment.type == 1 -%] [%# Image attachment %]
attachment-img">
<img width="256" src="[% attachment.url %]" loading="lazy">
[%- ELSIF attachment.type == 2 -%] [%# Gifv attachment (mastodon) %]
attachment-gifv">
<video width="256" autoplay muted loop>
<source src="[% attachment.url %]">
[ GIFV ]
</video>
[%- ELSIF attachment.type == 3 -%] [%# video attachment %]
attachment-video">
<video width="256" controls preload="metadata">
<source src="[% attachment.url %]">
[ VIDEO ]
</video>
[%- ELSIF attachment.type == 4 -%] [%# Audio attachment %]
attachment-audio">
<audio width="256" controls preload="metadata">
<source src="[% attachment.url %]">
</audio>
[%- ELSE -%] [%# Unknown attachment - Link %]
attachment-link [% IF sensitive %]sensitive[% END %]">
<a href="[% attachment.url %]">Attachment</a>
[%- END -%]
[% IF sensitive && attachment.type != 0 %] [%# Link %]
<div class="sensitive-contain sensitive"></div>
[% END %]
</div>