diff options
author | luxagraf <sng@luxagraf.net> | 2014-05-23 10:48:20 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2014-05-23 10:48:20 -0400 |
commit | 4bae11bb25a8e3c43118891d17fd8e981ecf8dc6 (patch) | |
tree | 6c452743157ad9403ec54a7399b10069688d048f /design/templates/comments/comment.html | |
parent | eebf53322e0d19be42e41d8f355c5d2a744441ae (diff) |
Refactored code to use PEP8/Pyflake coding styles and cleaned up cruft a
bit
Diffstat (limited to 'design/templates/comments/comment.html')
-rw-r--r-- | design/templates/comments/comment.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/design/templates/comments/comment.html b/design/templates/comments/comment.html new file mode 100644 index 0000000..475775d --- /dev/null +++ b/design/templates/comments/comment.html @@ -0,0 +1,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> |