~crocmagnon/blog

ref: 1fa73b90fbfd0cb50740c15214d1787c529bc38e blog/articles/templates/articles/article_detail.html -rw-r--r-- 1.7 KiB
1fa73b90Gabriel Augendre Add message when approving/rejecting comments 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% 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 %}