Permalink
Browse files

Implement 404 page. [issue #40]

  • Loading branch information...
1 parent 9d7fc6d commit 86d585d751bca44e1154579650cd260c72f83c7c @brianloveswords brianloveswords committed Nov 11, 2012
Showing with 36 additions and 0 deletions.
  1. +4 −0 app.js
  2. +4 −0 routes/admin.js
  3. +28 −0 views/public/404.html
View
4 app.js
@@ -48,6 +48,8 @@ app.configure(function () {
}));
app.use(issuer.getIssuerConfig());
app.use(app.router);
+ // if we've fallen through the router, it's a 404
+ app.use(admin.notFound);
});
app.configure('development', function () {
@@ -131,6 +133,8 @@ app.post('/claim/confirm',[
badge.findByClaimCode()
], badge.awardToUser);
+app.get('/404', admin.notFound);
+
// User login/logout
// -------------------
app.get('/login', admin.login);
View
@@ -139,3 +139,7 @@ exports.userList = function userList(req, res, next) {
users: req.users
});
};
+
+exports.notFound = function notFound(req, res, next) {
+ return res.render('public/404.html', {});
+};
View
@@ -0,0 +1,28 @@
+{% extends "public/layout.html" %}
+{% block head %}
+ <link rel="stylesheet" href="/stylesheets/criteria.css">
+{% endblock %}
+{% block body %}
+ <div class="row">
+ <div class="span7">
+ <h2>Mozilla Webmaker Badges</h2>
+ </div>
+ </div>
+ <div class="media card">
+ <!-- <img class="img badge" src=""> -->
+ <div class="bd">
+ <hgroup>
+ <h1>Not Found</h1>
+ </hgroup>
+ <p>Sorry, we couldn't find the page you were looking for.<p>
+ <p>
+ If you are looking to claim a badge, <a href="/claim">head over
+ to the claim page</a>
+ <p>
+ <p>
+ If you want to see the list of availible badges, try going to
+ the <a href="/">badge listing</a>
+ <p>
+ </div>
+ </div>
+{% endblock %}

0 comments on commit 86d585d

Please sign in to comment.