2020-12-24 16:37:38 -09:00
|
|
|
<template>
|
|
|
|
<div class="text-center">
|
|
|
|
<v-btn icon @click="showLogin = true">
|
|
|
|
<v-icon>mdi-account</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
<v-dialog v-model="showLogin" width="500">
|
|
|
|
<v-flex class="login-form text-xs-center">
|
|
|
|
<v-card>
|
|
|
|
<v-card-text>
|
|
|
|
<v-form>
|
|
|
|
<v-text-field
|
|
|
|
v-if="!options.isLoggingIn"
|
|
|
|
v-model="user.name"
|
|
|
|
light="light"
|
|
|
|
prepend-icon="person"
|
2021-01-17 22:22:54 -09:00
|
|
|
:label="$t('general.name')"
|
2020-12-24 16:37:38 -09:00
|
|
|
></v-text-field>
|
|
|
|
<v-text-field
|
|
|
|
v-model="user.email"
|
|
|
|
light="light"
|
|
|
|
prepend-icon="mdi-email"
|
2021-01-17 22:22:54 -09:00
|
|
|
:label="$t('login.email')"
|
2020-12-24 16:37:38 -09:00
|
|
|
type="email"
|
|
|
|
></v-text-field>
|
|
|
|
<v-text-field
|
|
|
|
v-model="user.password"
|
|
|
|
light="light"
|
|
|
|
prepend-icon="mdi-lock"
|
2021-01-17 22:22:54 -09:00
|
|
|
:label="$t('login.password')"
|
2020-12-24 16:37:38 -09:00
|
|
|
type="password"
|
|
|
|
></v-text-field>
|
|
|
|
<v-checkbox
|
|
|
|
class="mb-2 mt-0"
|
|
|
|
v-if="options.isLoggingIn"
|
|
|
|
v-model="options.shouldStayLoggedIn"
|
|
|
|
light="light"
|
2021-01-17 22:22:54 -09:00
|
|
|
:label="$t('login.stay-logged-in')"
|
2020-12-24 16:37:38 -09:00
|
|
|
hide-details="hide-details"
|
|
|
|
></v-checkbox>
|
|
|
|
<v-btn
|
|
|
|
v-if="options.isLoggingIn"
|
|
|
|
@click.prevent="login"
|
|
|
|
dark
|
|
|
|
color="primary"
|
|
|
|
block="block"
|
|
|
|
type="submit"
|
2021-02-10 19:39:46 -09:00
|
|
|
>{{$t('login.sign-in')}}</v-btn
|
2020-12-24 16:37:38 -09:00
|
|
|
>
|
|
|
|
<v-btn
|
|
|
|
v-else
|
|
|
|
block="block"
|
|
|
|
type="submit"
|
|
|
|
@click.prevent="options.isLoggingIn = true"
|
2021-02-10 19:39:46 -09:00
|
|
|
>{{$t('login.sign-up')}}</v-btn
|
2020-12-24 16:37:38 -09:00
|
|
|
>
|
|
|
|
</v-form>
|
|
|
|
</v-card-text>
|
|
|
|
<!-- <v-card-actions v-if="options.isLoggingIn" class="card-actions">
|
|
|
|
Don't have an account?
|
|
|
|
<v-btn
|
|
|
|
color="primary"
|
|
|
|
light="light"
|
|
|
|
@click="options.isLoggingIn = false"
|
|
|
|
>
|
|
|
|
Sign up
|
|
|
|
</v-btn>
|
|
|
|
</v-card-actions> -->
|
|
|
|
</v-card>
|
|
|
|
</v-flex>
|
|
|
|
</v-dialog>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-02-10 19:39:46 -09:00
|
|
|
import api from "../../api";
|
2020-12-24 16:37:38 -09:00
|
|
|
export default {
|
|
|
|
props: {},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showLogin: false,
|
|
|
|
user: {
|
|
|
|
email: "",
|
|
|
|
password: "",
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
isLoggingIn: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async login() {
|
|
|
|
let key = await api.login(this.user.email, this.user.password);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|