File tree Expand file tree Collapse file tree 6 files changed +50
-0
lines changed Expand file tree Collapse file tree 6 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ AppRouter.map(function () {
89
89
this . route ( 'module' , { path : '/modules/:module' } ) ;
90
90
this . route ( 'data-class' , { path : '/data/classes/:class' } ) ;
91
91
this . route ( 'data-module' , { path : '/data/modules/:module' } ) ;
92
+ this . route ( 'not-found' , { path : '/*' } ) ;
92
93
} ) ;
93
94
94
95
/*
Original file line number Diff line number Diff line change
1
+ import Route from '@ember/routing/route' ;
2
+ import { inject as service } from '@ember/service' ;
3
+
4
+ export default class NotFoundRoute extends Route {
5
+ @service fastboot ;
6
+
7
+ beforeModel ( ) {
8
+ if ( ! this . fastboot . isFastBoot ) {
9
+ return ;
10
+ }
11
+
12
+ this . fastboot . response . statusCode = 404 ;
13
+ }
14
+ }
Original file line number Diff line number Diff line change 1
1
.whoops {
2
2
width : 100% ;
3
+ display : flex ;
4
+ flex-direction : column ;
5
+ justify-content : center ;
6
+ margin-left : 20% ;
7
+
8
+ @media (max-width : $mobile-portrait-screen ){
9
+ margin-left : 15px ;
10
+ }
11
+
12
+ img {
13
+ width : 40% ;
14
+ @media (max-width : $mobile-portrait-screen ){
15
+ width : 80% ;
16
+ }
17
+ }
3
18
4
19
& __title {
5
20
text-transform : uppercase ;
Original file line number Diff line number Diff line change
1
+ {{ page-title " Page Not Found" }}
2
+
3
+ <div class =" whoops" >
4
+ <img src =" /assets/images/stinky-fish.png" alt =" tomster stinky fish" />
5
+ <h2 class =" whoops__title" >Ack! 404 friend, you're in the wrong place</h2 >
6
+ <span >
7
+ <LinkTo @route =' index' class =" whoops__message" >Click here to go home</LinkTo >
8
+ </span >
9
+ </div >
Original file line number Diff line number Diff line change
1
+ import { module , test } from 'qunit' ;
2
+ import { setupTest } from 'ember-qunit' ;
3
+
4
+ module ( 'Unit | Route | not-found' , function ( hooks ) {
5
+ setupTest ( hooks ) ;
6
+
7
+ test ( 'it exists' , function ( assert ) {
8
+ let route = this . owner . lookup ( 'route:not-found' ) ;
9
+ assert . ok ( route ) ;
10
+ } ) ;
11
+ } ) ;
You can’t perform that action at this time.
0 commit comments