install
This commit is contained in:
88
app/Modules/BaseAuth/Resources/Views/pages/login.blade.php
Normal file
88
app/Modules/BaseAuth/Resources/Views/pages/login.blade.php
Normal file
@@ -0,0 +1,88 @@
|
||||
@extends('module.base-auth::layouts.auth-layout')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
async function login(event) {
|
||||
const response = await postData(event.target.action, getFormData(event))
|
||||
|
||||
console.log(response)
|
||||
|
||||
if (response.errors) {
|
||||
loopObject(response.errors, item => addValidationClasses(item))
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
removeValidationClasess()
|
||||
|
||||
await Swal.fire({
|
||||
title: '{{ __('module.base-auth::base.successfully_logged_in') }}',
|
||||
text: '{{ __('module.base-auth::base.press_continue') }}',
|
||||
confirmButtonText: '{{ __('module.base-auth::base.continue') }}',
|
||||
icon: 'success',
|
||||
showDenyButton: false,
|
||||
showCancelButton: false,
|
||||
})
|
||||
|
||||
window.location.href = '{{ route('login') }}'
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ route('login') }}"
|
||||
onsubmit="event.preventDefault();login(event)"
|
||||
class="bg-white dark:bg-gray-800 rounded-lg p-8 w-[25rem] mx-auto"
|
||||
>
|
||||
@csrf
|
||||
<h2 class="text-2xl text-center font-normal mb-6 uppercase">{{ __('module.base-auth::base.online_panel') }}</h2>
|
||||
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
|
||||
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
|
||||
</svg>
|
||||
<div class="mb-6">
|
||||
<label class="block mb-2" for="username">
|
||||
{{ __('module.base-auth::base.phone') }} {{ __('module.base-auth::base.or') }} <span class="lowecase">{{ __('module.base-auth::base.username') }}</span>
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="username"
|
||||
type="text"
|
||||
name="username"
|
||||
placeholder="+99365999990 {{ __('or') }} {{ __('module.base-auth::base.username') }}"
|
||||
autofocus=""
|
||||
value="{{ old('username') }}"
|
||||
>
|
||||
|
||||
<span id="username-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
|
||||
</div>
|
||||
<div class="mb-6">
|
||||
<label class="block mb-2" for="password">
|
||||
{{ __('module.base-auth::base.password') }}
|
||||
</label>
|
||||
<input
|
||||
class="form-control form-input form-input-bordered w-full"
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
>
|
||||
|
||||
<span id="password-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
|
||||
</div>
|
||||
<div class="flex mb-6">
|
||||
<div class="ml-auto">
|
||||
<a href="{{ route('reset-password') }}" class="text-gray-500 font-bold no-underline">
|
||||
{{ __('module.base-auth::base.forgot_your_password') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<button class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center" type="submit">
|
||||
<span class=""><span>{{ __('module.base-auth::base.login') }}</span></span>
|
||||
</button>
|
||||
<a href="{{ route('register') }}" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
|
||||
<span class=""><span>{{ __('module.base-auth::base.register') }}</span></span>
|
||||
</a>
|
||||
</form>
|
||||
@stop
|
||||
124
app/Modules/BaseAuth/Resources/Views/pages/register.blade.php
Normal file
124
app/Modules/BaseAuth/Resources/Views/pages/register.blade.php
Normal file
@@ -0,0 +1,124 @@
|
||||
@extends('module.base-auth::layouts.auth-layout')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
async function register(event) {
|
||||
const response = await postData(event.target.action, getFormData(event))
|
||||
|
||||
if (response.errors) {
|
||||
loopObject(response.errors, item => addValidationClasses(item))
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
removeValidationClasess()
|
||||
|
||||
console.log(response)
|
||||
|
||||
await Swal.fire({
|
||||
title: '{{ __('module.base-auth::base.successfully_registered') }}',
|
||||
text: '{{ __('module.base-auth::base.please_now_verify_your_phone_number_to_continue') }}',
|
||||
icon: 'success',
|
||||
showDenyButton: false,
|
||||
showCancelButton: false,
|
||||
})
|
||||
|
||||
window.location.href = response.url;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<form
|
||||
class="bg-white dark:bg-gray-800 rounded-lg p-8 w-[25rem] mx-auto mt-1"
|
||||
method="POST"
|
||||
action="{{ route('register') }}"
|
||||
onsubmit="event.preventDefault();register(event)"
|
||||
>
|
||||
@csrf
|
||||
<h2 class="text-2xl text-center font-normal mb-6">{{ __('module.base-auth::base.online_panel') }}</h2>
|
||||
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
|
||||
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
|
||||
</svg>
|
||||
<div class="mb-1">
|
||||
<label class="block mb-1" for="name">
|
||||
{{ __('module.base-auth::base.full_name') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="name"
|
||||
type="text"
|
||||
name="name"
|
||||
autofocus=""
|
||||
value="{{ old('name') }}"
|
||||
>
|
||||
|
||||
<span id="name-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<label class="block mb-1" for="phone">
|
||||
{{ __('module.base-auth::base.phone') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="phone"
|
||||
type="text"
|
||||
name="phone"
|
||||
autofocus=""
|
||||
value="{{ old('phone') }}"
|
||||
>
|
||||
|
||||
<span id="phone-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<label class="block mb-1" for="username">
|
||||
{{ ucfirst(__('module.base-auth::base.username')) }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="username"
|
||||
type="text"
|
||||
name="username"
|
||||
autofocus=""
|
||||
value="{{ old('username') }}"
|
||||
>
|
||||
|
||||
<span id="username-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<label class="block mb-1" for="password">
|
||||
{{ __('module.base-auth::base.password') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
>
|
||||
|
||||
<span id="password-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<label class="block mb-1" for="password_confirmation">
|
||||
{{ __('module.base-auth::base.confirm_password') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full"
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
>
|
||||
|
||||
<span id="password_confirmation-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<div class="mb-6"></div>
|
||||
<button
|
||||
class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center"
|
||||
type="submit"
|
||||
>
|
||||
<span class=""><span>{{ __('module.base-auth::base.register') }}</span></span>
|
||||
</button>
|
||||
|
||||
<a
|
||||
href="{{ route('login') }}"
|
||||
class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center"
|
||||
>
|
||||
<span class=""><span>{{ __('module.base-auth::base.go_to_login_page') }}</span></span>
|
||||
</a>
|
||||
</form>
|
||||
@stop
|
||||
@@ -0,0 +1,104 @@
|
||||
@extends('module.base-auth::layouts.auth-layout')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
async function resetPassword(event) {
|
||||
const response = await postData(event.target.action, getFormData(event))
|
||||
|
||||
if (response.errors) {
|
||||
loopObject(response.errors, item => addValidationClasses(item))
|
||||
} else {
|
||||
removeValidationClasess()
|
||||
|
||||
if (response.step === 1) {
|
||||
showVerificationCodeBox()
|
||||
|
||||
Swal.fire({
|
||||
title: '{{ __('Verification code') }}',
|
||||
text: response.message,
|
||||
icon: 'info'
|
||||
})
|
||||
}
|
||||
|
||||
if (response.step === 2) {
|
||||
showPasswordBox()
|
||||
|
||||
Swal.fire({
|
||||
title: '{{ __('Reset Password') }}',
|
||||
text: response.message,
|
||||
icon: 'warning'
|
||||
})
|
||||
}
|
||||
|
||||
if (response.step === 3) {
|
||||
await Swal.fire({
|
||||
title: response.message,
|
||||
showDenyButton: false,
|
||||
showCancelButton: false,
|
||||
})
|
||||
|
||||
window.location.href = '{{ route('login') }}'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ route('reset-password') }}"
|
||||
onsubmit="event.preventDefault();resetPassword(event)"
|
||||
class="bg-white dark:bg-gray-800 rounded-lg p-8 w-[25rem] mx-auto"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-2xl text-center font-normal mb-6">{{ __('Enter your username to continue') }}</h2>
|
||||
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
|
||||
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
|
||||
</svg>
|
||||
|
||||
<div id="username-box" class="mb-6">
|
||||
<label class="block mb-2" for="username">
|
||||
{{ __('Username') }}
|
||||
</label>
|
||||
<input
|
||||
id="username"
|
||||
type="text"
|
||||
name="username"
|
||||
class="form-control form-input form-input-bordered w-full"
|
||||
autofocus=""
|
||||
>
|
||||
<input type="hidden" name="step-sms" value="1">
|
||||
|
||||
<span id="username-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
|
||||
<div class="mb-6 hidden" id="verification-code-box">
|
||||
<label class="block mb-2" for="verification">
|
||||
{{ __('Verification code') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="hidden" id="reset-password-container">
|
||||
<div class="mb-6" id="password-box">
|
||||
<label class="block mb-2" for="password">
|
||||
{{ __('Password') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-6" id="password-confirm-box">
|
||||
<label class="block mb-2" for="password_confirmation">
|
||||
{{ __('Confirm Password') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center" type="submit">
|
||||
<span class=""><span>{{ __('Submit') }}</span></span>
|
||||
</button>
|
||||
<a href="{{ route('register') }}" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
|
||||
<span class=""><span>{{ __('Go to login page') }}</span></span>
|
||||
</a>
|
||||
</form>
|
||||
@stop
|
||||
@@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="tk" dir="ltr" class="h-full font-sans antialiased">
|
||||
<head>
|
||||
<meta name="theme-color" content="#fff">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width"/>
|
||||
<meta name="locale" content="tk"/>
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="/assets/css/auth-layout.css">
|
||||
<style>
|
||||
.bg-secondary-500 {
|
||||
background-color: rgb(186,230,253);
|
||||
}
|
||||
.hover:bg-secondary-400 {
|
||||
background-color: rgba(24, 182, 155, 0.5);
|
||||
}
|
||||
.underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.d-none {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="min-w-site text-sm font-medium min-h-full text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-900">
|
||||
<div class="py-6 px-1 md:px-2 lg:px-6">
|
||||
<div class="mx-auto py-8 max-w-sm flex justify-center">
|
||||
<span class="uppercase text-4xl">{{ __('module.base-auth::base.online_panel') }}</span>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-8 max-w-[25rem] mx-auto">
|
||||
|
||||
<h2 class="text-2xl text-center font-normal mb-6">{{ __('module.base-auth::base.verify_phone_number') }}</h2>
|
||||
|
||||
<div class="flex justify-center items-center mb-6">
|
||||
<h2 class="text-lg text-center font-normal mr-4">+993 {{ $phone }}</h2>
|
||||
|
||||
<span href="#" class="underline cursor-pointer" onclick="showChangePhone()" id="change-phone-button">
|
||||
{{ __('module.base-auth::base.change_number') }}
|
||||
</span>
|
||||
|
||||
<span href="#" class="underline cursor-pointer d-none" onclick="goBack()" id="go-back-button">
|
||||
{{ __('module.base-auth::base.go_back') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{{-- Border line --}}
|
||||
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
|
||||
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
|
||||
</svg>
|
||||
|
||||
{{-- Change phone form --}}
|
||||
<form method="POST" action="{{ route('change-phone') }}" id="change-phone-form" class="d-none" onsubmit="event.preventDefault();changePhone(event)">
|
||||
@csrf
|
||||
<div class="mb-6">
|
||||
<label class="block mb-2" for="phone">
|
||||
{{ __('module.base-auth::base.change_phone_label') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full" id="phone" type="text" name="phone" required="">
|
||||
|
||||
<span id="phone-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
</div>
|
||||
<button type="submit" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
|
||||
<span class=""><span>{{ __('module.base-auth::base.change_number') }}</span></span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{{-- Verification form --}}
|
||||
<form method="POST" action="{{ route('sms-verification') }}" id="verification-form">
|
||||
@csrf
|
||||
<div class="mb-6">
|
||||
<label class="block mb-2" for="code">
|
||||
{{ __('module.base-auth::base.verification_code') }}
|
||||
</label>
|
||||
<input class="form-control form-input form-input-bordered w-full" id="code" type="number" name="code" required="">
|
||||
|
||||
@if($errors->any())
|
||||
@foreach($errors->all() as $error)
|
||||
<p class="mt-2 text-red-500">{{ $error }}</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="submit" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
|
||||
<span class=""><span>{{ __('module.base-auth::base.submit') }}</span></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/js/inputmask.min.js"></script>
|
||||
<script src="/assets/js/sweetalert2.js"></script>
|
||||
<script src="/assets/js/fn.js"></script>
|
||||
<script>
|
||||
|
||||
let phoneField = $_ID('phone')
|
||||
let changePhoneform = $_ID('change-phone-form')
|
||||
let verificationForm = $_ID('verification-form')
|
||||
let changePhoneButton = $_ID('change-phone-button')
|
||||
let goBackButton = $_ID('go-back-button')
|
||||
|
||||
ready(() => {
|
||||
new Inputmask("+(\\9\\93)-99-99-99-99").mask(phoneField);
|
||||
})
|
||||
|
||||
async function goBack() {
|
||||
hide(changePhoneform)
|
||||
show(changePhoneButton)
|
||||
|
||||
hide(goBackButton)
|
||||
show(verificationForm)
|
||||
}
|
||||
|
||||
function showChangePhone() {
|
||||
show(changePhoneform)
|
||||
hide(changePhoneButton)
|
||||
|
||||
show(goBackButton)
|
||||
hide(verificationForm)
|
||||
}
|
||||
|
||||
async function changePhone(event) {
|
||||
const response = await postData(event.target.action, getFormData(event))
|
||||
|
||||
if (response.errors) {
|
||||
loopObject(response.errors, item => addValidationClasses(item))
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
removeValidationClasess()
|
||||
|
||||
await Swal.fire({
|
||||
title: '{{ __('module.base-auth::base.successfully_changed_phone') }}',
|
||||
text: '{{ __('module.base-auth::base.please_now_verify_your_phone_number_to_continue') }}',
|
||||
icon: 'success',
|
||||
showDenyButton: false,
|
||||
showCancelButton: false,
|
||||
})
|
||||
|
||||
window.location.href = response.url;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user