Commit 707aa1ff authored by Zohten's avatar Zohten
parents 8b249049 e07ff1bf
...@@ -30,6 +30,7 @@ export default { ...@@ -30,6 +30,7 @@ export default {
}, },
methods: { methods: {
logout: function() { logout: function() {
localStorage.removeItem('user');
this.$router.push('/') this.$router.push('/')
} }
} }
......
<template>
<div class="form-check row">
<label class="col-md-4 col-form-label text-md-right" :for="this.id">{{label}}</label>
<input class="form-check-input" type="checkbox" :id="this.id" :name="this.id">
</div>
</template>
<script>
export default {
props: {
id: { type: String, default: ''},
label: { type: String, default: 'label' }
}
}
</script>
<style>
.row {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.form-check-input {
height: 1.5em;
width: 1.5em;
}
.form-check {
position: relative;
display: block;
padding-left: 1.25rem;
}
.col-md-4 {
flex: 0 0 33.3333333333%;
max-width: 33.3333333333%;
}
.text-md-right {
text-align: right !important;
}
.col-form-label {
padding-top: calc(0.375rem + 1px);
padding-bottom: calc(0.375rem + 1px);
margin-bottom: 0;
line-height: 1.6;
font-style: normal;
font-weight: bold;
font-size: 24px;
line-height: 42px;
color: #000000;
}
.col-md-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-md-4, .col-md-6{
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.form-control {
display: block;
width: 100%;
padding: 0.375rem 0.75rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.6;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
</style>
\ No newline at end of file
...@@ -22,8 +22,6 @@ export default { ...@@ -22,8 +22,6 @@ export default {
.row { .row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
} }
.col-md-4 { .col-md-4 {
flex: 0 0 33.3333333333%; flex: 0 0 33.3333333333%;
......
...@@ -31,6 +31,11 @@ const routes = [ ...@@ -31,6 +31,11 @@ const routes = [
path: '/login', path: '/login',
name: 'Login', name: 'Login',
component: () => import('../views/Login.vue') component: () => import('../views/Login.vue')
},
{
path: '/profile',
name: 'Profile',
component: () => import('../views/Profile.vue')
} }
] ]
......
...@@ -18,6 +18,11 @@ export default { ...@@ -18,6 +18,11 @@ export default {
PageTitle, PageTitle,
ButtonText ButtonText
}, },
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
},
methods: { methods: {
onSubmit: function(){ onSubmit: function(){
if (event.submitter.id=='login') { if (event.submitter.id=='login') {
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
<div class="form-content"> <div class="form-content">
<text-input id="login" label="Pseudo"/> <text-input id="login" label="Pseudo"/>
<pwd-input id="password" label="Mot de passe"/> <pwd-input id="password" label="Mot de passe"/>
<checkbox-input id="remember" label="Se souvenir de moi"/>
</div> </div>
<svg-button id="back" svg="/icons/back.svg"/> <svg-button id="back" svg="/icons/back.svg"/>
...@@ -21,15 +19,18 @@ import PageTitle from '@/components/PageTitle.vue' ...@@ -21,15 +19,18 @@ import PageTitle from '@/components/PageTitle.vue'
import SvgButton from '@/components/SvgButton.vue' import SvgButton from '@/components/SvgButton.vue'
import TextInput from '@/components/form/TextInput.vue' import TextInput from '@/components/form/TextInput.vue'
import PwdInput from '@/components/form/PwdInput.vue' import PwdInput from '@/components/form/PwdInput.vue'
import CheckboxInput from '@/components/form/CheckboxInput.vue'
export default { export default {
name: 'Login', name: 'Login',
components: { components: {
PageTitle, PageTitle,
SvgButton, SvgButton,
TextInput, TextInput,
PwdInput, PwdInput
CheckboxInput },
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
}, },
data() { data() {
return { return {
......
...@@ -43,6 +43,11 @@ export default { ...@@ -43,6 +43,11 @@ export default {
showNotFilledError : false, showNotFilledError : false,
} }
}, },
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
},
methods: { methods: {
onSubmit: async function(){ onSubmit: async function(){
// If we press back, we go back // If we press back, we go back
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment