Plume/templates/posts/details.html.tera

94 lines
3.6 KiB
Text
Raw Normal View History

2018-05-09 19:09:52 +00:00
{% extends "base" %}
{% block title %}
{{ post.title }}
{% endblock title %}
2018-05-10 20:31:52 +00:00
{% block header %}
<a href="../">{{ blog.title }}</a>
{% endblock header %}
2018-05-09 19:09:52 +00:00
{% block content %}
<h1 class="article">{{ post.title }}</h1>
<p class="article-info">
{% if author.display_name %}
{% set name = author.display_name %}
{% else %}
{% set name = author.username %}
{% endif %}
<span class="author">{{ "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name }}{{ link_3 }}" | _(
2018-06-17 16:19:39 +00:00
link_1='<a href="/@/',
url=author.fqn,
link_2='/">',
name=name,
link_3="</a>"
)
}}</a></span>
2018-05-19 07:53:51 +00:00
&mdash;
<span class="date">{{ date | date(format="%B %e, %Y") }}</span>
2018-05-19 07:53:51 +00:00
</p>
2018-05-10 20:31:52 +00:00
<article>
2018-05-10 09:44:57 +00:00
{{ post.content | safe }}
2018-05-10 20:31:52 +00:00
</article>
2018-05-10 16:38:03 +00:00
2018-05-10 20:31:52 +00:00
<div class="article-meta">
2018-06-17 15:26:15 +00:00
<p>{{ "This article is under the {{ license }} license." | _(license=post.license) }}</p>
2018-05-10 16:38:03 +00:00
<div class="likes">
2018-05-10 20:31:52 +00:00
<p>
2018-06-17 15:26:15 +00:00
{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}
2018-05-10 20:31:52 +00:00
</p>
{% if has_liked %}
<a class="button liked" href="like">{{ "I don't like this anymore" | _ }}</a>
{% else %}
<a class="button" href="like">{{ "Add yours" | _ }}</a>
{% endif %}
</div>
<div class="reshares">
2018-05-19 09:57:39 +00:00
<p>
2018-06-17 15:26:15 +00:00
{{ "{{ count }} reshares" | _n(singular="One reshare", count=n_reshares) }}
2018-05-19 09:57:39 +00:00
</p>
{% if has_reshared %}
<a class="button reshared" href="reshare">{{ "I don't want to reshare this anymore" | _ }}</a>
{% else %}
<a class="button" href="reshare">{{ "Reshare" | _ }}</a>
{% endif %}
2018-05-10 09:44:57 +00:00
</div>
2018-05-10 20:31:52 +00:00
<div class="comments">
<h2>{{ "Comments" | _ }}</h2>
2018-06-21 13:40:00 +00:00
{% if account %}
<form method="post" action="/~/{{ blog.actor_id }}/{{ post.slug }}/comment">
<label for="content">{{ "Your comment" | _ }}</label>
{# Ugly, but we don't have the choice if we don't want weird paddings #}
<textarea id="content" name="content">{% filter trim %}{% if previous %}{% if previous.author.fqn != user_fqn %}@{{ previous.author.fqn }} {% endif %}{% for mention in previous.mentions %}{% if mention != user_fqn %}@{{ mention }} {% endif %}{% endfor %}{% endif %}{% endfilter %}</textarea>
<input type="submit" value="{{ "Submit comment" | _ }}" />
</form>
{% endif %}
<div class="list">
{% for comment in comments %}
{% if comment.author.display_name %}
{% set comment_author_name = comment.author.display_name %}
{% else %}
{% set comment_author_name = comment.author.username %}
{% endif %}
<div class="comment" id="comment-{{ comment.id }}">
<a class="author" href="{{ comment.author.ap_url }}">
<span class="display-name">{{ comment.author.display_name }}</span>
<span class="username">@{{ comment.author.username }}</span>
</a>
<div class="text">{{ comment.content | safe }}</div>
<a class="button" href="comment?responding_to={{ comment.id }}">{{ "Respond" | _ }}</a>
</div>
{% endfor %}
</div>
</div>
2018-05-10 20:31:52 +00:00
</div>
2018-05-09 19:09:52 +00:00
{% endblock content %}