2023-10-02 22:16:44 +13:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% from 'bootstrap/form.html' import render_form %}
|
|
|
|
|
|
|
|
{% block app_content %}
|
|
|
|
<div class="row">
|
2023-10-15 19:36:14 +13:00
|
|
|
<div class="col-12 col-md-8 position-relative">
|
2023-10-16 21:38:36 +13:00
|
|
|
{% include 'community/_post_full.html' %}
|
2023-10-02 22:16:44 +13:00
|
|
|
|
|
|
|
{% if post.comments_enabled %}
|
|
|
|
<div class="row post_reply_form">
|
|
|
|
<div class="col">
|
2023-10-15 19:36:14 +13:00
|
|
|
<div class="reply_form_inner">
|
|
|
|
{{ render_form(form) }}
|
|
|
|
</div>
|
2023-10-02 22:16:44 +13:00
|
|
|
</div>
|
|
|
|
<hr class="mt-4" />
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<p>{{ _('Comments are disabled for this post.') }}</p>
|
|
|
|
{% endif %}
|
|
|
|
<div class="row post_replies">
|
|
|
|
<div class="col">
|
2023-10-10 22:25:37 +13:00
|
|
|
{% macro render_comment(comment) %}
|
2023-10-16 21:38:36 +13:00
|
|
|
<div id="comment_{{ comment['comment'].id }}" class="comment">
|
2023-10-15 21:13:32 +13:00
|
|
|
<div class="limit_height">
|
|
|
|
<div class="voting_buttons">
|
|
|
|
{% with comment=comment['comment'] %}
|
|
|
|
{% include "community/_voting_buttons.html" %}
|
|
|
|
{% endwith %}
|
|
|
|
</div>
|
|
|
|
<div class="hide_button"><a href='#'>[-] hide</a></div>
|
|
|
|
<div class="comment_author">
|
2023-10-21 15:49:01 +13:00
|
|
|
{% if comment['comment'].author.deleted %}
|
|
|
|
<strong>[deleted]</strong>
|
|
|
|
{% else %}
|
|
|
|
{% if comment['comment'].author.avatar_id %}
|
|
|
|
<a href="/u/{{ comment['comment'].author.link() }}" title="{{ comment['comment'].author.ap_id }}">
|
|
|
|
<img src="{{ comment['comment'].author.avatar_image() }}" alt="Avatar" /></a>
|
|
|
|
{% endif %}
|
|
|
|
<a href="/u/{{ comment['comment'].author.link() }}" title="{{ comment['comment'].author.link() }}">
|
|
|
|
<strong>{{ comment['comment'].author.user_name }}</strong></a>
|
2023-10-15 21:13:32 +13:00
|
|
|
{% endif %}
|
2023-10-16 21:38:36 +13:00
|
|
|
{% if comment['comment'].author.id == post.author.id %}<span title="Submitter of original post" aria-label="submitter">[S]</span>{% endif %}
|
2023-10-15 21:13:32 +13:00
|
|
|
<span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="comment_body hidable">
|
|
|
|
{{ comment['comment'].body_html | safe }}
|
|
|
|
</div>
|
2023-10-15 19:36:14 +13:00
|
|
|
</div>
|
|
|
|
<div class="comment_actions hidable">
|
2023-10-15 21:13:32 +13:00
|
|
|
<a href="{{ url_for('community.add_reply', post_id=post.id, comment_id=comment['comment'].id) }}" rel="nofollow"><span class="fe fe-reply"></span> reply</a>
|
2023-10-15 19:36:14 +13:00
|
|
|
</div>
|
|
|
|
{% if comment['replies'] %}
|
2023-10-16 21:38:36 +13:00
|
|
|
{% if comment['comment'].depth <= THREAD_CUTOFF_DEPTH %}
|
|
|
|
<div class="replies hidable">
|
|
|
|
{% for reply in comment['replies'] %}
|
|
|
|
{{ render_comment(reply) | safe }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="continue_thread hidable">
|
2023-10-18 21:22:33 +13:00
|
|
|
<a href="{{ url_for('community.continue_discussion', post_id=post.id, comment_id=comment['comment'].id, _anchor='replies') }}">
|
2023-10-16 21:38:36 +13:00
|
|
|
Continue thread</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-10-15 19:36:14 +13:00
|
|
|
{% endif %}
|
2023-10-10 22:25:37 +13:00
|
|
|
</div>
|
2023-10-15 19:36:14 +13:00
|
|
|
|
2023-10-10 22:25:37 +13:00
|
|
|
{% endmacro %}
|
2023-10-02 22:16:44 +13:00
|
|
|
|
2023-10-16 21:38:36 +13:00
|
|
|
<div id="replies" class="comments">
|
2023-10-10 22:25:37 +13:00
|
|
|
{% for reply in replies %}
|
|
|
|
{{ render_comment(reply) | safe }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2023-10-02 22:16:44 +13:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-10-15 19:36:14 +13:00
|
|
|
<div class="col-12 col-md-4">
|
2023-10-02 22:16:44 +13:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
{% if current_user.is_authenticated and current_user.subscribed(post.community) %}
|
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ post.community.link() }}/unsubscribe">{{ _('Unsubscribe') }}</a>
|
|
|
|
{% else %}
|
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ post.community.link() }}/subscribe">{{ _('Subscribe') }}</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
2023-10-15 19:36:14 +13:00
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ post.community.link() }}/submit">{{ _('Create post') }}</a>
|
2023-10-02 22:16:44 +13:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form method="get">
|
|
|
|
<input type="search" name="search" class="form-control mt-2" placeholder="{{ _('Search this community') }}" />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card mt-3">
|
|
|
|
<div class="card-header">
|
|
|
|
<h2>{{ _('About community') }}</h2>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<p>{{ post.community.description|safe }}</p>
|
|
|
|
<p>{{ post.community.rules|safe }}</p>
|
|
|
|
{% if len(mods) > 0 and not post.community.private_mods %}
|
|
|
|
<h3>Moderators</h3>
|
|
|
|
<ol>
|
|
|
|
{% for mod in mods %}
|
|
|
|
<li><a href="/u/{{ mod.user_name }}">{{ mod.user_name }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ol>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if is_moderator %}
|
|
|
|
<div class="card mt-3">
|
|
|
|
<div class="card-header">
|
|
|
|
<h2>{{ _('Community Settings') }}</h2>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<p><a href="#" class="btn btn-primary">{{ _('Moderate') }}</a></p>
|
|
|
|
<p><a href="#" class="btn btn-primary">{{ _('Settings') }}</a></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|