aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/journal
diff options
context:
space:
mode:
authorbnewbold <bnewbold@eta.mit.edu>2009-01-25 09:52:32 -0500
committerbnewbold <bnewbold@eta.mit.edu>2009-01-25 09:52:32 -0500
commit17dd049b947cb447628002bae3068581733565f1 (patch)
tree6d91538e68cbe5e778eb3e2e73f289295aa4f7b7 /bn_django/journal
parent85fec94e25e471e4bcdeeafba91deddecd69033a (diff)
downloadbnewnet-17dd049b947cb447628002bae3068581733565f1.tar.gz
bnewnet-17dd049b947cb447628002bae3068581733565f1.zip
tweaked comments form, journal starting to work
Diffstat (limited to 'bn_django/journal')
-rw-r--r--bn_django/journal/templates/journal/base.html5
-rw-r--r--bn_django/journal/templates/journal/entry_detail.html31
-rw-r--r--bn_django/journal/templates/journal/entry_list.html23
-rw-r--r--bn_django/journal/urls.py4
4 files changed, 61 insertions, 2 deletions
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 %}
+ <a href="/journal/">journal</a>
+{% 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 }}
+ &raquo;<a href="../{{ object.slug }}"> {{ object.title }}</a>
+{% endblock %}
+
+{% block title %}
+{% if object.title %}{{ object.title }}{% else %}[Untitled Entry]{% endif %}
+{% endblock %}
+
+{% block content %}<br />
+{% if object %}<div class="right_stuff">
+<p class="date">Entry dated {{ object.date }},
+{% if object.author %}<br />written by {{ object.author }},{% endif %}
+{% if object.last_edited %}<br />last edited {{ object.last_edited }}.{% endif %}
+</div>
+<p class="journal_entry">{{ object.html_content|safe }}</p>
+{% else %}
+<p>This is not the entry you are looking for.</p>
+{% endif %}
+{% endblock %}
+
+{% block commentary %}
+<div class='content' id='commentary'>
+<h3>Post a comment</h3>
+{% render_comment_form for object %}
+{% get_comment_list for object as comments %}
+{% include "comment_list" %}
+</div>
+{% 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 %}
+<br />
+{% if object_list %}
+<ul>
+ {% for item in object_list %}
+ <li /><a href="{{ item.slug }}/">{{item.title}}
+ {% endfor %}
+</ul>
+{% else %}
+<p>No entries have been entered yet.</p>
+{% endif %}
+
+{% if is_paginated %} {% if has_previous %}
+<a href="./?page={{ previous }}">&laquo; previous</a> |
+{% endif %} {% if has_next %}
+<a href="./?page={{ next }}">next &raquo;</a>
+{% 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<slug>)/$', 'object_detail',
- dict(info_dict, queryset=Entry.objects.all(), slug_field='slug')),
+ (r'^(?P<slug>[\d\w-]+)/$', 'object_detail',
+ dict(queryset=Entry.objects.all(), slug_field='slug')),
)