{% extends 'articles/base.html' %}
{% block title %}
{{ article.title }}
{% endblock %}
{% block content %}
<article class="article-detail">
<h1>{{ article.title }}{% if article.status != article.PUBLISHED %} ({{ article.status }}){% endif %}</h1>
{% include "articles/metadata_snippet.html" %}
<div>
{{ article.get_formatted_content|safe }}
</div>
</article>
<section class="comments">
<h2>Comments</h2>
{% for comment in comments %}
<article id="{{ comment.id }}" class="comment">
<p class="metadata">
<span class="username">{{ comment.username }}</span> |
<time datetime="{{ comment.created_at|date:'c' }}">
{{ comment.created_at|date:"DATETIME_FORMAT" }}
</time>
{% include "articles/admin_link_snippet.html" with article=comment %}
</p>
<p class="content">
{{ comment.content|linebreaksbr }}
</p>
</article>
{% empty %}
No reaction yet, write your own!
{% endfor %}
<form id="comment-form" action="{% url 'create-comment' slug=article.slug %}" method="post">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<button type="submit">Submit</button>
<p class="helptext">
Your comment may not be approved if it's not respectful, on topic or spammy.
If you feel I've made a mistake with your comment, please
<a href="/about-me/">send me a message</a>!
</p>
</form>
</section>
{% endblock %}