diff options
Diffstat (limited to 'bn_django/git_wiki')
-rw-r--r-- | bn_django/git_wiki/models.py | 5 | ||||
-rw-r--r-- | bn_django/git_wiki/templates/git_wiki/item.html | 16 |
2 files changed, 18 insertions, 3 deletions
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 @@ </span> <br /> {% endblock %} + +{% block commentary %} +<div class="content" id="commentary"> +{% load comments %} +<h3>Post a comment</h3> +{% 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 %} +<br /> +{% 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" %} +</div> +{% endblock %} |