client/general: show correct URL in 404 page

This commit is contained in:
rr- 2016-05-21 12:03:31 +02:00
parent e7fe7d3899
commit df5d72d429
3 changed files with 5 additions and 5 deletions

View file

@ -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>

View file

@ -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});
}
}

View file

@ -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);
}
}