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
6 changed files with 8460 additions and 0 deletions
|
@ -182,3 +182,4 @@ if (!process.argv.includes('--no-js')) {
|
||||||
bundleJs(config);
|
bundleJs(config);
|
||||||
}
|
}
|
||||||
copyFile('./img/favicon.png', './public/favicon.png');
|
copyFile('./img/favicon.png', './public/favicon.png');
|
||||||
|
copyFile('./img/404.png', './public/404.png');
|
||||||
|
|
5
client/html/not_found.tpl
Normal file
5
client/html/not_found.tpl
Normal 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
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
BIN
client/img/404.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
|
@ -3,10 +3,12 @@
|
||||||
const page = require('page');
|
const page = require('page');
|
||||||
const topNavController = require('../controllers/top_nav_controller.js');
|
const topNavController = require('../controllers/top_nav_controller.js');
|
||||||
const HomeView = require('../views/home_view.js');
|
const HomeView = require('../views/home_view.js');
|
||||||
|
const NotFoundView = require('../views/not_found_view.js');
|
||||||
|
|
||||||
class HomeController {
|
class HomeController {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._homeView = new HomeView();
|
this._homeView = new HomeView();
|
||||||
|
this._notFoundView = new NotFoundView();
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRoutes() {
|
registerRoutes() {
|
||||||
|
@ -21,6 +23,7 @@ class HomeController {
|
||||||
|
|
||||||
_notFoundRoute() {
|
_notFoundRoute() {
|
||||||
topNavController.activate('');
|
topNavController.activate('');
|
||||||
|
this._notFoundView.render({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
client/js/views/not_found_view.js
Normal file
18
client/js/views/not_found_view.js
Normal 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;
|
Loading…
Reference in a new issue