diff --git a/app/router.js b/app/router.js index a3e7db362..784d6101d 100644 --- a/app/router.js +++ b/app/router.js @@ -89,6 +89,7 @@ AppRouter.map(function () { this.route('module', { path: '/modules/:module' }); this.route('data-class', { path: '/data/classes/:class' }); this.route('data-module', { path: '/data/modules/:module' }); + this.route('not-found', { path: '/*' }); }); /* diff --git a/app/routes/not-found.js b/app/routes/not-found.js new file mode 100644 index 000000000..969fad2bb --- /dev/null +++ b/app/routes/not-found.js @@ -0,0 +1,14 @@ +import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; + +export default class NotFoundRoute extends Route { + @service fastboot; + + beforeModel() { + if (!this.fastboot.isFastBoot) { + return; + } + + this.fastboot.response.statusCode = 404; + } +} diff --git a/app/styles/components/_whoops.scss b/app/styles/components/_whoops.scss index a7131c94b..87849e607 100644 --- a/app/styles/components/_whoops.scss +++ b/app/styles/components/_whoops.scss @@ -1,5 +1,20 @@ .whoops { width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + margin-left: 20%; + + @media (max-width: $mobile-portrait-screen){ + margin-left: 15px; + } + + img { + width: 40%; + @media (max-width: $mobile-portrait-screen){ + width: 80%; + } + } &__title { text-transform: uppercase; diff --git a/app/templates/not-found.hbs b/app/templates/not-found.hbs new file mode 100644 index 000000000..b530d1c47 --- /dev/null +++ b/app/templates/not-found.hbs @@ -0,0 +1,9 @@ +{{page-title "Page Not Found"}} + +
+ tomster stinky fish +

Ack! 404 friend, you're in the wrong place

+ + Click here to go home + +
\ No newline at end of file diff --git a/public/assets/images/stinky-fish.png b/public/assets/images/stinky-fish.png new file mode 100644 index 000000000..4103b1525 Binary files /dev/null and b/public/assets/images/stinky-fish.png differ diff --git a/tests/unit/routes/not-found-test.js b/tests/unit/routes/not-found-test.js new file mode 100644 index 000000000..1dec2b479 --- /dev/null +++ b/tests/unit/routes/not-found-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Route | not-found', function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup('route:not-found'); + assert.ok(route); + }); +});