2023-12-13 21:04:11 +13:00
|
|
|
<div class="row position-relative">
|
2023-11-27 22:05:35 +13:00
|
|
|
{% if post.type == POST_TYPE_IMAGE %}
|
2024-01-03 16:29:58 +13:00
|
|
|
<div class="col post_col post_type_image">
|
2023-10-16 21:38:36 +13:00
|
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
|
|
<ol class="breadcrumb">
|
2024-03-09 14:59:05 +13:00
|
|
|
{% for breadcrumb in breadcrumbs %}
|
|
|
|
<li class="breadcrumb-item">{% if breadcrumb.url %}<a href="{{ breadcrumb.url }}">{% endif %}{{ breadcrumb.text }}{% if breadcrumb.url %}</a>{% endif %}</li>
|
|
|
|
{% endfor %}
|
2024-02-14 09:50:13 +13:00
|
|
|
<li class="breadcrumb-item"><a href="/c/{{ post.community.link() }}" title="{{ post.community.ap_domain }}">{{ post.community.title }}@{{ post.community.ap_domain }}</a></li>
|
2023-10-16 21:38:36 +13:00
|
|
|
<li class="breadcrumb-item active">{{ post.title|shorten(15) }}</li>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
2024-02-26 21:26:19 +13:00
|
|
|
<div class="voting_buttons" aria-live="assertive">
|
2023-11-30 06:36:08 +13:00
|
|
|
{% include "post/_post_voting_buttons.html" %}
|
2023-10-23 17:22:21 +13:00
|
|
|
</div>
|
2024-01-10 09:34:58 +13:00
|
|
|
<h1 class="mt-2 post_title">{{ post.title }}
|
|
|
|
{% if current_user.is_authenticated and post.user_id == current_user.id %}
|
|
|
|
{% include 'post/_post_notification_toggle.html' %}
|
|
|
|
{% 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-10 09:34:58 +13:00
|
|
|
</h1>
|
2024-04-02 04:37:48 +01:00
|
|
|
{% if post.cross_posts %}
|
|
|
|
<a href="{{ url_for('post.post_cross_posts', post_id=post.id) }}" aria-label="{{ _('Show cross-posts') }}"><span class="fe fe-layers"></span></a>
|
|
|
|
<span aria-label="{{ _('Number of cross-posts:') }}">{{ len(post.cross_posts) }}</span>
|
|
|
|
{% endif %}
|
2023-10-16 21:38:36 +13:00
|
|
|
{% if post.url %}
|
2024-02-29 22:45:17 +13:00
|
|
|
<p><a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="Go to image">{{ post.url|shorten_url }}
|
2024-01-24 09:52:08 +13:00
|
|
|
<span class="fe fe-external"></span></a></p>
|
2023-10-16 21:38:36 +13:00
|
|
|
{% endif %}
|
2024-01-02 16:07:41 +13:00
|
|
|
<p>{% 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 %}<small>submitted {{ moment(post.posted_at).fromNow() }} by {{ render_username(post.author) }}
|
2023-11-21 23:05:07 +13:00
|
|
|
{% if post.edited_at %} edited {{ moment(post.edited_at).fromNow() }}{% endif %}
|
|
|
|
</small></p>
|
2023-11-27 22:05:35 +13:00
|
|
|
<div class="post_image">
|
2024-01-05 11:10:10 +13:00
|
|
|
{% if post.image_id %}
|
2024-01-08 19:41:32 +13:00
|
|
|
{% if low_bandwidth %}
|
2024-03-16 00:16:47 +00:00
|
|
|
<a href="{{ post.image.view_url() }}" rel="nofollow ugc"><img src="{{ post.image.medium_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"
|
2024-01-08 19:41:32 +13:00
|
|
|
width="{{ post.image.width }}" height="{{ post.image.height }}" /></a>
|
2024-03-17 03:22:05 +13:00
|
|
|
{% else %}
|
|
|
|
<a href="{{ post.image.view_url() }}" rel="nofollow ugc"><img src="{{ post.image.view_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"></a>
|
2024-01-08 19:41:32 +13:00
|
|
|
{% endif %}
|
2024-01-05 11:10:10 +13:00
|
|
|
{% else %}
|
2024-02-29 22:45:17 +13:00
|
|
|
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="Go to image"><img src="{{ post.url }}" style="max-width: 100%; height: auto;" /></a>
|
2024-01-05 11:10:10 +13:00
|
|
|
{% endif %}
|
2023-11-27 22:05:35 +13:00
|
|
|
</div>
|
2024-01-07 18:30:27 +13:00
|
|
|
<div class="post_body mt-2">
|
2024-03-28 03:40:42 +00:00
|
|
|
{{ post.body_html|community_links|safe if post.body_html else '' }}
|
2024-01-07 18:30:27 +13:00
|
|
|
</div>
|
2023-10-16 21:38:36 +13:00
|
|
|
</div>
|
|
|
|
{% else %}
|
2024-01-03 16:29:58 +13:00
|
|
|
<div class="col post_col post_type_normal">
|
2023-10-23 17:22:21 +13:00
|
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
|
|
<ol class="breadcrumb">
|
2024-03-09 14:59:05 +13:00
|
|
|
{% for breadcrumb in breadcrumbs %}
|
|
|
|
<li class="breadcrumb-item">{% if breadcrumb.url %}<a href="{{ breadcrumb.url }}">{% endif %}{{ breadcrumb.text }}{% if breadcrumb.url %}</a>{% endif %}</li>
|
|
|
|
{% endfor %}
|
2024-02-14 09:50:13 +13:00
|
|
|
<li class="breadcrumb-item"><a href="/c/{{ post.community.link() }}">{{ post.community.title }}@{{ post.community.ap_domain }}</a></li>
|
2023-10-23 17:22:21 +13:00
|
|
|
<li class="breadcrumb-item active">{{ post.title|shorten(15) }}</li>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
2024-02-26 21:26:19 +13:00
|
|
|
<div class="voting_buttons" aria-live="assertive">
|
2023-11-30 06:36:08 +13:00
|
|
|
{% include "post/_post_voting_buttons.html" %}
|
2023-10-23 17:22:21 +13:00
|
|
|
</div>
|
2024-01-10 09:34:58 +13:00
|
|
|
<h1 class="mt-2 post_title">{{ post.title }}
|
|
|
|
{% if current_user.is_authenticated and post.user_id == current_user.id %}
|
|
|
|
{% include 'post/_post_notification_toggle.html' %}
|
|
|
|
{% 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-10 09:34:58 +13:00
|
|
|
</h1>
|
2024-04-02 04:37:48 +01:00
|
|
|
{% if post.cross_posts %}
|
|
|
|
<a href="{{ url_for('post.post_cross_posts', post_id=post.id) }}" aria-label="{{ _('Show cross-posts') }}"><span class="fe fe-layers"></span></a>
|
|
|
|
<span aria-label="{{ _('Number of cross-posts:') }}">{{ len(post.cross_posts) }}</span>
|
|
|
|
{% endif %}
|
2023-11-29 20:32:07 +13:00
|
|
|
{% if post.type == POST_TYPE_LINK and post.image_id and not (post.url and 'youtube.com' in post.url) %}
|
|
|
|
<div class="url_thumbnail">
|
2024-02-29 22:45:17 +13:00
|
|
|
<a href="{{ post.url }}" target="_blank" rel="nofollow ugc" class="post_link"><img src="{{ post.image.thumbnail_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else '' }}"
|
2024-02-10 06:41:24 +13:00
|
|
|
width="{{ post.image.thumbnail_width }}" height="{{ post.image.thumbnail_height }}" loading="lazy" /></a>
|
2023-11-29 20:32:07 +13:00
|
|
|
</div>
|
2023-10-16 21:38:36 +13:00
|
|
|
{% endif %}
|
2024-01-02 16:07:41 +13:00
|
|
|
<p>{% 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 %}<small>submitted {{ moment(post.posted_at).fromNow() }} by
|
2023-10-23 17:22:21 +13:00
|
|
|
{{ render_username(post.author) }}
|
2024-01-02 16:07:41 +13:00
|
|
|
{% if post.edited_at %} edited {{ moment(post.edited_at).fromNow() }}{% endif %}</small>
|
2023-10-23 17:22:21 +13:00
|
|
|
</p>
|
2023-11-29 20:32:07 +13:00
|
|
|
{% if post.type == POST_TYPE_LINK %}
|
2024-02-29 22:45:17 +13:00
|
|
|
<p><a href="{{ post.url }}" rel="nofollow ugc" target="_blank" class="post_link" aria-label="Go to post url">{{ post.url|shorten_url }}
|
2024-01-24 09:52:08 +13:00
|
|
|
<span class="fe fe-external"></span></a></p>
|
2024-02-25 15:55:27 +13:00
|
|
|
{% if post.url.endswith('.mp3') %}
|
|
|
|
<p><audio controls preload="{{ 'none' if low_bandwidth else 'metadata' }}" src="{{ post.url }}"></audio></p>
|
|
|
|
{% endif %}
|
2023-11-29 20:32:07 +13:00
|
|
|
{% if 'youtube.com' in post.url %}
|
|
|
|
<div style="padding-bottom: 56.25%; position: relative;"><iframe style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" src="https://www.youtube.com/embed/{{ post.youtube_embed() }}?rel=0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" width="100%" height="100%" frameborder="0"></iframe></div>
|
|
|
|
{% endif %}
|
|
|
|
{% elif post.type == POST_TYPE_IMAGE %}
|
2023-11-27 22:05:35 +13:00
|
|
|
<div class="post_image">
|
2024-01-28 18:33:47 +13:00
|
|
|
<a href="{{ post.image.view_url() }}" target="_blank" class="post_link" rel="nofollow ugc"><img src="{{ post.image.view_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"
|
2024-02-10 06:41:24 +13:00
|
|
|
width="{{ post.image.width }}" height="{{ post.image.height }}" loading="lazy" /></a>
|
2023-11-27 22:05:35 +13:00
|
|
|
</div>
|
2023-11-29 20:32:07 +13:00
|
|
|
{% else %}
|
|
|
|
{% if post.image_id and not (post.url and 'youtube.com' in post.url) %}
|
2024-02-29 22:45:17 +13:00
|
|
|
<a href="{{ post.image.view_url() }}" target="_blank" class="post_link" aria-label="Go to video" rel="nofollow ugc"><img src="{{ post.image.thumbnail_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"
|
2024-02-10 06:41:24 +13:00
|
|
|
width="{{ post.image.thumbnail_width }}" height="{{ post.image.thumbnail_height }}" loading="lazy" /></a>
|
2023-11-29 20:32:07 +13:00
|
|
|
{% endif %}
|
2023-11-27 22:05:35 +13:00
|
|
|
{% endif %}
|
2024-01-03 16:29:58 +13:00
|
|
|
<div class="post_body">
|
2024-03-28 03:40:42 +00:00
|
|
|
{{ post.body_html|community_links|safe if post.body_html else '' }}
|
2024-01-03 16:29:58 +13:00
|
|
|
</div>
|
2023-10-23 17:22:21 +13:00
|
|
|
</div>
|
2023-10-16 21:38:36 +13:00
|
|
|
{% endif %}
|
2024-03-29 11:00:28 +00:00
|
|
|
<div class="post_utilities_bar">
|
|
|
|
<a href="{{ url_for('post.post_options', post_id=post.id) }}" class="post_options_link" rel="nofollow"><span class="fe fe-options" title="Options"> </span></a>
|
|
|
|
</div>
|
2023-10-16 21:38:36 +13:00
|
|
|
</div>
|