Merge pull request #859 from MITx/feature/tomg/cas-404
template for 404 and 500 errors
This commit is contained in:
@@ -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'})
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
23
cms/templates/error.html
Normal file
23
cms/templates/error.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<%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>
|
||||
@@ -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')
|
||||
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user