auth dan user profile
This commit is contained in:
@@ -111,15 +111,20 @@
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- Vendors JS -->
|
||||
<script src="{{ asset('assets/vendor/libs/@form-validation/popular.js') }}"></script>
|
||||
<!-- <script src="{{ asset('assets/vendor/libs/@form-validation/popular.js') }}"></script>
|
||||
<script src="{{ asset('assets/vendor/libs/@form-validation/bootstrap5.js') }}"></script>
|
||||
<script src="{{ asset('assets/vendor/libs/@form-validation/auto-focus.js') }}"></script>
|
||||
<script src="{{ asset('assets/vendor/libs/@form-validation/auto-focus.js') }}"></script> -->
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.min.js"></script>
|
||||
|
||||
<!-- Main JS -->
|
||||
|
||||
<script src="{{ asset('assets/js/main.js') }}"></script>
|
||||
|
||||
<!-- Page JS -->
|
||||
<script src="{{ asset('assets/js/pages-auth.js') }}"></script>
|
||||
<!-- <script src="{{ asset('assets/js/pages-auth.js') }}"></script> -->
|
||||
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -87,3 +87,44 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#formAuthentication').validate({
|
||||
rules: {
|
||||
email_username: {
|
||||
required: true,
|
||||
minlength: 6,
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
email_username: {
|
||||
required: 'Email atau Nama Pengguna wajib diisi',
|
||||
minlength: 'Email atau Nama Pengguna minimal 6 karakter',
|
||||
},
|
||||
password: {
|
||||
required: 'Password wajib diisi',
|
||||
},
|
||||
},
|
||||
errorElement: 'div',
|
||||
errorPlacement: function (error, element) {
|
||||
error.addClass('invalid-feedback');
|
||||
element.closest('.mb-6, .form-control-validation').append(error);
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element) {
|
||||
$(element).removeClass('is-invalid');
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
form.submit();
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@@ -113,7 +113,7 @@
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div class="divider my-6">
|
||||
<!-- <div class="divider my-6">
|
||||
<div class="divider-text">atau</div>
|
||||
</div>
|
||||
|
||||
@@ -133,7 +133,72 @@
|
||||
<a href="javascript:;" class="btn btn-icon rounded-circle btn-text-google-plus">
|
||||
<i class="icon-base ti tabler-brand-google-filled icon-20px"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#formAuthentication').validate({
|
||||
rules: {
|
||||
username: {
|
||||
required: true,
|
||||
minlength: 6,
|
||||
},
|
||||
email: {
|
||||
required: true,
|
||||
email: true,
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
minlength: 8,
|
||||
},
|
||||
password_confirmation: {
|
||||
required: true,
|
||||
equalTo: '#password',
|
||||
},
|
||||
terms: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
username: {
|
||||
required: 'Username wajib diisi',
|
||||
minlength: 'Username minimal 6 karakter',
|
||||
},
|
||||
email: {
|
||||
required: 'Email wajib diisi',
|
||||
email: 'Format email tidak sesuai',
|
||||
},
|
||||
password: {
|
||||
required: 'Kata Sandi wajib diisi',
|
||||
},
|
||||
password_confirmation: {
|
||||
required: 'Konfirmasi Kata Sandi wajib diisi',
|
||||
equalTo: 'Konfirmasi Kata Sandi tidak sesuai',
|
||||
minlength: 'Password minimal 8 karakter',
|
||||
},
|
||||
terms: {
|
||||
required: 'Anda harus menyetujui ketentuan layanan',
|
||||
},
|
||||
},
|
||||
errorElement: 'div',
|
||||
errorPlacement: function (error, element) {
|
||||
error.addClass('invalid-feedback');
|
||||
element.closest('.mb-6, .form-control-validation').append(error);
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element) {
|
||||
$(element).removeClass('is-invalid');
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
form.submit();
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
<i class="icon-base ti tabler-circles icon-lg"></i><span class="fw-medium mx-2">Role:</span>
|
||||
<span>{{ $profile->role ?? 'N/A' }}</span>
|
||||
</li>
|
||||
@if(auth()->user()->role === \App\Enums\Role::PETANI)
|
||||
<li class="d-flex align-items-start mb-4">
|
||||
<i class="icon-base ti tabler-id icon-lg"></i><span class="fw-medium mx-2">No KTP:</span>
|
||||
<span>{{ $profile->ktp ?? 'N/A' }}</span>
|
||||
@@ -114,6 +115,7 @@
|
||||
<i class="icon-base ti tabler-users icon-lg"></i><span class="fw-medium mx-2">No KK:</span>
|
||||
<span>{{ $profile->kk ?? 'N/A' }}</span>
|
||||
</li>
|
||||
@endif
|
||||
<li class="d-flex align-items-start mb-0">
|
||||
<i class="icon-base ti tabler-map-pin icon-lg flex-shrink-0"></i><span class="fw-medium mx-2">Alamat:</span>
|
||||
<span>{{ $alamatLengkap ?? 'N/A' }}</span>
|
||||
@@ -268,16 +270,18 @@
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="form-label" for="quick-profile-telepon">Telepon</label>
|
||||
<input type="text" class="form-control" id="quick-profile-telepon" name="telepon" value="{{ $profile->telepon }}" maxlength="13" required>
|
||||
<input type="text" class="form-control" id="quick-profile-telepon" name="telepon" value="{{ $profile->telepon }}" maxlength="13">
|
||||
</div>
|
||||
@if($profile->role === \App\Enums\Role::PETANI->value)
|
||||
<div class="mb-4">
|
||||
<label class="form-label" for="quick-profile-ktp">No KTP</label>
|
||||
<input type="text" class="form-control" id="quick-profile-ktp" name="ktp" value="{{ $profile->ktp }}" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="form-label" for="quick-profile-kk">No KK</label>
|
||||
<input type="text" class="form-control" id="quick-profile-kk" name="kk" value="{{ $profile->kk }}" maxlength="16">
|
||||
</div>
|
||||
@endif
|
||||
<div class="mb-4">
|
||||
<label class="form-label" for="quick-profile-alamat">Alamat</label>
|
||||
<textarea class="form-control" id="quick-profile-alamat" name="alamat" rows="4">{{ $profile->alamat }}</textarea>
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
<script src="{{ asset('assets/js/dashboards-analytics.js') }}"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.min.js"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 form-control-validation">
|
||||
<label class="form-label" for="edit-profile-telepon">No. Telepon<span class="text-danger">*</span></label>
|
||||
<label class="form-label" for="edit-profile-telepon">No. Telepon</label>
|
||||
<input type="text" class="form-control" id="edit-profile-telepon" name="telepon" value="{{ $profile->telepon }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user