diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 9f3685aeb9..fa9bd30797 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -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 diff --git a/cms/static/sass/_alerts.scss b/cms/static/sass/_alerts.scss index 033ba62218..11d2e4fe3a 100644 --- a/cms/static/sass/_alerts.scss +++ b/cms/static/sass/_alerts.scss @@ -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 diff --git a/cms/templates/error.html b/cms/templates/error.html new file mode 100644 index 0000000000..e170b4e2c6 --- /dev/null +++ b/cms/templates/error.html @@ -0,0 +1,23 @@ +<%inherit file="base.html" /> +<%! from django.core.urlresolvers import reverse %> +<%block name="bodyclass">error +<%block name="title"> + % if error == '404': + 404 - Page Not Found + % elif error == '500': + 500 - Internal Server Error + % endif + + +<%block name="content"> +
+ % if error == '404': +

Hmm…

+

we can't find that page.

+ % elif error == '500': +

Oops…

+

there was a problem with the server.

+ % endif + Back to dashboard +
+ \ No newline at end of file diff --git a/cms/urls.py b/cms/urls.py index 4f9ac7485e..c5802d8b7f 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -35,7 +35,10 @@ urlpatterns = ('', url(r'^edit_static/(?P[^/]+)/(?P[^/]+)/course/(?P[^/]+)$', 'contentstore.views.edit_static', name='edit_static'), # temporary landing page for a course - url(r'^landing/(?P[^/]+)/(?P[^/]+)/course/(?P[^/]+)$', 'contentstore.views.landing', name='landing') + url(r'^landing/(?P[^/]+)/(?P[^/]+)/course/(?P[^/]+)$', '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') )