#content ul li p.first {
margin: 0;
}
+
+div.comments {
+ border-top: 1px solid #afafaf;
+}
+
+div.comments h3 {
+ margin-top: 0.2em;
+ padding-top: 0;
+}
+
+div.comments div.comment {
+ border-bottom: 1px solid #afafaf;
+}
+
+div.comment_new p label {
+ width: 25%;
+ padding-right: 0.7em;
+ text-align: right;
+ display: block;
+ float: left;
+ vertical-align: top;
+}
+
+div.comment_new p label:after {
+ content: ":";
+}
+
+div.comment_new p input[type="text"] {
+ width: 30em;
+}
+
+div.comment_new p textarea {
+ width: 25em;
+}
+
+div.comments a[name="comments"] {
+ text-decoration: none;
+ display: none;
+}
{% extends "base.html" %}
{% load xhtml11rst %}
+{% load comments %}
{% block extrahead %}
<link rel="alternate" type="application/atom+xml" title="iDunno's Blog - Atom Feed" href="{{ BLOG_FEED_ROOT }}/blog/" />
{% endif %}
{% endif %}
{% endfor %}
- <a href="{{ entry.get_absolute_url }}">permalink</a></p>
+ {% get_comment_count for entry as comment_count %}
+ <a href="{{ entry.get_absolute_url }}">permalink</a> | <a href="{{ entry.get_absolute_url }}#comments">Comments</a>: {{ comment_count }}</p>
{% endfor %}
{% if paginated and has_more_than_one_page %}
<p class="paginator">Pages:
{% extends "base.html" %}
{% load xhtml11rst %}
+{% load comments %}
{% block content %}
<h1>{{ entry.title }}</h1>
{% endif %}
{% endfor %}
{% endif %}
- <a href="{{ entry.get_absolute_url }}">permalink</a>
+ {% get_comment_count for entry as comment_count %}
+ <a href="{{ entry.get_absolute_url }}">permalink</a> | Comments: {{ comment_count }}
</p>
+{% if comment_count %}
+ <div class="comments">
+ <a name="comments"></a>
+ {% get_comment_list for entry as comment_list %}
+ {% for comment in comment_list %}
+ <div class="comment">
+ <h3>{{ comment.user_name }} - {{ comment.submit_date|date:"Y-m-d H:i" }}</h3>
+ {{ comment.comment }}
+ </div>
+ {% endfor %}
+ </div>
+{% endif %}
+<div class="comment_new">
+ {% render_comment_form for entry %}
+</div>
{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block extrahead %}
+{% if extracss %}
+{% for css in extracss %}
+<link rel="stylesheet" type="text/css" href="/css-docs/{{ css.slug }}" />
+{% endfor %}
+{% endif %}
+{% endblock %}
--- /dev/null
+# Author: Brett Parker <iDunno@sommitrealweird.co.uk>
+
+"""
+HTML1.1 Writer.
+"""
+
+__docformat__ = 'reStructuredText'
+
+import sys
+import os
+import os.path
+import codecs
+import docutils
+from docutils import frontend, nodes, utils, writers
+from docutils.writers import html4css1
+
+class Writer(html4css1.Writer):
+
+ config_section = 'xhtml11 writer'
+ config_section_dependencies = ('writers', 'html4css1 writer')
+
+ def __init__(self):
+ html4css1.Writer.__init__(self)
+ self.translator_class = HTMLTranslator
+
+class HTMLTranslator(html4css1.HTMLTranslator):
+
+ def is_compactable(self, node):
+ return False
+
+ def should_be_compact_paragraph(self, node):
+ return False
--- /dev/null
+from django import template
+from django.conf import settings
+from django.utils.encoding import smart_str, force_unicode
+from django.utils.safestring import mark_safe
+from generic import docutils_xhtml11
+
+register = template.Library()
+
+def restructuredtext(value):
+ try:
+ from docutils.core import publish_parts
+ except ImportError:
+ if settings.DEBUG:
+ raise template.TemplateSyntaxError, "Error in {% restructuredtext %} filter: The Python docutils library isn't installed."
+ return force_unicode(value)
+ else:
+ docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {})
+ parts = publish_parts(source=smart_str(value), writer=docutils_xhtml11.Writer(), settings_overrides=docutils_settings)
+ return mark_safe(force_unicode(parts["fragment"]))
+restructuredtext.is_safe = True
+
+register.filter(restructuredtext)
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.markup',
+ 'django.contrib.comments',
'bpcms',
'generic',
'blog',
(r'^blog/', include('blog.urls')),
(r'^photo/', include('photo.urls')),
(r'^photos/', include('photo.urls')),
+ (r'^css-doc/(?P<slug>.*)$', 'bpcms.views.css_view'),
(r'^feeds/rss/(?P<url>.*)/', 'django.contrib.syndication.views.feed', {'feed_dict': rssfeeds_dict}),
(r'^feeds/(?P<url>.*)/', 'django.contrib.syndication.views.feed', {'feed_dict': feeds_dict}),
+ (r'^comments/', include('django.contrib.comments.urls')),
(r'^(?:content/|)', include('bpcms.urls'))
)