libreddit/templates/post.html

82 lines
2.6 KiB
HTML
Raw Normal View History

2020-11-23 01:29:05 +01:00
{% extends "base.html" %}
{% block title %}{{ post.title }} - r/{{ post.community }}{% endblock %}
{% block head %}
{% call super() %}
<meta name="author" content="u/{{ post.author }}">
{% endblock %}
2020-12-20 04:54:46 +01:00
{% macro comment(item) -%}
<div class="comment">
<div class="comment_left">
<h3 class="comment_score">{{ item.score }}</h3>
<div class="line"></div>
</div>
<details class="comment_right" open>
<summary class="comment_data">
2020-12-20 20:29:23 +01:00
<a class="comment_author" href="/u/{{ item.author }}">u/{{ item.author }}</a>
{% if item.flair.0 != "" %}
<small class="author_flair">{{ item.flair.0 }}</small>
{% endif %}
&bull; <span class="datetime">{{ item.time }}</span>
2020-12-20 04:54:46 +01:00
</summary>
<h4 class="comment_body">{{ item.body }}</h4>
{%- endmacro %}
2020-11-23 01:29:05 +01:00
{% block content %}
<div class="post highlighted">
<div class="post_left">
<h3 class="post_score">{{ post.score }}</h3>
</div>
<div class="post_right">
2020-12-06 05:54:43 +01:00
<h4>
2020-11-23 01:29:05 +01:00
<b><a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a></b>
&bull;
<a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
2020-12-20 20:29:23 +01:00
{% if post.author_flair.0 != "" %}
<small class="author_flair">{{ post.author_flair.0 }}</small>
{% endif %}
2020-12-06 05:54:43 +01:00
<span class="datetime">{{ post.time }}</span>
</h4>
2020-12-07 20:20:24 +01:00
<a href="{{ post.url }}" class="post_title">
2020-11-23 01:29:05 +01:00
{{ post.title }}
{% if post.flair.0 != "" %}
2020-12-20 20:29:23 +01:00
<small class="post_flair" style="color:{{ post.flair.2 }}; background:{{ post.flair.1 }}">{{ post.flair.0 }}</small>
2020-11-23 01:29:05 +01:00
{% endif %}
2020-12-07 20:20:24 +01:00
</a>
{% if post.post_type == "image" %}
<img class="post_media" src="{{ post.media }}"/>
{% else if post.post_type == "video" %}
<video class="post_media" src="{{ post.media }}" controls autoplay loop>
{% else if post.post_type == "link" %}
2020-12-12 05:36:25 +01:00
<a id="post_url" href="{{ post.media }}">{{ post.media }}</a>
{% endif %}
2020-11-23 01:29:05 +01:00
<h4 class="post_body">{{ post.body }}</h4>
</div>
</div>
<div id="sort">
<div id="sort_confidence"><a href="?sort=confidence">Best</a></div>
<div id="sort_top"><a href="?sort=top">Top</a></div>
<div id="sort_new"><a href="?sort=new">New</a></div>
<div id="sort_controversial"><a href="?sort=controversial">Controversial</a></div>
<div id="sort_old"><a href="?sort=old">Old</a></div>
</div>
2020-12-20 04:54:46 +01:00
{% for c in comments -%}
<div class="thread">
{% call comment(c) %}
<div class="replies">
{% for reply in c.replies %}
{% call comment(reply) %}
<div class="replies">
{% for response in reply.replies %}
{% call comment(response) %}</details></div>
{% endfor %}
</div></details></div>
{% endfor %}
</div></details></div>
2020-11-23 01:29:05 +01:00
</div>
2020-12-20 04:54:46 +01:00
{%- endfor %}
2020-11-23 01:29:05 +01:00
{% endblock %}