mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
173 lines
8.5 KiB
HTML
173 lines
8.5 KiB
HTML
{% extends "base.html" %}
|
|
{% from 'bootstrap/form.html' import render_form %}
|
|
|
|
{% block app_content %}
|
|
<div class="row">
|
|
<div class="col-8 position-relative">
|
|
<div class="row">
|
|
{% if post.image_id %}
|
|
<div class="col-8">
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/c/{{ post.community.link() }}">{{ post.community.title }}</a></li>
|
|
<li class="breadcrumb-item active">{{ post.title|shorten(15) }}</li>
|
|
</ol>
|
|
</nav>
|
|
<h1 class="mt-2">{{ post.title }}</h1>
|
|
{% if post.url %}
|
|
<p><small><a href="{{ post.url }}" rel="nofollow ugc">{{ post.url|shorten_url }}</a>
|
|
{% if post.type == post_type_link %}
|
|
<span class="domain_link">(<a href="/d/{{ post.domain_id }}">domain</a>)</span>
|
|
{% endif %}
|
|
</small></p>
|
|
{% endif %}
|
|
<p><small>submitted {{ moment(post.posted_at).fromNow() }} by {{ post.author.user_name }}</small></p>
|
|
</div>
|
|
<div class="col-4">
|
|
{% if post.url %}
|
|
<a href="post.url" rel="nofollow ugc"><img src="{{ post.image.source_url }}" alt="{{ post.image.alt_text }}"
|
|
width="100" /></a>
|
|
{% else %}
|
|
<a href="post.image.source_url"><img src="{{ post.image.source_url }}" alt="{{ post.image.alt_text }}"
|
|
width="100" /></a>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/c/{{ post.community.link() }}">{{ post.community.title }}</a></li>
|
|
<li class="breadcrumb-item active">{{ post.title|shorten(15) }}</li>
|
|
</ol>
|
|
</nav>
|
|
<h1 class="mt-2">{{ post.title }}</h1>
|
|
{% if post.url %}
|
|
<p><small><a href="{{ post.url }}" rel="nofollow ugc">{{ post.url|shorten_url }}
|
|
<img src="/static/images/external_link_black.svg" class="external_link_icon" alt="External link" /></a>
|
|
{% if post.type == post_type_link %}
|
|
<span class="domain_link">(<a href="/d/{{ post.domain_id }}">domain</a>)</span>
|
|
{% endif %}
|
|
</small></p>
|
|
{% endif %}
|
|
<p class="small">submitted {{ moment(post.posted_at).fromNow() }} by
|
|
<a href="{{ url_for('activitypub.user_profile', actor=post.author.user_name) }}">{{ post.author.user_name }}</a>
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if post.body_html %}
|
|
<div class="row post_full">
|
|
<div class="col">
|
|
{{ post.body_html|safe }}
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if post.comments_enabled %}
|
|
<div class="row post_reply_form">
|
|
<div class="col">
|
|
{{ render_form(form) }}
|
|
</div>
|
|
<hr class="mt-4" />
|
|
</div>
|
|
{% else %}
|
|
<p>{{ _('Comments are disabled for this post.') }}</p>
|
|
{% endif %}
|
|
<div class="row post_replies">
|
|
<div class="col">
|
|
{% macro render_comment(comment) %}
|
|
<div class="comment" style="margin-left: {{ comment['comment'].depth * 20 }}px;">
|
|
<div class="voting_buttons">
|
|
<div class="upvote_button digits_{{ digits(comment['comment'].up_votes) }}"><a href="#"><span class="fe fe-arrow-up"></span>
|
|
{{ comment['comment'].up_votes }}</a>
|
|
</div>
|
|
<div class="downvote_button digits_{{ digits(comment['comment'].down_votes) }}"><a href="#"><span class="fe fe-arrow-down"></span>
|
|
{{ comment['comment'].down_votes }}</a>
|
|
</div>
|
|
</div>
|
|
<div class="hide_button"><a href="#">[-] hide</a></div>
|
|
<div class="comment_author">
|
|
{% 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>
|
|
<span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}</span>
|
|
</div>
|
|
{{ comment['comment'].body_html | safe }}
|
|
</div>
|
|
{% if comment['replies'] %}
|
|
<div class="replies">
|
|
{% for reply in comment['replies'] %}
|
|
{{ render_comment(reply) | safe }}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
<div class="comments">
|
|
{% for reply in replies %}
|
|
{{ render_comment(reply) | safe }}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-4">
|
|
<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">
|
|
<a class="w-100 btn btn-primary" href="/community/{{ post.community.link() }}/submit">{{ _('Create a post') }}</a>
|
|
</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 %}
|