From 605a004f8b6cf67c2db28345ba3202b248e8afc0 Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Tue, 13 May 2014 13:34:19 -0500 Subject: [PATCH] Error pages --- .../js/controllers/run-controller.coffee | 4 + views/403.ejs | 76 ---------------- views/403.jade | 16 ++++ views/404.ejs | 72 ---------------- views/404.jade | 12 +++ views/500.ejs | 86 ------------------- views/500.jade | 16 ++++ 7 files changed, 48 insertions(+), 234 deletions(-) delete mode 100644 views/403.ejs create mode 100644 views/403.jade delete mode 100644 views/404.ejs create mode 100644 views/404.jade delete mode 100644 views/500.ejs create mode 100644 views/500.jade diff --git a/assets/linker/js/controllers/run-controller.coffee b/assets/linker/js/controllers/run-controller.coffee index 7dcf8d3..fc2a06c 100644 --- a/assets/linker/js/controllers/run-controller.coffee +++ b/assets/linker/js/controllers/run-controller.coffee @@ -8,6 +8,10 @@ lunchControllers.controller 'RunCtrl', ['$scope', 'socket', '$routeParams', ($sc socket.get '/run/' + $routeParams['id'], (response) -> + if response.status is 404 + window.location = '/404' + return + $scope.show = true $scope.run = response diff --git a/views/403.ejs b/views/403.ejs deleted file mode 100644 index 28dc68d..0000000 --- a/views/403.ejs +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Forbidden - - - - - -
-
- -
- -
-

- Forbidden -

-

- <% if (typeof messageĀ !== 'undefined') { %> - <%= message %> - <% } else { %> - You don't have permission to see the page you're trying to reach. - <% } %> -

-

- Why might this be happening? -

-
- - -
- - - \ No newline at end of file diff --git a/views/403.jade b/views/403.jade new file mode 100644 index 0000000..5956aa8 --- /dev/null +++ b/views/403.jade @@ -0,0 +1,16 @@ +extends interior-page-layout + +block pagetitle + | 403: Forbidden + +block interiorcontent + p + | Sorry, you are not authorized to perform that action. + + p + | If you think you should be able to perform this action + | please let us know about the issue by sending us a message + | via the little question mark bubble in the bottom-right of + | the screen. + + p Thanks! diff --git a/views/404.ejs b/views/404.ejs deleted file mode 100644 index f7b6bb7..0000000 --- a/views/404.ejs +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Page Not Found - - - - - -
-
- -
- -
-

- Something's fishy here. -

-

- The page you were trying to reach doesn't exist. -

-

- Why might this be happening? -

-
- - -
- - - \ No newline at end of file diff --git a/views/404.jade b/views/404.jade new file mode 100644 index 0000000..638df51 --- /dev/null +++ b/views/404.jade @@ -0,0 +1,12 @@ +extends interior-page-layout + +block pagetitle + | 404: Page not found + +block interiorcontent + p + | Sorry! The page you were looking for could not be found. If you think + | the page should have been found, let us know. Use the question mark bubble + | in the bottom right of the screen to send us a bug report. + + p Thanks! diff --git a/views/500.ejs b/views/500.ejs deleted file mode 100644 index c22a144..0000000 --- a/views/500.ejs +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Server Error - - - - -
-
-
- - -
-
-
-

- Internal Server Error -

-

- Something isn't right here. -

- <% if (typeof errors !== 'undefined') { %> -

-        <%
-          _.each(errors, function (error) { %>
-          <%= error %>
-          <%
-          }); %>
-        
- <% } else { %> - -

- A team of highly trained sea bass is working on this as we speak.
- If the problem persists, please contact the system administrator and inform them of the time that the error occured, and anything you might have done that may have caused the error. -

- <% } %> - -
- - -
- - \ No newline at end of file diff --git a/views/500.jade b/views/500.jade new file mode 100644 index 0000000..8a6b1af --- /dev/null +++ b/views/500.jade @@ -0,0 +1,16 @@ +extends interior-page-layout + +block pagetitle + | 500: Error + +block interiorcontent + p + | So sorry! Whatever you were trying to do has caused + | some type of unknown error. Yikes! + + p + | Please let us know about the problem by reporting it + | with the little question mark bubble in the bottom + | right of the screen. + + p Thanks!