2020-11-23 13:29:05 +13:00
|
|
|
{% extends "base.html" %}
|
2021-01-01 12:54:13 +13:00
|
|
|
{% import "utils.html" as utils %}
|
|
|
|
|
2020-11-23 13:29:05 +13:00
|
|
|
{% block title %}{{ post.title }} - r/{{ post.community }}{% endblock %}
|
2021-01-01 12:54:13 +13:00
|
|
|
|
|
|
|
{% block search %}
|
|
|
|
{% call utils::search(["/r/", post.community.as_str()].concat(), "") %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block root %}/r/{{ post.community }}{% endblock %}{% block location %}r/{{ post.community }}{% endblock %}
|
2020-11-23 13:29:05 +13:00
|
|
|
{% block head %}
|
|
|
|
{% call super() %}
|
2021-02-17 08:16:32 +13:00
|
|
|
<!-- Meta Tags -->
|
2021-01-17 12:02:24 +13:00
|
|
|
<meta name="author" content="u/{{ post.author.name }}">
|
2021-02-17 08:16:32 +13:00
|
|
|
<meta name="title" content="{{ post.title }} - r/{{ post.community }}">
|
|
|
|
<meta property="og:type" content="website">
|
|
|
|
<meta property="og:url" content="{{ post.permalink }}">
|
|
|
|
<meta property="og:title" content="{{ post.title }} - r/{{ post.community }}">
|
|
|
|
<meta property="og:description" content="View on Libreddit, an alternative private front-end to Reddit.">
|
|
|
|
<meta property="og:image" content="{{ post.thumbnail.url }}">
|
|
|
|
<meta property="twitter:card" content="summary_large_image">
|
|
|
|
<meta property="twitter:url" content="{{ post.permalink }}">
|
|
|
|
<meta property="twitter:title" content="{{ post.title }} - r/{{ post.community }}">
|
|
|
|
<meta property="twitter:description" content="View on Libreddit, an alternative private front-end to Reddit.">
|
|
|
|
<meta property="twitter:image" content="{{ post.thumbnail.url }}">
|
2020-11-23 13:29:05 +13:00
|
|
|
{% endblock %}
|
2020-12-20 16:54:46 +13:00
|
|
|
|
2021-01-30 21:47:30 +13:00
|
|
|
{% block subscriptions %}
|
2021-01-31 11:52:18 +13:00
|
|
|
{% call utils::sub_list(post.community.as_str()) %}
|
2021-01-30 18:00:55 +13:00
|
|
|
{% endblock %}
|
|
|
|
|
2020-11-23 13:29:05 +13:00
|
|
|
{% block content %}
|
2020-12-24 19:16:04 +13:00
|
|
|
<div id="column_one">
|
2021-01-04 16:44:44 +13:00
|
|
|
|
|
|
|
<!-- POST CONTENT -->
|
2021-01-06 15:04:49 +13:00
|
|
|
<div class="post highlighted">
|
2021-01-18 08:39:57 +13:00
|
|
|
<p class="post_header">
|
|
|
|
<a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
|
|
|
<span class="dot">•</span>
|
2022-01-09 15:50:53 +13:00
|
|
|
<a class="post_author {{ post.author.distinguished }}" href="/user/{{ post.author.name }}">u/{{ post.author.name }}</a>
|
2021-01-18 08:39:57 +13:00
|
|
|
{% if post.author.flair.flair_parts.len() > 0 %}
|
|
|
|
<small class="author_flair">{% call utils::render_flair(post.author.flair.flair_parts) %}</small>
|
|
|
|
{% endif %}
|
|
|
|
<span class="dot">•</span>
|
|
|
|
<span class="created" title="{{ post.created }}">{{ post.rel_time }}</span>
|
2021-11-25 15:08:27 +13:00
|
|
|
{% if !post.awards.is_empty() %}
|
|
|
|
<span class="dot">•</span>
|
|
|
|
<span class="awards">
|
|
|
|
{% for award in post.awards.clone() %}
|
|
|
|
<span class="award" title="{{ award.name }}">
|
|
|
|
<img alt="{{ award.name }}" src="{{ award.icon_url }}" width="16" height="16"/>
|
|
|
|
{{ award.count }}
|
|
|
|
</span>
|
|
|
|
{% endfor %}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2021-01-18 08:39:57 +13:00
|
|
|
</p>
|
|
|
|
<p class="post_title">
|
2021-12-28 20:16:01 +13:00
|
|
|
{{ post.title }}
|
2021-01-18 08:39:57 +13:00
|
|
|
{% if post.flair.flair_parts.len() > 0 %}
|
2021-03-18 13:28:05 +13:00
|
|
|
<a href="/r/{{ post.community }}/search?q=flair_name%3A%22{{ post.flair.text }}%22&restrict_sr=on"
|
2021-02-22 17:28:04 +13:00
|
|
|
class="post_flair"
|
|
|
|
style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }};">{% call utils::render_flair(post.flair.flair_parts) %}</a>
|
2021-01-18 08:39:57 +13:00
|
|
|
{% endif %}
|
|
|
|
{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %}
|
|
|
|
</p>
|
2021-01-05 16:26:41 +13:00
|
|
|
|
2021-01-18 08:39:57 +13:00
|
|
|
<!-- POST MEDIA -->
|
2021-11-15 15:39:33 +13:00
|
|
|
<!-- post_type: {{ post.post_type }} -->
|
2021-01-18 08:39:57 +13:00
|
|
|
{% if post.post_type == "image" %}
|
2021-02-04 08:11:04 +13:00
|
|
|
<a href="{{ post.media.url }}" class="post_media_image" >
|
|
|
|
<svg
|
2021-01-22 10:04:06 +13:00
|
|
|
width="{{ post.media.width }}px"
|
|
|
|
height="{{ post.media.height }}px"
|
|
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
|
|
<image width="100%" height="100%" href="{{ post.media.url }}"/>
|
|
|
|
<desc>
|
2021-09-07 07:02:52 +12:00
|
|
|
<img loading="lazy" alt="Post image" src="{{ post.media.url }}"/>
|
2021-02-02 08:25:57 +13:00
|
|
|
</desc>
|
2021-01-22 10:04:06 +13:00
|
|
|
</svg>
|
|
|
|
</a>
|
2021-01-18 08:39:57 +13:00
|
|
|
{% else if post.post_type == "video" || post.post_type == "gif" %}
|
2021-05-10 13:25:52 +12:00
|
|
|
{% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
|
|
|
|
<script src="/hls.min.js"></script>
|
2021-11-23 15:07:00 +13:00
|
|
|
<video class="post_media_video short {% if prefs.autoplay_videos == "on" %}hls_autoplay{% endif %}" width="{{ post.media.width }}" height="{{ post.media.height }}" poster="{{ post.media.poster }}" preload="none" controls>
|
2021-05-10 13:25:52 +12:00
|
|
|
<source src="{{ post.media.alt_url }}" type="application/vnd.apple.mpegurl" />
|
|
|
|
<source src="{{ post.media.url }}" type="video/mp4" />
|
|
|
|
</video>
|
|
|
|
<script src="/playHLSVideo.js"></script>
|
|
|
|
{% else %}
|
2021-10-26 17:27:55 +13:00
|
|
|
<video class="post_media_video" src="{{ post.media.url }}" controls {% if prefs.autoplay_videos == "on" %}autoplay{% endif %} loop><a href={{ post.media.url }}>Video</a></video>
|
2021-05-10 13:25:52 +12:00
|
|
|
{% call utils::render_hls_notification(post.permalink[1..]) %}
|
|
|
|
{% endif %}
|
2021-02-07 09:05:11 +13:00
|
|
|
{% else if post.post_type == "gallery" %}
|
|
|
|
<div class="gallery">
|
|
|
|
{% for image in post.gallery -%}
|
|
|
|
<figure>
|
2021-09-07 07:02:52 +12:00
|
|
|
<a href="{{ image.url }}" ><img loading="lazy" alt="Gallery image" src="{{ image.url }}"/></a>
|
2021-02-07 09:05:11 +13:00
|
|
|
<figcaption>
|
|
|
|
<p>{{ image.caption }}</p>
|
|
|
|
{% if image.outbound_url.len() > 0 %}
|
2021-05-11 05:31:19 +12:00
|
|
|
<p><a class="outbound_url" href="{{ image.outbound_url }}" rel="nofollow">{{ image.outbound_url }}</a>
|
2021-02-07 09:05:11 +13:00
|
|
|
{% endif %}
|
|
|
|
</figcaption>
|
|
|
|
</figure>
|
|
|
|
{%- endfor %}
|
|
|
|
</div>
|
2021-01-18 08:39:57 +13:00
|
|
|
{% else if post.post_type == "link" %}
|
2021-05-11 05:31:19 +12:00
|
|
|
<a id="post_url" href="{{ post.media.url }}" rel="nofollow">{{ post.media.url }}</a>
|
2021-01-18 08:39:57 +13:00
|
|
|
{% endif %}
|
2021-01-09 18:57:36 +13:00
|
|
|
|
2021-01-18 08:39:57 +13:00
|
|
|
<!-- POST BODY -->
|
|
|
|
<div class="post_body">{{ post.body }}</div>
|
2021-03-21 11:42:47 +13:00
|
|
|
<div class="post_score" title="{{ post.score.1 }}">{{ post.score.0 }}<span class="label"> Upvotes</span></div>
|
2021-01-18 08:39:57 +13:00
|
|
|
<div class="post_footer">
|
|
|
|
<ul id="post_links">
|
|
|
|
<li><a href="/{{ post.id }}">permalink</a></li>
|
2021-05-11 05:31:19 +12:00
|
|
|
<li><a href="https://reddit.com/{{ post.id }}" rel="nofollow">reddit</a></li>
|
2021-01-18 08:39:57 +13:00
|
|
|
</ul>
|
|
|
|
<p>{{ post.upvote_ratio }}% Upvoted</p>
|
2020-12-24 19:16:04 +13:00
|
|
|
</div>
|
2020-11-23 13:29:05 +13:00
|
|
|
</div>
|
2021-01-04 16:44:44 +13:00
|
|
|
|
|
|
|
<!-- SORT FORM -->
|
2021-01-01 12:54:13 +13:00
|
|
|
<form id="sort">
|
2021-01-18 11:49:36 +13:00
|
|
|
<select name="sort" title="Sort comments by">
|
2021-01-08 05:38:05 +13:00
|
|
|
{% call utils::options(sort, ["confidence", "top", "new", "controversial", "old"], "confidence") %}
|
2021-01-18 12:51:03 +13:00
|
|
|
</select><button id="sort_submit" class="submit">
|
|
|
|
<svg width="15" viewBox="0 0 110 100" fill="none" stroke-width="10" stroke-linecap="round">
|
|
|
|
<path d="M20 50 H100" />
|
|
|
|
<path d="M75 15 L100 50 L75 85" />
|
|
|
|
→
|
|
|
|
</svg>
|
|
|
|
</button>
|
2020-12-24 19:16:04 +13:00
|
|
|
</form>
|
2020-12-20 16:54:46 +13:00
|
|
|
|
2021-01-04 16:44:44 +13:00
|
|
|
<!-- COMMENTS -->
|
2020-12-24 19:16:04 +13:00
|
|
|
{% for c in comments -%}
|
2021-01-04 16:44:44 +13:00
|
|
|
<div class="thread">
|
2021-02-13 06:16:59 +13:00
|
|
|
{% if single_thread %}
|
|
|
|
<p class="thread_nav"><a href="/{{ post.id }}">View all comments</a></p>
|
|
|
|
{% if c.parent_kind == "t1" %}
|
|
|
|
<p class="thread_nav"><a href="?context=9999">Show parent comments</a></p>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
2021-02-11 07:48:51 +13:00
|
|
|
{{ c.render().unwrap() }}
|
2021-01-04 16:44:44 +13:00
|
|
|
</div>
|
2020-12-24 19:16:04 +13:00
|
|
|
{%- endfor %}
|
2021-01-04 16:44:44 +13:00
|
|
|
|
2020-12-24 19:16:04 +13:00
|
|
|
</div>
|
2021-01-13 10:43:03 +13:00
|
|
|
{% endblock %}
|