aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_wiki/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bn_django/git_wiki/views.py')
-rw-r--r--bn_django/git_wiki/views.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bn_django/git_wiki/views.py b/bn_django/git_wiki/views.py
index c0681c7..b0dde21 100644
--- a/bn_django/git_wiki/views.py
+++ b/bn_django/git_wiki/views.py
@@ -7,14 +7,20 @@ import os, commands
from models import *
from settings import *
+from django.contrib.comments.models import Comment,FreeComment
# Create your views here.
def frontpage(request):
t = fromslug('')
t.update()
+ #TODO: doesn't display free comments unless there's a comment
+ lc = Comment.objects.filter(content_type__name="item").order_by('-submit_date')[:6]
+ lfc = FreeComment.objects.filter(content_type__name="item").order_by('-submit_date')[:6]
return render_to_response('git_wiki/frontpage.html', \
- dict(shortlog=shortlog(), tree=t))
+ dict(shortlog=shortlog(), tree=t,
+ latest_comments=lc, latest_freecomments=lfc,
+ newitems=newest_items()))
def tree(request, reqslug, tree=None):
if not tree:
@@ -52,7 +58,7 @@ def item(request, reqslug, blob=None):
docutils_settings = getattr(settings, "GITWIKI_REST_SETTINGS", {})
parts = publish_parts(source=i.contents, writer_name="html4css1", settings_overrides=docutils_settings)
return render_to_response('git_wiki/item.html',
- dict(item=i,doc=parts))
+ dict(item=i,doc=parts,user=request.user))
def olditem(request, hash):
i = get_object_or_404(Item, id=hash)