2024-09-06 15:43:22 +12:00
< div class = "col post_teaser_body" >
< h3 > {% if post.sticky -%}< span class = "fe fe-sticky-left" > < / span > {% endif -%}< a href = "{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None) }}" class = "post_teaser_title_a" > {{ post.title }}< / a >
{% if post.domain_id -%}
{% if post.url and 'youtube.com' in post.url -%}
< span class = "fe fe-video" aria-hidden = "true" > < / span >
{% elif post.url.endswith('.mp3') -%}
< span class = "fe fe-audio" aria-hidden = "true" > < / span >
{% endif -%}
< span class = "domain_link" aria-hidden = "true" > (< a href = "/d/{{ post.domain_id }}" aria-label = "{{ _('All posts about this domain') }}" > {{ post.domain.name }}< / a > )< / span >
{% endif -%}
{% if post.nsfw -%}< span class = "warning_badge nsfw" title = "{{ _('Not safe for work') }}" > nsfw< / span > {% endif -%}
{% if post.nsfl -%}< span class = "warning_badge nsfl" title = "{{ _('Potentially emotionally scarring content') }}" > nsfl< / span > {% endif -%}
{% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%}
< span class = "red fe fe-report" title = "{{ _('Reported. Check post for issues.') }}" > < / span >
{% endif -%}
{% if post.sticky -%}< span class = "fe fe-sticky-right" > < / span > {% endif -%}
< / h3 >
2024-10-01 21:48:27 +00:00
< span class = "author small" > {% if show_post_community -%}< a href = "/c/{{ post.community.link() }}" aria-label = "{{ _('Go to community %(name)s', name=post.community.name) }}" >
2024-10-04 18:58:41 +13:00
{% if post.community.icon_id and not low_bandwidth %}< img class = "community_icon_small rounded-circle" src = "{{ post.community.icon_image('tiny') }}" alt = "Community icon" / > {% endif -%}
2024-10-01 21:48:27 +00:00
c/{{ post.community.name }}< / a > {% endif -%}
by {{ render_username(post.author) }} < time datetime = "{{ post.last_active }}" > {{ post.posted_at_localized(sort, locale) }}< / time > < / span >
2024-09-08 12:31:16 +12:00
{% if not low_bandwidth %}
< div class = "post_teaser_video_preview" >
< div class = "max_width_512" >
2024-09-07 12:11:01 +12:00
{% if post.url.endswith('.mp4') or post.url.endswith('.webm') -%}
< p >
< video class = "responsive-video" controls preload = "{{ 'none' if low_bandwidth else 'auto' }}" { { ' autoplay muted ' if autoplay } } { { ' loop ' if post . community . loop_videos ( ) } } >
{% if post.url.endswith('.mp4') -%}
< source src = "{{ post.url }}" type = "video/mp4" / >
{% elif post.url.endswith('.webm') -%}
< source src = "{{ post.url }}" type = "video/webm" / >
{% endif -%}
< / video > < / p >
{% elif post.url.startswith('https://streamable.com') -%}
2024-09-22 22:05:21 +12:00
< div style = "padding-bottom: 56.25%; position: relative;" > < iframe loading = "lazy" style = "position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" src = "{{ post.url.replace('streamable.com/', 'streamable.com/e/') }}" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" width = "100%" height = "100%" frameborder = "0" > < / iframe > < / div >
2024-09-07 12:11:01 +12:00
{% elif post.url.startswith('https://www.redgifs.com/watch/') -%}
2024-09-22 22:05:21 +12:00
< div style = "padding-bottom: 56.25%; position: relative;" > < iframe loading = "lazy" style = "position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" src = "{{ post.url.replace('redgifs.com/watch/', 'redgifs.com/ifr/') }}" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" width = "100%" height = "100%" frameborder = "0" > < / iframe > < / div >
2024-09-07 12:11:01 +12:00
{% endif -%}
{% if 'youtube.com' in post.url -%}
2024-09-07 12:36:21 +12:00
< div class = "video-wrapper" data-src = "https://www.youtube.com/embed/{{ post.youtube_embed() }}" >
2024-09-08 12:31:16 +12:00
< a href = "{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, autoplay='true') }}" rel = "nofollow ugc" aria-label = "{{ _('Read article') }}" >
2024-09-08 13:23:37 +12:00
< img src = "https://img.youtube.com/vi/{{ post.youtube_embed(rel=False).replace('v=', '').replace('?', '') }}/hqdefault.jpg" alt = "Video Thumbnail" width = "512" height = "288" loading = "lazy" >
2024-09-08 12:31:16 +12:00
< / a >
2024-09-07 12:36:21 +12:00
< / div >
2024-09-07 12:11:01 +12:00
{% endif -%}
{% if 'videos/watch' in post.url -%}
2024-09-22 22:05:21 +12:00
< div style = "padding-bottom: 56.25%; position: relative;" > < iframe loading = "lazy" style = "position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" src = "{{ post.peertube_embed() }}" allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" width = "100%" height = "100%" frameborder = "0" > < / iframe > < / div >
2024-09-07 12:11:01 +12:00
{% endif -%}
2024-09-08 12:31:16 +12:00
< / div >
2024-09-06 15:43:22 +12:00
< / div >
2024-09-08 12:31:16 +12:00
{% endif -%}
2024-09-06 22:39:27 +12:00
{% include "post/post_teaser/_utilities_bar.html" %}
2024-10-01 21:48:27 +00:00
< / div >