2024-01-11 20:39:22 +13:00
{% set content_blocked = post.blocked_by_content_filter(content_filters) %}
{% if content_blocked and content_blocked == '-1' %}
{# do nothing - blocked by keyword filter #}
{% else %}
2024-01-28 19:19:26 +13:00
< div class = "post_teaser type_{{ post.type }}{{ ' reported' if post.reports and current_user.is_authenticated and post.community.is_moderator() }}{{ ' blocked' if content_blocked }}"
2024-02-26 21:26:19 +13:00
{% if content_blocked %} title="{{ _('Filtered: ') }}{{ content_blocked }}"{% endif %} tabindex="0">
2024-01-11 20:39:22 +13:00
< div class = "row" >
< div class = "col-12" >
< div class = "row main_row" >
< div class = "col" >
2024-01-24 11:09:31 +13:00
< div class = "voting_buttons" aria-hidden = "true" >
{% include "post/_post_voting_buttons.html" %}
< / div >
{% if post.image_id %}
< div class = "thumbnail{{ ' lbw' if low_bandwidth }}" aria-hidden = "true" >
{% if low_bandwidth %}
{% if post.type == POST_TYPE_LINK %}
< a href = "{{ post.url }}" rel = "nofollow ugc" target = "_blank" aria-label = "{{ _('Read article') }}" > < span class = "fe fe-external" > < / span > < / a >
{% elif post.type == POST_TYPE_IMAGE %}
< a href = "{{ post.image.view_url() }}" rel = "nofollow ugc" aria-label = "{{ _('View image') }}" target = "_blank" > < span class = "fe fe-magnify" > < / span > < / a >
2024-01-11 20:39:22 +13:00
{% else %}
2024-01-24 11:09:31 +13:00
< a href = "{{ url_for('activitypub.post_ap', post_id=post.id) }}" aria-label = "{{ _('Read post') }}" > < span class = "fe fe-reply" > < / span > < / a >
{% endif %}
{% else %}
{% if post.type == POST_TYPE_LINK %}
< a href = "{{ post.url }}" rel = "nofollow ugc" target = "_blank" aria-label = "{{ _('Read article') }}" > < span class = "fe fe-external" > < / span > < img src = "{{ post.image.thumbnail_url() }}"
2024-02-26 21:45:47 +13:00
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" />< / a >
2024-01-24 11:09:31 +13:00
{% elif post.type == POST_TYPE_IMAGE %}
{% if post.image_id %}
< a href = "{{ post.image.view_url() }}" rel = "nofollow ugc" aria-label = "{{ _('View image') }}" target = "_blank" > < span class = "fe fe-magnify" > < / span > < img src = "{{ post.image.thumbnail_url() }}"
2024-02-26 21:45:47 +13:00
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" />< / a >
2024-01-24 09:23:44 +13:00
{% endif %}
2024-01-24 11:09:31 +13:00
{% else %}
< a href = "{{ url_for('activitypub.post_ap', post_id=post.id) }}" aria-label = "{{ _('Read post') }}" > < span class = "fe fe-reply" > < / span > < img src = "{{ post.image.thumbnail_url() }}"
2024-02-26 21:45:47 +13:00
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" />< / a >
2024-01-11 20:39:22 +13:00
{% endif %}
2024-01-06 17:21:39 +13:00
{% endif %}
2024-01-24 11:09:31 +13:00
< / div >
{% endif %}
< h3 > < 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.type == POST_TYPE_IMAGE %}< span class = "fe fe-image" aria-hidden = "true" > < / span > {% endif %}
{% if post.type == POST_TYPE_LINK and post.domain_id %}
{% if post.url and 'youtube.com' in post.url %}
< span class = "fe fe-video" aria-hidden = "true" > < / span >
2024-02-25 15:55:27 +13:00
{% elif post.url.endswith('.mp3') %}
< span class = "fe fe-audio" aria-hidden = "true" > < / span >
2024-01-11 20:39:22 +13:00
{% endif %}
2024-01-24 11:09:31 +13:00
< 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 %}
2024-02-16 06:17:13 +13:00
{% 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 %}
2024-01-24 11:09:31 +13:00
{% if post.reports 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 %}
2024-01-11 20:39:22 +13:00
< / h3 >
2024-01-24 11:09:31 +13:00
2024-01-23 19:17:05 +13:00
< span class = "small" > {% if show_post_community %}< strong > < a href = "/c/{{ post.community.link() }}" aria-label = "{{ _('Go to community') }}" > c/{{ post.community.name }}< / a > < / strong > {% endif %}
2024-01-15 18:48:41 +13:00
by {{ render_username(post.author) }} {{ moment(post.last_active if sort == 'active' else post.posted_at).fromNow() }}< / span >
2023-12-22 14:05:39 +13:00
2024-01-11 20:39:22 +13:00
< / div >
2023-11-29 20:32:07 +13:00
2024-01-11 20:39:22 +13:00
< / div >
< div class = "row utilities_row" >
< div class = "col-6" >
2024-02-26 21:26:19 +13:00
< a href = "{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, _anchor='post_replies') }}" aria-label = "{{ _('View comments') }}" > < span class = "fe fe-reply" > < / span > < span aria-label = "{{ _('Number of comments:') }}" > {{ post.reply_count }}< / span > < / a >
2024-01-11 20:39:22 +13:00
{% if post.type == POST_TYPE_IMAGE %}
{% if post.image_id %}
2024-01-24 09:52:08 +13:00
< a href = "{{ post.image.view_url() }}" rel = "nofollow ugc" class = "preview_image" aria-label = "{{ _('View image') }}" aria-hidden = "true" > < span class = "fe fe-magnify" > < / span > < / a >
2024-01-11 20:39:22 +13:00
{% else %}
2024-01-24 09:52:08 +13:00
< a href = "{{ post.url }}" rel = "nofollow ugc" class = "preview_image" target = "_blank" aria-label = "{{ _('View image') }}" aria-hidden = "true" > < span class = "fe fe-magnify" > < / span > < / a >
2024-01-11 20:39:22 +13:00
{% endif %}
{% endif %}
< / div >
2024-01-31 21:02:22 +13:00
< div class = "col-2" > < a href = "{{ url_for('post.post_options', post_id=post.id) }}" rel = "nofollow" class = "post_options" aria-label = "{{ _('Options') }}" > < span class = "fe fe-options" title = "Options" > < / span > < / a > < / div >
2024-01-11 20:39:22 +13:00
< / div >
2023-10-23 17:22:21 +13:00
< / div >
< / div >
2024-01-11 20:39:22 +13:00
< / div >
{% endif %}