Plume/templates/posts/details.html.tera

122 lines
5.7 KiB
Plaintext
Raw Normal View History

2018-05-09 19:09:52 +00:00
{% extends "base" %}
{% import "macros" as macros %}
2018-05-09 19:09:52 +00:00
{% block title %}
{{ article.post.title }}
2018-05-09 19:09:52 +00:00
{% endblock title %}
2018-05-10 20:31:52 +00:00
{% block header %}
<a href="/~/{{ blog.fqn }}">{{ blog.title }}</a>
2018-05-10 20:31:52 +00:00
{% endblock header %}
2018-05-09 19:09:52 +00:00
{% block content %}
<h1 class="article">{{ article.post.title }}</h1>
2018-09-04 11:26:13 +00:00
<h2 class="article">{{ article.post.subtitle }}</h2>
<p class="article-info">
<span class="author">{{ "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" | _(
2018-06-17 16:19:39 +00:00
link_1='<a href="/@/',
url=author.fqn,
link_2='/">',
name=author.name,
2018-06-17 16:19:39 +00:00
link_3="</a>"
)
}}</a></span>
2018-05-19 07:53:51 +00:00
&mdash;
<span class="date">{{ date | date(format="%B %e, %Y") }}</span>
{% if is_author %}
2018-09-07 17:51:53 +00:00
&mdash;
<a href="{{ article.url}}edit">{{ "Edit" | _ }}</a>
2018-09-01 20:16:38 +00:00
&mdash;
2018-09-01 14:28:50 +00:00
<a href="{{ article.url}}delete" onclick="return confirm('Are you sure you?')">{{ "Delete this article" | _ }}</a>
{% endif %}
2018-05-19 07:53:51 +00:00
</p>
2018-05-10 20:31:52 +00:00
<article>
{{ article.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">
<p>{{ "This article is under the {{ license }} license." | _(license=article.post.license) }}</p>
<ul class="tags">
{% for tag in article.tags %}
2018-09-06 12:06:04 +00:00
<li><a href="/tag/{{ tag.tag }}">{{ tag.tag }}</a></li>
{% endfor %}
</ul>
<div class="flex">
2018-09-09 20:41:55 +00:00
{{ macros::avatar(user=author, pad=true, size="medium") }}
<div class="grow">
<h2><a href="/@/{{ author.fqn }}">{{ author.name }}</a></h2>
<p>{{ author.summary | safe }}</h2>
</div>
<a href="/@/{{ author.fqn }}/follow" class="button">
{% if is_following %}
{{ "Unfollow" | _ }}
{% else %}
{{ "Follow" | _ }}
{% endif %}
</a>
</div>
2018-05-10 16:38:03 +00:00
{% if account %}
<div class="actions">
<form class="likes" action="{{ article.url }}like" method="POST">
<p aria-label="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}" title="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}">{{ n_likes }}</p>
{% if has_liked %}
<button type="submit" class="action liked">{{ macros::feather(name="heart") }}{{ "I don't like this anymore" | _ }}</button>
{% else %}
<button type="submit" class="action">{{ macros::feather(name="heart") }}{{ "Add yours" | _ }}</button>
{% endif %}
</form>
<form class="reshares" action="{{ article.url }}reshare" method="POST">
<p aria-label="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}" title="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}">{{ n_reshares }}</p>
2018-06-25 12:07:28 +00:00
{% if has_reshared %}
<button type="submit" class="action reshared"><i class="icon icon-repeat"></i>{{ "I don't want to boost this anymore" | _ }}</button>
{% else %}
<button type="submit" class="action"><i class="icon icon-repeat"></i>{{ "Boost" | _ }}</button>
{% endif %}
</form>
</div>
{% else %}
<p class="center">{{ "Login or use your Fediverse account to interact with this article" | _ }}</p>
<div class="actions">
<div class="likes">
<p aria-label="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}" title="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}">{{ n_likes }}</p>
<a href="/login?m=Login%20to%20like" class="action">{{ macros::feather(name="heart") }}{{ "Add yours" | _ }}</a>
</div>
<div class="reshares">
<p aria-label="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}" title="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}">{{ n_reshares }}</p>
<a href="/login?m=Login%20to%20boost" class="action"><i class="icon icon-repeat"></i>{{ "Boost" | _ }}</a>
</div>
</div>
{% endif %}
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="{{ article.url }}comment">
2018-06-21 13:40:00 +00:00
<label for="content">{{ "Your comment" | _ }}</label>
{% if previous %}
<input type="hidden" name="responding_to" value="{{ previous.id }}"/>
{% endif %}
2018-06-21 13:40:00 +00:00
{# 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 %}
{% if comments | length > 0 %}
<div class="list">
{% for comment in comments %}
{{ macros::comment(comm=comment) }}
{% endfor %}
</div>
{% else %}
<p class="center">{{ "No comments yet. Be the first to react!" | _ }}</p>
{% endif %}
</div>
2018-05-10 20:31:52 +00:00
</div>
2018-05-09 19:09:52 +00:00
{% endblock content %}