~crocmagnon/blog

ref: 23985a3263ac83aab2f72e90ec98bfea4632a7fc blog/articles/templates/articles/comment_snippet.html -rw-r--r-- 1.3 KiB
23985a32Gabriel Augendre Highlight targeted comment & add permalink 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
<section class="comments">
    <h2>Comments</h2>
    {% for comment in comments %}
        <article id="{{ comment.id }}" class="comment">
            <p class="metadata">
                <a class="permalink" title="Permalink" href="#{{ comment.id }}">🔗</a>
                <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>