client/general: add 404 page

Reuses old 404 image from 1.x branch, may be subject to change.
This commit is contained in:
rr- 2016-05-21 11:48:23 +02:00
parent 6beffc2ec1
commit e7fe7d3899
6 changed files with 8460 additions and 0 deletions

View File

@ -182,3 +182,4 @@ if (!process.argv.includes('--no-js')) {
bundleJs(config);
}
copyFile('./img/favicon.png', './public/favicon.png');
copyFile('./img/404.png', './public/404.png');

View File

@ -0,0 +1,5 @@
<div class='not-found'>
<img src='/404.png' alt='404 Not found'/>
<p><%= window.location.pathname %> is not a valid URL.</p>
<p><a href='/'>Back to main page</a></p>
</div>

8433
client/img/404.ai Normal file

File diff suppressed because one or more lines are too long

BIN
client/img/404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -3,10 +3,12 @@
const page = require('page');
const topNavController = require('../controllers/top_nav_controller.js');
const HomeView = require('../views/home_view.js');
const NotFoundView = require('../views/not_found_view.js');
class HomeController {
constructor() {
this._homeView = new HomeView();
this._notFoundView = new NotFoundView();
}
registerRoutes() {
@ -21,6 +23,7 @@ class HomeController {
_notFoundRoute() {
topNavController.activate('');
this._notFoundView.render({});
}
}

View File

@ -0,0 +1,18 @@
'use strict';
const config = require('../config.js');
const views = require('../util/views.js');
class NotFoundView {
constructor() {
this._template = views.getTemplate('not-found');
}
render(ctx) {
const target = document.getElementById('content-holder');
const source = this._template({});
views.showView(target, source);
}
}
module.exports = NotFoundView;