aircox-radiocampus/aircox_cms/templates/aircox_cms/snippets/comments.html
2016-11-14 13:35:15 +01:00

56 lines
1.4 KiB
HTML
Executable File

{% load i18n %}
{% load static %}
{% load honeypot %}
{% if comment_form or page.comments %}
<h2><img src="{% static "aircox_cms/images/comments.png" %}" class="icon">{% trans "Comments" %}</h2>
{% endif %}
{% if comment_form %}
{% with comment_form as form %}
{{ form.non_field_errors }}
<form action="" method="POST">
{% csrf_token %}
{% render_honeypot_field "hp_website" %}
<div>
<input type="hidden" name="type" value="comments">
{{ form.author.errors }}
{{ form.author }}
<div>
<input type="checkbox" value="1" id="show_more">
<label for="show_more">{% trans "show more options" %}</label>
<div class="extra">
{{ form.email.errors }}
{{ form.email }}
{{ form.url.errors }}
{{ form.url }}
</div>
</div>
</div>
<div>
{{ form.content.errors }}
{{ form.content }}
<button type="submit">{% trans "Post!" %}</button>
</div>
</form>
{% endwith %}
{% endif %}
<ul class="list">
{% for comment in page.comments %}
<li class="comment">
<div class="metadata">
<a {% if comment.url %}href="{{ comment.url }}" {% endif %}
class="author">{{ comment.author }}</a>
<time datetime="{{ comment.date }}">
{{ comment.date|date:'l d F, H:i' }}
</time>
</div>
<div class="body">{{ comment.content }}</div>
</li>
{% endfor %}
</ul>