first commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
const { __ } = useTranslations();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="__('Waiting Approval')" :heading="__('Waiting Approval')">
|
||||
<div class="mx-auto max-w-2xl">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mb-4 text-lg font-medium">{{ __('Waiting Approval') }}</h5>
|
||||
|
||||
<p class="text-slate-600">
|
||||
{{ __('Your account is waiting approval from administrators.') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import Button from '@/components/ui/Button.vue';
|
||||
import Input from '@/components/ui/Input.vue';
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
|
||||
const { __ } = useTranslations();
|
||||
|
||||
const form = useForm({ email: '' });
|
||||
|
||||
function submit() {
|
||||
form.post(route('password.email'));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Reset Password')">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mt-2 mb-2 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</h5>
|
||||
|
||||
<form class="space-y-4 p-2" autocomplete="off" @submit.prevent="submit">
|
||||
<p class="mb-4 text-center font-light text-slate-500">
|
||||
{{ __('Please provide your email below and we will send you a password reset link.') }}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label for="email" class="sr-only">{{ __('Email') }}</label>
|
||||
<Input
|
||||
id="email"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
class="w-full"
|
||||
:placeholder="__('Your E-Mail')"
|
||||
:invalid="Boolean(form.errors.email)"
|
||||
autocomplete="email"
|
||||
/>
|
||||
<small v-if="form.errors.email" class="text-red-600">{{ form.errors.email }}</small>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Reset Password')"
|
||||
class="w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,144 @@
|
||||
<script setup lang="ts">
|
||||
import { Link, useForm } from "@inertiajs/vue3";
|
||||
import Button from "@/components/ui/Button.vue";
|
||||
import Checkbox from "@/components/ui/Checkbox.vue";
|
||||
import Input from "@/components/ui/Input.vue";
|
||||
import Message from "@/components/ui/Message.vue";
|
||||
import PasswordInput from "@/components/ui/PasswordInput.vue";
|
||||
import SocialButtons from "@/components/SocialButtons.vue";
|
||||
import { useSettings, useTranslations } from "@/composables/useVanguard";
|
||||
import AuthLayout from "@/layouts/AuthLayout.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
socialProviders: string[] | null;
|
||||
to?: string | null;
|
||||
}>();
|
||||
|
||||
const { __ } = useTranslations();
|
||||
const { setting } = useSettings();
|
||||
|
||||
const form = useForm({
|
||||
username: "",
|
||||
password: "",
|
||||
remember: false,
|
||||
to: props.to ?? null,
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post("/login", {
|
||||
onFinish: () => form.reset("password"),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Login')">
|
||||
<!-- Logo + Titolo principale (stile vecchia Blade) -->
|
||||
<div class="text-center mb-6">
|
||||
<img
|
||||
src="/assets/img/cimac-logo.png"
|
||||
:alt="setting('app_name')"
|
||||
class="mx-auto h-12"
|
||||
/>
|
||||
<h3 class="mt-4 text-xl font-semibold tracking-wide text-slate-800">
|
||||
CIMAC APPLICATION FORM
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-10">
|
||||
<h5
|
||||
class="mt-2 mb-4 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase"
|
||||
>
|
||||
{{ __("Login") }}
|
||||
</h5>
|
||||
|
||||
<Message
|
||||
v-if="form.errors.username"
|
||||
severity="error"
|
||||
class="mb-4"
|
||||
>
|
||||
{{ form.errors.username }}
|
||||
</Message>
|
||||
|
||||
<form
|
||||
class="space-y-4"
|
||||
autocomplete="off"
|
||||
@submit.prevent="submit"
|
||||
>
|
||||
<div>
|
||||
<label for="username" class="sr-only">{{
|
||||
__("Email or Username")
|
||||
}}</label>
|
||||
<Input
|
||||
id="username"
|
||||
v-model="form.username"
|
||||
class="w-full"
|
||||
:placeholder="__('Email or Username')"
|
||||
:invalid="Boolean(form.errors.username)"
|
||||
autocomplete="username"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password" class="sr-only">{{
|
||||
__("Password")
|
||||
}}</label>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
v-model="form.password"
|
||||
class="w-full"
|
||||
:placeholder="__('Password')"
|
||||
:invalid="Boolean(form.errors.password)"
|
||||
autocomplete="current-password"
|
||||
/>
|
||||
<small v-if="form.errors.password" class="text-red-600">
|
||||
{{ form.errors.password }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="setting('remember_me')"
|
||||
class="flex items-center gap-2"
|
||||
>
|
||||
<Checkbox v-model="form.remember" id="remember" />
|
||||
<label for="remember" class="text-slate-600">
|
||||
{{ __("Remember me?") }} Ricordami
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Log In')"
|
||||
class="w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
|
||||
<Link
|
||||
v-if="setting('forgot_password')"
|
||||
:href="route('password.request')"
|
||||
class="text-primary-600 hover:text-primary-700 mt-4 inline-block text-sm"
|
||||
>
|
||||
{{ __("I forgot my password") }} - Ho Dimenticato la
|
||||
password
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Registrazione personalizzata (stile vecchia Blade) -->
|
||||
<p
|
||||
v-if="setting('reg_enabled')"
|
||||
class="mt-6 text-center text-slate-500"
|
||||
>
|
||||
Non hai un account / Don't have an account?
|
||||
<a
|
||||
href="auth-creation.php"
|
||||
class="text-primary-600 font-bold hover:text-primary-700"
|
||||
>
|
||||
Registrati / Sign Up
|
||||
</a>
|
||||
</p>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,169 @@
|
||||
<script setup lang="ts">
|
||||
import { Link, useForm } from '@inertiajs/vue3';
|
||||
import Button from '@/components/ui/Button.vue';
|
||||
import Checkbox from '@/components/ui/Checkbox.vue';
|
||||
import Dialog from '@/components/ui/Dialog.vue';
|
||||
import Input from '@/components/ui/Input.vue';
|
||||
import Message from '@/components/ui/Message.vue';
|
||||
import PasswordInput from '@/components/ui/PasswordInput.vue';
|
||||
import { ref } from 'vue';
|
||||
import ReCaptcha from '@/components/ReCaptcha.vue';
|
||||
import SocialButtons from '@/components/SocialButtons.vue';
|
||||
import TermsOfService from '@/components/TermsOfService.vue';
|
||||
import { useSettings, useTranslations } from '@/composables/useVanguard';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
|
||||
defineProps<{
|
||||
socialProviders: string[] | null;
|
||||
captchaSitekey: string | null;
|
||||
}>();
|
||||
|
||||
const { __ } = useTranslations();
|
||||
const { setting } = useSettings();
|
||||
|
||||
const tosVisible = ref(false);
|
||||
const captcha = ref<InstanceType<typeof ReCaptcha> | null>(null);
|
||||
|
||||
const form = useForm({
|
||||
email: '',
|
||||
username: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
tos: false,
|
||||
'g-recaptcha-response': '',
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post('/register', {
|
||||
onError: () => {
|
||||
captcha.value?.reset();
|
||||
form['g-recaptcha-response'] = '';
|
||||
},
|
||||
onFinish: () => form.reset('password', 'password_confirmation'),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Sign Up')">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mt-2 mb-4 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase">
|
||||
{{ __('Register') }}
|
||||
</h5>
|
||||
|
||||
<SocialButtons :providers="socialProviders" />
|
||||
|
||||
<form class="space-y-4" autocomplete="off" @submit.prevent="submit">
|
||||
<div>
|
||||
<Input
|
||||
id="email"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
class="w-full"
|
||||
:placeholder="__('Email')"
|
||||
:invalid="Boolean(form.errors.email)"
|
||||
autocomplete="email"
|
||||
/>
|
||||
<small v-if="form.errors.email" class="text-red-600">{{ form.errors.email }}</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Input
|
||||
id="username"
|
||||
v-model="form.username"
|
||||
class="w-full"
|
||||
:placeholder="__('Username')"
|
||||
:invalid="Boolean(form.errors.username)"
|
||||
autocomplete="username"
|
||||
/>
|
||||
<small v-if="form.errors.username" class="text-red-600">
|
||||
{{ form.errors.username }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
v-model="form.password"
|
||||
class="w-full"
|
||||
:placeholder="__('Password')"
|
||||
:invalid="Boolean(form.errors.password)"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
<small v-if="form.errors.password" class="text-red-600">
|
||||
{{ form.errors.password }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<PasswordInput
|
||||
id="password_confirmation"
|
||||
v-model="form.password_confirmation"
|
||||
class="w-full"
|
||||
:placeholder="__('Confirm Password')"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="setting('tos')">
|
||||
<div class="flex items-center gap-2">
|
||||
<Checkbox
|
||||
v-model="form.tos"
|
||||
id="tos"
|
||||
:invalid="Boolean(form.errors.tos)"
|
||||
/>
|
||||
<label for="tos" class="text-slate-600">
|
||||
{{ __('I accept') }}
|
||||
<button
|
||||
type="button"
|
||||
class="text-primary-600 cursor-pointer hover:underline"
|
||||
@click="tosVisible = true"
|
||||
>
|
||||
{{ __('Terms of Service') }}
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
<small v-if="form.errors.tos" class="text-red-600">{{ form.errors.tos }}</small>
|
||||
</div>
|
||||
|
||||
<div v-if="setting('registration.captcha.enabled') && captchaSitekey">
|
||||
<ReCaptcha
|
||||
ref="captcha"
|
||||
:sitekey="captchaSitekey"
|
||||
@verified="(token) => (form['g-recaptcha-response'] = token)"
|
||||
/>
|
||||
<Message
|
||||
v-if="form.errors['g-recaptcha-response']"
|
||||
severity="error"
|
||||
class="mt-2"
|
||||
>
|
||||
{{ form.errors['g-recaptcha-response'] }}
|
||||
</Message>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Register')"
|
||||
class="w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-6 text-center text-slate-500">
|
||||
{{ __('Already have an account?') }}
|
||||
<Link href="/login" class="text-primary-600 font-bold">{{ __('Login') }}</Link>
|
||||
</p>
|
||||
|
||||
<Dialog v-model:open="tosVisible" :header="__('Terms of Service')" width="40rem">
|
||||
<TermsOfService />
|
||||
|
||||
<template #footer>
|
||||
<Button :label="__('Close')" severity="secondary" @click="tosVisible = false" />
|
||||
</template>
|
||||
</Dialog>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,93 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import Button from '@/components/ui/Button.vue';
|
||||
import Input from '@/components/ui/Input.vue';
|
||||
import PasswordInput from '@/components/ui/PasswordInput.vue';
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
|
||||
const props = defineProps<{ token: string; email?: string | null }>();
|
||||
|
||||
const { __ } = useTranslations();
|
||||
|
||||
const form = useForm({
|
||||
token: props.token,
|
||||
email: props.email ?? '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post(route('password.update'), {
|
||||
onFinish: () => form.reset('password', 'password_confirmation'),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Reset Password')">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mt-2 mb-2 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase">
|
||||
{{ __('Reset Your Password') }}
|
||||
</h5>
|
||||
|
||||
<form class="space-y-4 p-2" autocomplete="off" @submit.prevent="submit">
|
||||
<p class="mb-4 px-2 text-center font-light text-slate-500">
|
||||
{{ __('Please provide your email and pick a new password below.') }}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label for="email" class="sr-only">{{ __('Your E-Mail') }}</label>
|
||||
<Input
|
||||
id="email"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
class="w-full"
|
||||
:placeholder="__('Your E-Mail')"
|
||||
:invalid="Boolean(form.errors.email)"
|
||||
autocomplete="email"
|
||||
/>
|
||||
<small v-if="form.errors.email" class="text-red-600">{{ form.errors.email }}</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password" class="sr-only">{{ __('New Password') }}</label>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
v-model="form.password"
|
||||
class="w-full"
|
||||
:placeholder="__('New Password')"
|
||||
:invalid="Boolean(form.errors.password)"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
<small v-if="form.errors.password" class="text-red-600">
|
||||
{{ form.errors.password }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password_confirmation" class="sr-only">
|
||||
{{ __('Confirm New Password') }}
|
||||
</label>
|
||||
<PasswordInput
|
||||
id="password_confirmation"
|
||||
v-model="form.password_confirmation"
|
||||
class="w-full"
|
||||
:placeholder="__('Confirm New Password')"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Update Password')"
|
||||
class="mt-6 w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import Button from '@/components/ui/Button.vue';
|
||||
import Input from '@/components/ui/Input.vue';
|
||||
import Message from '@/components/ui/Message.vue';
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue';
|
||||
|
||||
const { __ } = useTranslations();
|
||||
|
||||
const form = useForm({ code: '' });
|
||||
|
||||
function submit() {
|
||||
form.post(route('auth.token.validate'), {
|
||||
onFinish: () => form.reset('code'),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthLayout :title="__('Two-Factor Authentication')">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mt-2 mb-4 text-center text-sm font-semibold tracking-wider text-slate-600 uppercase">
|
||||
{{ __('Two-Factor Authentication') }}
|
||||
</h5>
|
||||
|
||||
<Message v-if="form.errors.code" severity="error" class="mb-4">
|
||||
{{ form.errors.code }}
|
||||
</Message>
|
||||
|
||||
<form class="space-y-4" autocomplete="off" @submit.prevent="submit">
|
||||
<div>
|
||||
<label for="code" class="sr-only">{{ __('Token') }}</label>
|
||||
<Input
|
||||
id="code"
|
||||
v-model="form.code"
|
||||
class="w-full"
|
||||
:placeholder="__('2FA Code')"
|
||||
:invalid="Boolean(form.errors.code)"
|
||||
inputmode="numeric"
|
||||
autocomplete="one-time-code"
|
||||
autofocus
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
:label="__('Validate')"
|
||||
class="w-full"
|
||||
size="large"
|
||||
:loading="form.processing"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
</template>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { router } from '@inertiajs/vue3';
|
||||
import Message from '@/components/ui/Message.vue';
|
||||
import { useTranslations } from '@/composables/useVanguard';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
defineProps<{ resent?: boolean }>();
|
||||
|
||||
const { __ } = useTranslations();
|
||||
|
||||
function resend() {
|
||||
router.post(route('verification.resend'));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="__('Verify Your Email Address')" :heading="__('Verify Your Email Address')">
|
||||
<div class="mx-auto max-w-2xl">
|
||||
<div class="rounded-lg border border-slate-200 bg-white shadow-sm">
|
||||
<div class="p-6">
|
||||
<h5 class="mb-4 text-lg font-medium">{{ __('Verify Your Email Address') }}</h5>
|
||||
|
||||
<Message v-if="resent" severity="success" class="mb-4">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</Message>
|
||||
|
||||
<p class="text-slate-600">
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }},
|
||||
<button
|
||||
type="button"
|
||||
class="text-primary-600 cursor-pointer hover:underline"
|
||||
@click="resend"
|
||||
>
|
||||
{{ __('click here to request another') }}</button>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user