Commit 1e5bb80d by benjaoming

Merge branch 'master' of github.com:benjaoming/django-wiki

parents 832d7903 221fca1f
......@@ -71,8 +71,8 @@ def get_article(func=None, can_read=True, can_write=False,
parent = models.URLPath.get_by_path(path)
return redirect(reverse("wiki:create", kwargs={'path': parent.path,}) + "?slug=%s" % pathlist[-1])
except models.URLPath.DoesNotExist:
# TODO: Make a nice page
return HttpResponseNotFound("This article was not found, and neither was the parent. This page should look nicer.")
c = RequestContext(request, {'error_type' : 'ancestors_missing'})
return HttpResponseNotFound(render_to_string("wiki/error.html", context_instance=c))
if urlpath.article:
# urlpath is already smart about prefetching items on article (like current_revision), so we don't have to
article = urlpath.article
......
{% extends "wiki/base.html" %}
{% load wiki_tags i18n %}
{% load url from future %}
{% block pagetitle %}{{ article.current_revision.title }}{% endblock %}
{% block wiki_breadcrumbs %}
{% include "wiki/includes/breadcrumbs.html" %}
{% endblock %}
{% block wiki_contents %}
{% if error_type == "ancestors_missing" %}
<div class="missing">
<p>This article was not found, and neither was its parent article. <a href="{% url 'wiki:get' path='' %}">Go back to the main wiki article</a></p>
</div>
{% else %}
<div class="error">
<p>There was some sort of error accessing this page. Sorry!</p>
</div>
{% endif %}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment