You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
9.6 KiB
191 lines
9.6 KiB
@extends('layouts.main') |
|
@section('content') |
|
<!-- Informasi Akun --> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
@if (Session::has('success')) |
|
<div class="alert alert-success alert-dismissible fade show" role="alert"> |
|
<strong>{{ Session::get('success') }}</strong> |
|
</div> |
|
@endif |
|
|
|
@if (Session::has('error')) |
|
<div class="alert alert-danger alert-dismissible fade show" role="alert"> |
|
<strong>{{ Session::get('error') }}</strong> |
|
</div> |
|
@endif |
|
<header> |
|
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100"> |
|
Informasi Akun |
|
</h2> |
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400"> |
|
Perbarui informasi nama profil dan alamat email akun Anda. |
|
</p> |
|
</header> |
|
<div class="py-12"> |
|
<form id="send-verification" method="post" action="{{ route('verification.send') }}"> |
|
@csrf |
|
</form> |
|
|
|
<form method="post" action="{{ route('profile.update') }}" class="mt-6 space-y-6"> |
|
@csrf |
|
@method('patch') |
|
|
|
<div class="mb-1"> |
|
<div class="row"> |
|
<div class="col-2"> |
|
<label for="fullname" class="block text-gray-700 text-sm font-bold mt-2 ml-3">Full |
|
Name</label> |
|
</div> |
|
<div class="col-10"> |
|
<input id="fullname" name="fullname" type="text" |
|
class="p-1 w-full border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" |
|
value="{{ old('fullname', $user->fullname) }}" required autofocus |
|
autocomplete="fullname"> |
|
@if ($errors->has('fullname')) |
|
<p class="text-red-500 text-sm mt-1">{{ $errors->first('fullname') }}</p> |
|
@endif |
|
</div> |
|
</div> |
|
</div> |
|
<div class="mb-4"> |
|
<div class="row"> |
|
<div class="col-2"> |
|
<label for="email" class="block text-gray-700 text-sm font-bold mt-2 ml-3">Email</label> |
|
</div> |
|
<div class="col-10"> |
|
<input id="email" name="email" type="email" |
|
class="p-1 w-full border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" |
|
value="{{ old('email', $user->email) }}" required autocomplete="email"> |
|
@if ($errors->has('email')) |
|
<p class="text-red-500 text-sm mt-1">{{ $errors->first('email') }}</p> |
|
@endif |
|
|
|
@if ($user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail && !$user->hasVerifiedEmail()) |
|
<div class="mt-2 text-gray-800"> |
|
Alamat email Anda belum diverifikasi. |
|
<button form="send-verification" |
|
class="underline text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"> |
|
Klik di sini untuk mengirim ulang email verifikasi. |
|
</button> |
|
@if (session('status') === 'verification-link-sent') |
|
<p class="mt-2 font-medium text-green-600"> |
|
Tautan verifikasi baru telah dikirimkan ke alamat email Anda. |
|
</p> |
|
@endif |
|
</div> |
|
@endif |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<button type="submit" |
|
class="btn btn-sm btn-primary hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded"> |
|
Simpan |
|
</button> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<!-- Ganti Password--> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
@if (Session::has('success-password')) |
|
<div class="alert alert-success alert-dismissible fade show" role="alert"> |
|
<strong>{{ Session::get('success-password') }}</strong> |
|
</div> |
|
@endif |
|
|
|
@if (Session::has('error-password')) |
|
<div class="alert alert-danger alert-dismissible fade show" role="alert"> |
|
<strong>{{ Session::get('error-password') }}</strong> |
|
</div> |
|
@endif |
|
<header> |
|
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100"> |
|
Ubah Password |
|
</h2> |
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400"> |
|
Pastikan akun Anda menggunakan kata sandi yang panjang dan acak agar tetap aman. |
|
</p> |
|
</header> |
|
<form method="post" action="{{ route('password.update') }}" class="mt-6 space-y-6"> |
|
@csrf |
|
@method('put') |
|
<div class="mb-2"> |
|
<div class="row"> |
|
<div class="col-2"> |
|
<label for="current_password" class="block text-gray-700 text-sm font-bold mt-2 ml-3">kata sandi |
|
saat ini</label> |
|
</div> |
|
<div class="col-10"> |
|
<input id="current_password" name="current_password" type="password" |
|
class="p-1 w-full border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" |
|
autocomplete="current-password"> |
|
@if ($errors->has('updatePassword.current_password')) |
|
<p class="text-red-500">{{ $errors->first('updatePassword.current_password') }}</p> |
|
@endif |
|
</div> |
|
</div> |
|
</div> |
|
<div class="mb-2"> |
|
<div class="row"> |
|
<div class="col-2"> |
|
<label for="password" class="block text-gray-700 text-sm font-bold mt-2 ml-3">kata sandi |
|
baru</label> |
|
</div> |
|
<div class="col-10"> |
|
<input id="password" name="password" type="password" |
|
class="p-1 w-full border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" |
|
autocomplete="new-password"> |
|
@if ($errors->has('updatePassword.password')) |
|
<p class="text-red-500">{{ $errors->first('updatePassword.password') }}</p> |
|
@endif |
|
</div> |
|
</div> |
|
</div> |
|
<div class="mb-2"> |
|
<div class="row"> |
|
<div class="col-2"> |
|
<label for="password_confirmation" |
|
class="block text-gray-700 text-sm font-bold mt-2 ml-3">konfirmasi sandi</label> |
|
</div> |
|
<div class="col-10"> |
|
<input id="password_confirmation" name="password_confirmation" type="password" |
|
class="p-1 w-full border border-gray-300 rounded-md focus:outline-none focus:border-indigo-500" |
|
autocomplete="new-password"> |
|
@if ($errors->has('updatePassword.password_confirmation')) |
|
<p class="text-red-500">{{ $errors->first('updatePassword.password_confirmation') }}</p> |
|
@endif |
|
</div> |
|
</div> |
|
</div> |
|
<div class="flex items-center space-x-4 mt-2"> |
|
<button type="submit" |
|
class="btn btn-sm btn-primary hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded"> |
|
Simpan |
|
</button> |
|
|
|
@if (session('status') === 'password-updated') |
|
<p x-data="{ show: true }" x-show="show" x-transition x-init="setTimeout(() => show = false, 2000)" |
|
class="text-gray-600"> |
|
Tersimpan. |
|
</p> |
|
@endif |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> |
|
<script> |
|
$(document).ready(function() { |
|
setTimeout(function() { |
|
$(".alert.alert-danger, .alert.alert-success").fadeOut(500, function() { |
|
$(this).remove(); |
|
}); |
|
}, 3000); // 5 detik |
|
}); |
|
</script> |
|
@endsection
|
|
|