client/general: add 404 page
Reuses old 404 image from 1.x branch, may be subject to change.
This commit is contained in:
parent
6beffc2ec1
commit
e7fe7d3899
|
@ -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');
|
||||
|
|
|
@ -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>
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
|
@ -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({});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue