From b148bab8f549792f19ae0256c00c282f29e061dc Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 7 Mar 2007 01:09:52 -0800 Subject: much work; comments working for photos, static content moved, more --- bn_django/git_wiki/models.py | 5 ++--- bn_django/git_wiki/templates/git_wiki/item.html | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'bn_django/git_wiki') diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index 060e9d5..ad3affb 100644 --- a/bn_django/git_wiki/models.py +++ b/bn_django/git_wiki/models.py @@ -59,6 +59,7 @@ class Tree(models.Model): self.tree_objs = tree_objs self.blob_objs = blob_objs self.all_objs = tree_objs + blob_objs + self.save() class Item(models.Model): @@ -90,7 +91,7 @@ class Item(models.Model): self.contents = commands.getoutput(GITPREFIX + ' cat-file -p ' \ + self.id) self.size = commands.getoutput(GITPREFIX + ' cat-file -s ' + self.id) - return + self.save() class Commit(models.Model): id = models.CharField("hash", maxlength=40,blank=False,primary_key=True) @@ -143,8 +144,6 @@ class Commit(models.Model): self.comment += str(l) + '\n' else: self.comment = '(none)' - return - def fromslug(reqslug): import commands diff --git a/bn_django/git_wiki/templates/git_wiki/item.html b/bn_django/git_wiki/templates/git_wiki/item.html index 16d3518..4258b1c 100644 --- a/bn_django/git_wiki/templates/git_wiki/item.html +++ b/bn_django/git_wiki/templates/git_wiki/item.html @@ -27,3 +27,19 @@
{% endblock %} + +{% block commentary %} +
+{% load comments %} +

Post a comment

+{% if user.is_authenticated %} +{% comment_form for git_wiki.item item.id with is_public yes %} +{% else %} +{% free_comment_form for git_wiki.item item.id with is_public yes %} +{% endif %} +
+{% get_comment_list for git_wiki.item item.id as comments %} +{% get_free_comment_list for git_wiki.item item.id as free_comments %} +{% include "comment_list" %} +
+{% endblock %} -- cgit v1.2.3