client/general: show correct URL in 404 page
This commit is contained in:
parent
e7fe7d3899
commit
df5d72d429
3 changed files with 5 additions and 5 deletions
|
@ -1,5 +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><%= ctx.path %> is not a valid URL.</p>
|
||||
<p><a href='/'>Back to main page</a></p>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@ class HomeController {
|
|||
|
||||
registerRoutes() {
|
||||
page('/', (ctx, next) => { this._indexRoute(); });
|
||||
page('*', (ctx, next) => { this._notFoundRoute(); });
|
||||
page('*', (ctx, next) => { this._notFoundRoute(ctx); });
|
||||
}
|
||||
|
||||
_indexRoute() {
|
||||
|
@ -21,9 +21,9 @@ class HomeController {
|
|||
this._homeView.render({});
|
||||
}
|
||||
|
||||
_notFoundRoute() {
|
||||
_notFoundRoute(ctx) {
|
||||
topNavController.activate('');
|
||||
this._notFoundView.render({});
|
||||
this._notFoundView.render({path: ctx.canonicalPath});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class NotFoundView {
|
|||
|
||||
render(ctx) {
|
||||
const target = document.getElementById('content-holder');
|
||||
const source = this._template({});
|
||||
const source = this._template(ctx);
|
||||
views.showView(target, source);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue