Commit 4d349fbd by Bridger Maxwell

Fixed wiki error page again.

parent c0bba714
...@@ -461,7 +461,7 @@ def not_found(request, article_path, course): ...@@ -461,7 +461,7 @@ def not_found(request, article_path, course):
d = {'wiki_err_notfound': True, d = {'wiki_err_notfound': True,
'article_path': article_path, 'article_path': article_path,
'namespace' : course.wiki_namespace} 'namespace' : course.wiki_namespace}
update_template_dictionary(request, course) update_template_dictionary(d, request, course)
return render_to_response('simplewiki/simplewiki_error.html', d) return render_to_response('simplewiki/simplewiki_error.html', d)
def get_article(request, article_path, course): def get_article(request, article_path, course):
...@@ -495,7 +495,7 @@ def check_permissions(request, article, course, check_read=False, check_write=Fa ...@@ -495,7 +495,7 @@ def check_permissions(request, article, course, check_read=False, check_write=Fa
'wiki_err_nowrite': write_err, 'wiki_err_nowrite': write_err,
'wiki_err_locked': locked_err, 'wiki_err_locked': locked_err,
'wiki_err_deleted': deleted_err,} 'wiki_err_deleted': deleted_err,}
update_template_dictionary(request, course) update_template_dictionary(d, request, course)
# TODO: Make this a little less jarring by just displaying an error # TODO: Make this a little less jarring by just displaying an error
# on the current page? (no such redirect happens for an anon upload yet) # on the current page? (no such redirect happens for an anon upload yet)
# benjaoming: I think this is the nicest way of displaying an error, but # benjaoming: I think this is the nicest way of displaying an error, but
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<%inherit file="simplewiki_base.html"/> <%inherit file="simplewiki_base.html"/>
<%! <%!
from django.core.urlresolvers import reverse from simplewiki.views import wiki_reverse
from simplewiki.views import wiki_namespace_reverse
%> %>
<%block name="title"><title>Wiki Error – MITx 6.002x</title></%block> <%block name="title"><title>Wiki Error – MITx 6.002x</title></%block>
...@@ -22,21 +21,11 @@ ${wiki_error} ...@@ -22,21 +21,11 @@ ${wiki_error}
%endif %endif
%if wiki_err_notfound is not UNDEFINED: %if wiki_err_notfound is not UNDEFINED:
%if article_path is not UNDEFINED: <p>
<p> The page you requested could not be found.
The page you requested could not be found. Click <a href="${wiki_reverse("wiki_create", course=course, kwargs={'article_path' : article_path})}">here</a> to create it.
Click <a href="${wiki_namespace_reverse("wiki_create", course=course, kwargs={'article_path' : article_path})}">here</a> to create it. </p>
</p> %elif wiki_err_no_namespace is not UNDEFINED and wiki_err_no_namespace:
%else:
<p>
Or maybe rather: Congratulations! It seems that there's no root
article, which is probably because you just installed simple-wiki
and your installation is working. Now you can create the root article.
Click <a href="{% url wiki_create "" %}">here</a> to create it.
</p>
%endif
%else:
%if wiki_err_no_namespace is not UNDEFINED and wiki_err_no_namespace:
<p> <p>
You must specify a namespace to create an article in. You must specify a namespace to create an article in.
</p> </p>
...@@ -73,7 +62,7 @@ ${wiki_error} ...@@ -73,7 +62,7 @@ ${wiki_error}
</p> </p>
%elif wiki_err_deleted is not UNDEFINED and wiki_err_deleted: %elif wiki_err_deleted is not UNDEFINED and wiki_err_deleted:
<p> <p>
The article you tried to access has been deleted. You may be able to restore it to an earlier version in its <a href="${reverse("wiki_history", args=[wiki_article.get_url(),1])}">history</a>, or <a href="${reverse("wiki_edit", args=[wiki_article.get_url()])}">create a new version</a>. The article you tried to access has been deleted. You may be able to restore it to an earlier version in its <a href="${wiki_reverse("wiki_history", wiki_article, course)}">history</a>, or <a href="${wiki_reverse("wiki_edit", wiki_article, course)}">create a new version</a>.
</p> </p>
%elif wiki_err_norevision is not UNDEFINED: %elif wiki_err_norevision is not UNDEFINED:
<p> <p>
...@@ -84,7 +73,6 @@ ${wiki_error} ...@@ -84,7 +73,6 @@ ${wiki_error}
An error has occured. An error has occured.
</p> </p>
%endif %endif
%endif
</div> </div>
</%block> </%block>
......
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