blob: 475775d5fafc7401a216e76fd3e838a5580f72cf (
plain)
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
|
{% comment %}
Something that django.contrib.comments does not provide:
An individual template for a single comment, to easily be reused.
This include is also used by the Ajax comments view.
The div id should be "c{id}", because the comment.get_absolute_url() points to it.
NOTE: to override the displayed date format, don't replace this template.
Instead, define DATETIME_FORMAT in a locale file. Requires setting:
FORMAT_MODULE_PATH = 'settings.locale'
Then create 'settings/locale/XY/formats.py' with:
DATETIME_FORMAT = '...'
This should give you consistent dates across all views.
{% endcomment %}
{% load i18n %}
<div {% if preview %} id="comment-preview"{% else %} id="comment{{ comment.id }}"{% endif %} class="p-comment h-cite u-in-reply-to comment--item {% if comment.url == "http://lux.me/" %}comment--me{%endif%}">
{% if preview %}<h3>{% trans "Preview of your comment" %}</h3>{% endif %}
<h6 class="p-author h-card comment--author">
{% if comment.url %}{%if comment.url == "http://lux.me/"%}<a href="/">{%else%}<a href="{{ comment.url }}" rel="nofollow">{% endif %}{% endif %}
{% if comment.name %}{{ comment.name }}{% else %}{% trans "Anonymous" %}{% endif %}{% comment %}
{% endcomment %}{% if comment.url %}</a>{% endif %}
{% if not comment.is_public %}<span class="comment-moderated-flag">({% trans "moderated" %})</span>{% endif %}
{% if USE_THREADEDCOMMENTS and not preview %}<a href="#c{{ comment.id }}" data-comment-id="{{ comment.id }}" class="comment-reply-link">{% trans "reply" %}</a>{% endif %}
</h6>
<a class="comment--datelink" href="#comment{{comment.id}}"><time datetime="{{comment.submit_date|date:'c'}}" class="dt-updated">{% blocktrans with submit_date=comment.submit_date %}{{ submit_date }}{% endblocktrans %}</time></a>
<div class="e-content comment--content">{{ comment.comment|linebreaks }}</div>
</div>
|