diff --git a/app/router.js b/app/router.js index 2d1a97b70a2616ce758c964e88dfadbfcfd725a3..b5ef63529b973fbce2fb6753e2a98efbd22bd295 100644 --- a/app/router.js +++ b/app/router.js @@ -12,6 +12,8 @@ Router.map(function() { this.route('details', {path: '/:entityType/:entityId'}); // use model properties for automatic matching }); }); + + this.route('not-found', { path: '*path' }); }); export default Router; diff --git a/app/routes/not-found.js b/app/routes/not-found.js new file mode 100644 index 0000000000000000000000000000000000000000..985ada35a15e21a47a354ca67bf4f6d6a1023a96 --- /dev/null +++ b/app/routes/not-found.js @@ -0,0 +1,9 @@ +import Ember from 'ember'; +export default Ember.Route.extend({ + redirect: function () { + var url = this.router.location.formatURL('/not-found'); + if (window.location.pathname !== url) { + this.replaceWith('/not-found'); + } + } +}); \ No newline at end of file diff --git a/app/templates/deployments/index.hbs b/app/templates/deployments/index.hbs index 9cfa810146a0c5648d34fbc866e2fefd590b8e20..2274e31c5dde286ff34838ff1e8000eeb3e8affd 100644 --- a/app/templates/deployments/index.hbs +++ b/app/templates/deployments/index.hbs @@ -1,9 +1,10 @@ -{{model.length}} - -<ul> -{{#each model as |system| }} - <li>{{#link-to 'deployments.single' system.id}}{{system.name}}{{/link-to}}</li> -{{/each}} -</ul> +<div class="container"> + <h3>Available Deployments</h3> + <ul> + {{#each model as |system| }} + <li>{{#link-to 'deployments.single' system.id}}{{system.name}}{{/link-to}}</li> + {{/each}} + </ul> +</div> {{outlet}} \ No newline at end of file diff --git a/app/templates/home.hbs b/app/templates/home.hbs new file mode 100644 index 0000000000000000000000000000000000000000..3c350cfb7650dc00d66199de01d7de0b5d30fa5e --- /dev/null +++ b/app/templates/home.hbs @@ -0,0 +1,3 @@ +<div class="container"> + This app currently only supports {{link-to 'deployments' 'deployments'}}. +</div> \ No newline at end of file diff --git a/app/templates/not-found.hbs b/app/templates/not-found.hbs new file mode 100644 index 0000000000000000000000000000000000000000..bc1cff206cf2b3668fd1e6bbf852ca4a77aef0ed --- /dev/null +++ b/app/templates/not-found.hbs @@ -0,0 +1,6 @@ +<div class="container"> + <h1>404 Not Found</h1> + <p> + This url does not exist. Maybe a link has changed, try the {{link-to 'home page' 'home'}} + </p> +</div> \ No newline at end of file