2020-11-23 00:29:05 +00:00
|
|
|
{% extends "base.html" %}
|
2020-12-31 23:54:13 +00:00
|
|
|
{% import "utils.html" as utils %}
|
|
|
|
|
2020-11-23 00:29:05 +00:00
|
|
|
{% block title %}{{ post.title }} - r/{{ post.community }}{% endblock %}
|
2020-12-31 23:54:13 +00: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 00:29:05 +00:00
|
|
|
{% block head %}
|
|
|
|
{% call super() %}
|
|
|
|
<meta name="author" content="u/{{ post.author }}">
|
|
|
|
{% endblock %}
|
2020-12-20 03:54:46 +00:00
|
|
|
|
2021-01-04 03:44:44 +00:00
|
|
|
<!-- OPEN COMMENT MACRO -->
|
2020-12-20 03:54:46 +00:00
|
|
|
{% macro comment(item) -%}
|
2020-12-21 04:52:15 +00:00
|
|
|
<div id="{{ item.id }}" class="comment">
|
2020-12-20 03:54:46 +00:00
|
|
|
<div class="comment_left">
|
2020-12-29 02:42:46 +00:00
|
|
|
<p class="comment_score">{{ item.score }}</p>
|
2020-12-20 03:54:46 +00:00
|
|
|
<div class="line"></div>
|
|
|
|
</div>
|
|
|
|
<details class="comment_right" open>
|
2020-12-21 16:38:24 +00:00
|
|
|
<summary class="comment_data"><a class="comment_author {% if item.author == post.author %}op{% endif %}" href="/u/{{ item.author }}">u/{{ item.author }}</a>
|
2021-01-12 22:34:16 +00:00
|
|
|
{% if item.flair.flair_parts.len() > 0 %}
|
|
|
|
<small class="author_flair">{% call utils::render_flair(item.flair.flair_parts) %}</small>
|
|
|
|
{% endif %}
|
2021-01-05 03:26:41 +00:00
|
|
|
<span class="datetime">{{ item.time }}</span>
|
2020-12-20 03:54:46 +00:00
|
|
|
</summary>
|
2021-01-13 04:18:20 +00:00
|
|
|
<div class="comment_body">{{ item.body }}</div>
|
2020-12-20 03:54:46 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2021-01-04 03:44:44 +00:00
|
|
|
<!-- CLOSE COMMENT MACRO -->
|
|
|
|
{% macro close() %}
|
|
|
|
</details></div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2020-11-23 00:29:05 +00:00
|
|
|
{% block content %}
|
2020-12-24 06:16:04 +00:00
|
|
|
<div id="column_one">
|
2021-01-04 03:44:44 +00:00
|
|
|
|
|
|
|
<!-- POST CONTENT -->
|
2021-01-06 02:04:49 +00:00
|
|
|
<div class="post highlighted">
|
2020-12-24 06:16:04 +00:00
|
|
|
<div class="post_left">
|
2020-12-29 02:42:46 +00:00
|
|
|
<p class="post_score">{{ post.score }}</p>
|
2020-12-30 03:01:02 +00:00
|
|
|
{% if post.flags.nsfw %}<div class="nsfw">NSFW</div>{% endif %}
|
2020-12-24 06:16:04 +00:00
|
|
|
</div>
|
|
|
|
<div class="post_right">
|
2021-01-05 03:26:41 +00:00
|
|
|
<div class="post_text">
|
|
|
|
<p class="post_header">
|
|
|
|
<a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
|
|
|
<span class="dot">•</span>
|
|
|
|
<a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
|
2021-01-12 22:34:16 +00:00
|
|
|
{% if post.author_flair.flair_parts.len() > 0 %}
|
|
|
|
<small class="author_flair">{% call utils::render_flair(post.author_flair.flair_parts) %}</small>
|
|
|
|
{% endif %}
|
2021-01-05 05:17:19 +00:00
|
|
|
<span class="dot">•</span>
|
2021-01-05 03:26:41 +00:00
|
|
|
<span class="datetime">{{ post.time }}</span>
|
|
|
|
</p>
|
|
|
|
<a href="{{ post.permalink }}" class="post_title">
|
|
|
|
{{ post.title }}
|
2021-01-12 22:34:16 +00:00
|
|
|
{% if post.flair.flair_parts.len() > 0 %}
|
|
|
|
<small class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }}">{% call utils::render_flair(post.flair.flair_parts) %}</small>
|
|
|
|
{% endif %}
|
2021-01-05 03:26:41 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<!-- POST MEDIA -->
|
|
|
|
{% if post.post_type == "image" %}
|
|
|
|
<img class="post_media" src="{{ post.media }}"/>
|
2021-01-13 03:52:02 +00:00
|
|
|
{% else if post.post_type == "video" || post.post_type == "gif" %}
|
2021-01-09 05:57:36 +00:00
|
|
|
<video class="post_media" src="{{ post.media }}" controls autoplay loop></video>
|
2021-01-05 03:26:41 +00:00
|
|
|
{% else if post.post_type == "link" %}
|
|
|
|
<a id="post_url" href="{{ post.media }}">{{ post.media }}</a>
|
2020-12-24 06:16:04 +00:00
|
|
|
{% endif %}
|
2021-01-05 03:26:41 +00:00
|
|
|
|
|
|
|
<!-- POST BODY -->
|
|
|
|
<div class="post_body">{{ post.body }}</div>
|
|
|
|
<div id="post_footer">
|
|
|
|
<ul id="post_links">
|
|
|
|
<li><a href="/{{ post.id }}">permalink</a></li>
|
|
|
|
<li><a href="https://reddit.com/{{ post.id }}">reddit</a></li>
|
|
|
|
</ul>
|
|
|
|
<p>{{ post.upvote_ratio }}% Upvoted</p>
|
|
|
|
</div>
|
2021-01-09 05:57:36 +00:00
|
|
|
|
2021-01-03 21:06:49 +00:00
|
|
|
</div>
|
2020-12-24 06:16:04 +00:00
|
|
|
</div>
|
2020-11-23 00:29:05 +00:00
|
|
|
</div>
|
2021-01-04 03:44:44 +00:00
|
|
|
|
|
|
|
<!-- SORT FORM -->
|
2020-12-31 23:54:13 +00:00
|
|
|
<form id="sort">
|
|
|
|
<select name="sort">
|
2021-01-07 16:38:05 +00:00
|
|
|
{% call utils::options(sort, ["confidence", "top", "new", "controversial", "old"], "confidence") %}
|
2020-12-24 06:16:04 +00:00
|
|
|
</select><input id="sort_submit" type="submit" value="→">
|
|
|
|
</form>
|
2020-12-20 03:54:46 +00:00
|
|
|
|
2021-01-04 03:44:44 +00:00
|
|
|
<!-- COMMENTS -->
|
2020-12-24 06:16:04 +00:00
|
|
|
{% for c in comments -%}
|
2021-01-04 03:44:44 +00:00
|
|
|
<div class="thread">
|
|
|
|
<!-- EACH COMMENT -->
|
|
|
|
{% call comment(c) %}
|
|
|
|
<div class="replies">{% for reply1 in c.replies %}{% call comment(reply1) %}
|
|
|
|
<!-- FIRST-LEVEL REPLIES -->
|
|
|
|
<div class="replies">{% for reply2 in reply1.replies %}{% call comment(reply2) %}
|
|
|
|
<!-- SECOND-LEVEL REPLIES -->
|
|
|
|
<div class="replies">{% for reply3 in reply2.replies %}{% call comment(reply3) %}
|
|
|
|
<!-- THIRD-LEVEL REPLIES -->
|
|
|
|
{% if reply3.replies.len() > 0 %}
|
|
|
|
<!-- LINK TO CONTINUE REPLIES -->
|
|
|
|
<a class="deeper_replies" href="{{ post.permalink }}{{ reply3.id }}">→ More replies</a>
|
|
|
|
{% endif %}
|
|
|
|
{% call close() %}
|
2020-12-24 06:16:04 +00:00
|
|
|
{% endfor %}
|
2021-01-04 03:44:44 +00:00
|
|
|
</div>{% call close() %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>{% call close() %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>{% call close() %}
|
|
|
|
</div>
|
2020-12-24 06:16:04 +00:00
|
|
|
{%- endfor %}
|
2021-01-04 03:44:44 +00:00
|
|
|
|
2020-12-24 06:16:04 +00:00
|
|
|
</div>
|
2021-01-12 21:43:03 +00:00
|
|
|
{% endblock %}
|