Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update login page #296

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified client/src/assets/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 94 additions & 70 deletions client/src/views/LoginView.vue
Original file line number Diff line number Diff line change
@@ -1,76 +1,105 @@
<template>
<v-row no-gutters class="fill-height" align="center" justify="center">
<v-col cols="7">
<v-card
class="fill-hight pa-16"
:image="background"
height="100vh"
title="CSHR (Codescalers HR Management System)"
subtitle="A versatile management system with vacation request submissions and seamless integration with a global calendar. Users across offices can collectively view approved vacations, Birthdates, Events, Meetings, and Holidays, providing a centralized overview for the entire organization."
></v-card>
</v-col>
<v-col cols="5">
<v-form ref="form" @submit.prevent="login(email, password)">
<v-img :src="logo" max-width="200" class="mx-auto justify-center"></v-img>
<h1 class="text-center my-5">Sign In</h1>
<v-row class="justify-center align-center">
<v-col cols="7">
<v-text-field v-model="email" label="Email" :rules="emailRules"></v-text-field>
</v-col>
<v-container fluid class="pa-0">
<v-row align="center" justify="center">
<v-col cols="12" md="7">
<v-card height="100vh" style="background-color: black;">
<v-img :src="background" height="65%" cover />
<div class="pa-2 pa-md-10 mx-auto">
<v-card-title class="text-h6 text-md-h5 font-weight-bold">
CSHR (Codescalers HR Management System)
</v-card-title>

<v-col cols="7">
<v-text-field
v-model="password"
:append-inner-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
:rules="passwordRules"
:type="show ? 'text' : 'password'"
label="Password"
@click:append-inner="show = !show"
></v-text-field>
</v-col>
<v-card-text>
A versatile management system with vacation request submissions
and seamless integration with a global calendar. Users across
offices can collectively view approved vacations, Birthdates,
samaradel marked this conversation as resolved.
Show resolved Hide resolved
Events, Meetings, and Holidays, providing a centralized overview
for the entire organization.
</v-card-text>
<v-card-subtitle class="text-white">
Powered by CodeScalers Egypt.
</v-card-subtitle>
</div>
</v-card>
</v-col>
<v-col cols="12" md="5">
<v-form ref="form" @submit.prevent="login(email, password)">
<v-img
:src="logo"
max-width="140"
class="mx-auto justify-center"
></v-img>
<h2 class="text-center my-5">Sign In</h2>
<v-row class="justify-center align-center">
<v-col cols="7">
<v-text-field
v-model="email"
label="Email"
:rules="emailRules"
></v-text-field>
</v-col>

<v-col cols="7" class="d-flex justify-content-between align-center pa-0">
<v-checkbox v-model="rememberMe" label="Remember me"></v-checkbox>
<!-- <v-btn color="primary" class="mb-6" variant='plain' style="text-transform: none !important;">Forgot password?</v-btn> -->
</v-col>
<v-col cols="7">
<v-text-field
v-model="password"
:append-inner-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
:rules="passwordRules"
:type="show ? 'text' : 'password'"
label="Password"
@click:append-inner="show = !show"
></v-text-field>
</v-col>

<v-col cols="7">
<v-btn color="primary" type="submit" :disabled="!form?.isValid" width="100%">
Login
</v-btn>
</v-col>
</v-row>
</v-form>
</v-col>
</v-row>
<v-col
cols="7"
class="d-flex justify-content-between align-center pa-0"
>
<v-checkbox v-model="rememberMe" label="Remember me"></v-checkbox>
<!-- <v-btn color="primary" class="mb-6" variant='plain' style="text-transform: none !important;">Forgot password?</v-btn> -->
</v-col>

<v-col cols="7">
<v-btn
color="primary"
type="submit"
:disabled="!form?.isValid"
width="100%"
>
Login
</v-btn>
</v-col>
</v-row>
</v-form>
</v-col>
</v-row>
</v-container>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import background from '@/assets/login.png'
import logo from '@/assets/cshr_logo.png'
import { $api } from '@/clients'
import { emailRules, passwordRules } from '@/utils'
import { useRouter } from 'vue-router'
import { defineComponent, ref } from "vue";
import background from "@/assets/login.png";
import logo from "@/assets/cshr_logo.png";
import { $api } from "@/clients";
import { emailRules, passwordRules } from "@/utils";
import { useRouter } from "vue-router";

export default defineComponent({
setup() {
const form = ref()
const email = ref<string>('')
const password = ref<string>('')
const show = ref<boolean>(false)
const rememberMe = ref<boolean>(false)
const $router = useRouter()

const form = ref();
const email = ref<string>("");
const password = ref<string>("");
const show = ref<boolean>(false);
const rememberMe = ref<boolean>(false);
const $router = useRouter();
async function login(email: string, password: string) {
await $api.auth.login(
{
email,
password
password,
},
rememberMe.value
)
$router.push('/')
);
$router.push("/");
}

return {
Expand All @@ -83,22 +112,17 @@ export default defineComponent({
emailRules,
passwordRules,
background,
logo
}
}
})
logo,
};
},
});
</script>
<style scoped>
:deep(.v-card-title) {
margin-top: 20% !important;
font-weight: bold !important;
font-size: 1.5rem !important;
white-space: unset;
}

:deep(.v-card-subtitle) {
margin-top: 1rem !important;
font-size: 1rem !important;
white-space: inherit !important;
opacity: 1 !important;
:deep(.v-card-text) {
font-size: 1.125rem;
line-height: 1.75rem;
}
</style>
Loading