Commit 6a7fb1d5 by Calen Pennington

Merge pull request #859 from MITx/feature/tomg/cas-404

template for 404 and 500 errors
parents 5eb0ca69 782e5f51
......@@ -786,3 +786,9 @@ def static_pages(request, org, course, coursename):
def edit_static(request, org, course, coursename):
return render_to_response('edit-static-page.html', {})
def not_found(request):
return render_to_response('error.html', {'error': '404'})
def server_error(request):
return render_to_response('error.html', {'error': '500'})
\ No newline at end of file
......@@ -25,4 +25,41 @@
@include orange-button;
}
}
}
body.error {
background: $darkGrey;
color: #3c3c3c;
.primary-header {
display: none;
}
.error-prompt {
width: 700px;
margin: 150px auto;
padding: 60px 50px 90px;
border-radius: 3px;
background: #fff;
text-align: center;
}
h1 {
float: none;
margin: 0;
font-size: 60px;
font-weight: 300;
color: #3c3c3c;
}
.description {
margin-bottom: 50px;
font-size: 21px;
}
.back-button {
@include blue-button;
padding: 14px 40px 18px;
font-size: 18px;
}
}
\ No newline at end of file
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
<%block name="bodyclass">error</%block>
<%block name="title">
% if error == '404':
404 - Page Not Found
% elif error == '500':
500 - Internal Server Error
% endif
</%block>
<%block name="content">
<article class="error-prompt">
% if error == '404':
<h1>Hmm…</h1>
<p class="description">we can't find that page.</p>
% elif error == '500':
<h1>Oops…</h1>
<p class="description">there was a problem with the server.</p>
% endif
<a href="/" class="back-button">Back to dashboard</a>
</article>
</%block>
\ No newline at end of file
......@@ -35,7 +35,10 @@ urlpatterns = ('',
url(r'^edit_static/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.edit_static', name='edit_static'),
# temporary landing page for a course
url(r'^landing/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.landing', name='landing')
url(r'^landing/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.landing', name='landing'),
url(r'^not_found$', 'contentstore.views.not_found', name='not_found'),
url(r'^server_error$', 'contentstore.views.server_error', name='server_error')
)
......
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