client/general: show correct URL in 404 page
This commit is contained in:
parent
e7fe7d3899
commit
df5d72d429
|
@ -1,5 +1,5 @@
|
||||||
<div class='not-found'>
|
<div class='not-found'>
|
||||||
<img src='/404.png' alt='404 Not found'/>
|
<img src='/404.png' alt='404 Not found'/>
|
||||||
<p><%= window.location.pathname %> is not a valid URL.</p>
|
<p><%= ctx.path %> is not a valid URL.</p>
|
||||||
<p><a href='/'>Back to main page</a></p>
|
<p><a href='/'>Back to main page</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,7 @@ class HomeController {
|
||||||
|
|
||||||
registerRoutes() {
|
registerRoutes() {
|
||||||
page('/', (ctx, next) => { this._indexRoute(); });
|
page('/', (ctx, next) => { this._indexRoute(); });
|
||||||
page('*', (ctx, next) => { this._notFoundRoute(); });
|
page('*', (ctx, next) => { this._notFoundRoute(ctx); });
|
||||||
}
|
}
|
||||||
|
|
||||||
_indexRoute() {
|
_indexRoute() {
|
||||||
|
@ -21,9 +21,9 @@ class HomeController {
|
||||||
this._homeView.render({});
|
this._homeView.render({});
|
||||||
}
|
}
|
||||||
|
|
||||||
_notFoundRoute() {
|
_notFoundRoute(ctx) {
|
||||||
topNavController.activate('');
|
topNavController.activate('');
|
||||||
this._notFoundView.render({});
|
this._notFoundView.render({path: ctx.canonicalPath});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ class NotFoundView {
|
||||||
|
|
||||||
render(ctx) {
|
render(ctx) {
|
||||||
const target = document.getElementById('content-holder');
|
const target = document.getElementById('content-holder');
|
||||||
const source = this._template({});
|
const source = this._template(ctx);
|
||||||
views.showView(target, source);
|
views.showView(target, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue