freak/freak/templates/singlepost.html

85 lines
2.7 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% from "macros/title.html" import title_tag with context %}
{% from "macros/feed.html" import single_comment, feed_upvote, comment_count with context %}
{% from "macros/create.html" import comment_area with context %}
{% from "macros/icon.html" import icon, callout with context %}
{% from "macros/nav.html" import nav_guild, nav_user with context %}
2025-06-14 15:32:30 +02:00
{% block title %}
{{ title_tag(p.title + '; from ' + p.topic_or_user().handle()) }}
<meta name="og:title" content="{{ p.title }}" />
{# meta name="og:description" coming in 0.4 #}
{% if p.author %}
<meta name="author" content="{{ p.author.display_name or p.author.username }}" />
{% endif %}
{% endblock %}
{% block nav %}
{% if p.guild %}
{{ nav_guild(p.guild) }}
{% elif p.author %}
{{ nav_user(p.author) }}
{% endif %}
{% endblock %}
{% block content %}
<article class="card">
<div class="post-frame" id="post-{{ p.id | to_b32l }}">
<div class="post-body">
<h1 class="message-title">{{ p.title }}</h1>
<div class="message-meta">
Posted by <a href="{{ p.author.url() }}">@{{ p.author.username }}</a>
{% if p.guild %}
on <a href="{{ p.guild.url() }}">+{{ p.guild.name }}</a>
{% else %}
on their user page
{% endif %}
- <time datetime="{{ p.created_at.isoformat('T') }}">{{ p.created_at.strftime('%B %-d, %Y at %H:%M') }}</time>
{% if p.privacy == 1 %}
- {{ icon('link_post') }} Unlisted
{% endif %}
</div>
{% if current_user.is_administrator and p.report_count() %}
{% call callout('spoiler', 'error') %}
<strong>{{ p.report_count() }}</strong> reports. <a href="{{ url_for('admin.reports') }}">Take action</a>
{% endcall %}
{% endif %}
{% if p.is_removed %}
{% call callout('delete', 'error') %}
This post has been removed
{% endcall %}
{% endif %}
<div class="message-content">
{{ p.text_content | to_markdown }}
</div>
</div>
<div class="message-stats">
2025-08-23 19:04:28 +02:00
{{ feed_upvote(p.id, p.upvotes(), p.upvoted_by(current_user.user)) }}
{{ comment_count(p.comment_count()) }}
</div>
2025-06-14 12:09:47 +02:00
<ul class="message-options inline">
2025-08-23 19:04:28 +02:00
{% if p.author_id == current_user.id %}
<li><a href="/edit/post/{{ p.id|to_b32l }}"><i class="icon icon-edit"></i> Edit</a></li>
2025-06-14 12:09:47 +02:00
{% else %}
<li><a href="{{ p.report_url() }}"><i class="icon icon-report"></i> Report</a></li>
{% endif %}
</ul>
</div>
{{ comment_area(p) }}
<div class="comment-section">
<ul>
{% for comment in comments %}
<li id="comment-{{ comment.id }}" data-endpoint="{{ comment.id|to_b32l }}">
{{ single_comment(comment) }}
{# if comment.children %}
{{ comment_tree(comment) }}
{% endif #}
</li>
{% endfor %}
</ul>
</div>
</article>
{% endblock %}