Skip to content

Commit

Permalink
Change Error Page Look + Cover All Error Cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Silfer committed Apr 4, 2017
1 parent f93b9e5 commit 07c2816
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Binary file added public/images/errorButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion source/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ router.get ('/login', auth.ensureAuth, login.get);
router.get ('/login/callback', login.callback);

router.get ('/dashboard', auth.ensureAuth, dashboard.get);
router.get ('/error', error.get);
router.get ('/error',
function (req, res, next)
{
var errorMessage = "You Cannot Just Access the Error Page Manually!";

res.render('error.ejs', {
errorMessage: errorMessage
});
}
);

router.post('/api/dashboard/forceSyncIVLE', auth.ensureAuth, dashboard.forceSyncIVLE);
router.post('/api/dashboard/getTutorials', auth.ensureAuth, dashboard.getTutorials);
Expand Down
18 changes: 13 additions & 5 deletions source/view/error.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@
<li></li>
</ul>

<h1><a class="active" href="/">Error! Click here to return!</a></h1>

<% if(errorMessage){ %>
<h1>Error Message</h1>
<h1>Error!</h1>
<h2><%=errorMessage%></h2>
<% } %>

<a href="/">
<div class="errorButton"><img src="images/errorButton.png"></div>
</a>

</body>
</html>

<script>
var errorMessage = "";
</script>

<style>
Expand All @@ -42,7 +45,7 @@
font-size: 5vw;
color: #FFFFFF;
margin: 0;
padding: 0;
padding: 2%;
text-align: center;
margin-top: 20vh;
}
Expand Down Expand Up @@ -80,5 +83,10 @@
background-color: #B7B7B6;
}
.errorButton {
text-align: center;
margin-top: 12%;
background-color: transparent;
outline: none;
}
</style>

0 comments on commit 07c2816

Please sign in to comment.