Skip to content

Commit

Permalink
✨ : add error layout
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Apr 9, 2020
1 parent c6f151b commit 93ffff5
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 41 deletions.
13 changes: 13 additions & 0 deletions src/main/client/app/layouts/error-layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class="full_container">
<div class="center vertical_center full_height">
<slot />
</div>
</div>
</template>

<script>
export default {
name: 'AppErrorLayout',
};
</script>
1 change: 1 addition & 0 deletions src/main/client/app/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as AppErrorLayout } from './error-layout.vue';
export { default as AppNoneLayout } from './none-layout.vue';
6 changes: 5 additions & 1 deletion src/main/client/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { Multiselect } from 'vue-multiselect';
import fontawesomeConfig from '@/shared/config/fontawesome-config';
import bootstrapVueConfig from '@/shared/config/bootstrap-vue-config';

import { AppNoneLayout } from '@/layouts';
import {
AppErrorLayout,
AppNoneLayout,
} from '@/layouts';
import App from '@/app.vue';
import router from '@/router';
import store from '@/shared/store';
Expand All @@ -14,6 +17,7 @@ bootstrapVueConfig.init();
Vue.use(Multiselect);

// layout definitions
Vue.component('app-error-layout', AppErrorLayout);
Vue.component('app-none-layout', AppNoneLayout);

Vue.config.productionTip = false;
Expand Down
2 changes: 2 additions & 0 deletions src/main/client/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ const appRoutes = [
path: '/not-found',
name: 'page-not-found',
component: AppPageNotFound,
meta: { layout: 'error' },
},
{
path: '/forbidden',
name: 'page-forbidden',
component: AppPageForbidden,
meta: { layout: 'error' },
},
];

Expand Down
38 changes: 18 additions & 20 deletions src/main/client/app/shared/components/page-forbidden.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<template>
<div class="center vertical_center full_height">
<div class="error_page">
<div class="center">
<img
alt="#"
class="img-responsive"
src="@/assets/images/no-entry.png"
>
</div>
<br>
<h3>STOP HERE !</h3>
<p>YOU'RE NOT ALLOWED TO SEE THIS PAGE !</p>
<div class="center">
<router-link
class="btn btn-success"
to="/"
>
Go To Home Page
</router-link>
</div>
<div class="error_page">
<div class="center">
<img
alt="#"
class="img-responsive"
src="@/assets/images/no-entry.png"
>
</div>
<br>
<h3>STOP HERE !</h3>
<p>YOU'RE NOT ALLOWED TO SEE THIS PAGE !</p>
<div class="center">
<router-link
class="btn btn-success"
to="/"
>
Go To Home Page
</router-link>
</div>
</div>
</template>
Expand Down
38 changes: 18 additions & 20 deletions src/main/client/app/shared/components/page-not-found.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<template>
<div class="center vertical_center full_height">
<div class="error_page">
<div class="center">
<img
alt="#"
class="img-responsive"
src="@/assets/images/crying-face.png"
>
</div>
<br>
<h3>PAGE NOT FOUND !</h3>
<p>YOU SEEM TO BE TRYING TO FIND YOUR WAY HOME</p>
<div class="center">
<router-link
class="btn btn-success"
to="/"
>
Go To Home Page
</router-link>
</div>
<div class="error_page">
<div class="center">
<img
alt="#"
class="img-responsive"
src="@/assets/images/crying-face.png"
>
</div>
<br>
<h3>PAGE NOT FOUND !</h3>
<p>YOU SEEM TO BE TRYING TO FIND YOUR WAY HOME</p>
<div class="center">
<router-link
class="btn btn-success"
to="/"
>
Go To Home Page
</router-link>
</div>
</div>
</template>
Expand Down

0 comments on commit 93ffff5

Please sign in to comment.