From 17dd049b947cb447628002bae3068581733565f1 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 25 Jan 2009 09:52:32 -0500 Subject: tweaked comments form, journal starting to work --- bn_django/journal/templates/journal/base.html | 5 ++++ .../journal/templates/journal/entry_detail.html | 31 ++++++++++++++++++++++ .../journal/templates/journal/entry_list.html | 23 ++++++++++++++++ bn_django/journal/urls.py | 4 +-- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 bn_django/journal/templates/journal/base.html create mode 100644 bn_django/journal/templates/journal/entry_detail.html create mode 100644 bn_django/journal/templates/journal/entry_list.html (limited to 'bn_django/journal') diff --git a/bn_django/journal/templates/journal/base.html b/bn_django/journal/templates/journal/base.html new file mode 100644 index 0000000..819b1f4 --- /dev/null +++ b/bn_django/journal/templates/journal/base.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block path %} + journal +{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_detail.html b/bn_django/journal/templates/journal/entry_detail.html new file mode 100644 index 0000000..45edd4b --- /dev/null +++ b/bn_django/journal/templates/journal/entry_detail.html @@ -0,0 +1,31 @@ +{% extends "journal/base.html" %} +{# {% load markup %} #} +{% load comments %} +{% block path %}{{ block.super }} + » {{ object.title }} +{% endblock %} + +{% block title %} +{% if object.title %}{{ object.title }}{% else %}[Untitled Entry]{% endif %} +{% endblock %} + +{% block content %}
+{% if object %}
+

Entry dated {{ object.date }}, +{% if object.author %}
written by {{ object.author }},{% endif %} +{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} +

+

{{ object.html_content|safe }}

+{% else %} +

This is not the entry you are looking for.

+{% endif %} +{% endblock %} + +{% block commentary %} +
+

Post a comment

+{% render_comment_form for object %} +{% get_comment_list for object as comments %} +{% include "comment_list" %} +
+{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_list.html b/bn_django/journal/templates/journal/entry_list.html new file mode 100644 index 0000000..f103c4e --- /dev/null +++ b/bn_django/journal/templates/journal/entry_list.html @@ -0,0 +1,23 @@ +{% extends "journal/base.html" %} +{# {% load markup %} #} + +{% block title %}Journal Entries{% endblock %} + +{% block content %} +
+{% if object_list %} + +{% else %} +

No entries have been entered yet.

+{% endif %} + +{% if is_paginated %} {% if has_previous %} +
« previous | +{% endif %} {% if has_next %} +next » +{% endif %} {% endif %} +{% endblock %} diff --git a/bn_django/journal/urls.py b/bn_django/journal/urls.py index d65d52a..1730ac7 100644 --- a/bn_django/journal/urls.py +++ b/bn_django/journal/urls.py @@ -7,6 +7,6 @@ urlpatterns = patterns('django.views.generic.list_detail', (r'^$', 'object_list', dict(queryset=Entry.objects.order_by('-date'), paginate_by=35, allow_empty=False)), - (r'^(?P)/$', 'object_detail', - dict(info_dict, queryset=Entry.objects.all(), slug_field='slug')), + (r'^(?P[\d\w-]+)/$', 'object_detail', + dict(queryset=Entry.objects.all(), slug_field='slug')), ) -- cgit v1.2.3