From cf804de463c83bfe11aba3576be2ccdd34443fd1 Mon Sep 17 00:00:00 2001
From: bnewbold
- Item name:
- {{ item.name }}
- Item sha1 hash:
- {{ item.id }}
- Raw Contents:
- {{ item.contents|escape|wordwrap:80 }}
-
+ Meta
+ Item name:
+ {{ item.name }}
+ Item sha1 hash:
+ {{ item.id }}
- pdf - log
+ raw -
+ pdf -
+ log
{% endblock %}
diff --git a/bn_django/git_wiki/views.py b/bn_django/git_wiki/views.py
index 2e66061..c0681c7 100644
--- a/bn_django/git_wiki/views.py
+++ b/bn_django/git_wiki/views.py
@@ -1,7 +1,7 @@
from django import forms, http, template
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, render_to_response
-from django.http import HttpResponse, Http404
+from django.http import HttpResponse, Http404, HttpResponseServerError
import os, commands
@@ -42,8 +42,17 @@ def item(request, reqslug, blob=None):
else:
i = blob
i.update()
- return render_to_response('git_wiki/item.html',
- dict(item=i))
+
+ try:
+ from docutils.core import publish_parts
+ except ImportError:
+ if settings.DEBUG:
+ raise HttpResponseServerError(request)
+ else:
+ 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))
def olditem(request, hash):
i = get_object_or_404(Item, id=hash)
diff --git a/bn_django/templates/comments/form.html b/bn_django/templates/comments/form.html
index c5aa768..316d6a1 100644
--- a/bn_django/templates/comments/form.html
+++ b/bn_django/templates/comments/form.html
@@ -1,5 +1,4 @@
{% load i18n %}
-{% if display_form %}