Merge pull request #5326 from devansh-webkul/delete-profile-fix

Delete Profile Fixed #5325
This commit is contained in:
Devansh 2021-11-12 11:37:38 +05:30 committed by GitHub
commit b59f3875b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 29 deletions

View File

@ -12,7 +12,6 @@
</style> </style>
@endpush @endpush
@section('page-detail-wrapper') @section('page-detail-wrapper')
<div class="account-head mb-0"> <div class="account-head mb-0">
<span class="back-icon"> <span class="back-icon">
@ -20,6 +19,7 @@
<i class="icon icon-menu-back"></i> <i class="icon icon-menu-back"></i>
</a> </a>
</span> </span>
<span class="account-heading"> <span class="account-heading">
{{ __('shop::app.customer.account.profile.index.title') }} {{ __('shop::app.customer.account.profile.index.title') }}
</span> </span>
@ -37,12 +37,11 @@
<div class="table"> <div class="table">
<table> <table>
<tbody> <tbody>
{!! view_render_event( {!! view_render_event('bagisto.shop.customers.account.profile.view.table.before', ['customer' => $customer]) !!}
'bagisto.shop.customers.account.profile.view.table.before', ['customer' => $customer])
!!}
<tr> <tr>
<td>{{ __('shop::app.customer.account.profile.fname') }}</td> <td>{{ __('shop::app.customer.account.profile.fname') }}</td>
<td>{{ $customer->first_name }}</td> <td>{{ $customer->first_name }}</td>
</tr> </tr>
@ -50,6 +49,7 @@
<tr> <tr>
<td>{{ __('shop::app.customer.account.profile.lname') }}</td> <td>{{ __('shop::app.customer.account.profile.lname') }}</td>
<td>{{ $customer->last_name }}</td> <td>{{ $customer->last_name }}</td>
</tr> </tr>
@ -57,6 +57,7 @@
<tr> <tr>
<td>{{ __('shop::app.customer.account.profile.gender') }}</td> <td>{{ __('shop::app.customer.account.profile.gender') }}</td>
<td>{{ $customer->gender ?? '-' }}</td> <td>{{ $customer->gender ?? '-' }}</td>
</tr> </tr>
@ -64,6 +65,7 @@
<tr> <tr>
<td>{{ __('shop::app.customer.account.profile.dob') }}</td> <td>{{ __('shop::app.customer.account.profile.dob') }}</td>
<td>{{ $customer->date_of_birth ?? '-' }}</td> <td>{{ $customer->date_of_birth ?? '-' }}</td>
</tr> </tr>
@ -71,34 +73,38 @@
<tr> <tr>
<td>{{ __('shop::app.customer.account.profile.email') }}</td> <td>{{ __('shop::app.customer.account.profile.email') }}</td>
<td>{{ $customer->email }}</td> <td>{{ $customer->email }}</td>
</tr> </tr>
{!! view_render_event( {!! view_render_event('bagisto.shop.customers.account.profile.view.table.after', ['customer' => $customer]) !!}
'bagisto.shop.customers.account.profile.view.table.after', ['customer' => $customer])
!!}
</tbody> </tbody>
</table> </table>
</div> </div>
<button <button
type="submit" type="submit"
class="theme-btn mb20" @click="showModal('deleteProfile')" > class="theme-btn mb20" @click="window.showDeleteProfileModal();">
{{ __('shop::app.customer.account.address.index.delete') }} {{ __('shop::app.customer.account.address.index.delete') }}
</button> </button>
<div id="deleteProfileForm" class="d-none">
<form method="POST" action="{{ route('customer.profile.destroy') }}" @submit.prevent="onSubmit"> <form method="POST" action="{{ route('customer.profile.destroy') }}" @submit.prevent="onSubmit">
@csrf @csrf
<modal id="deleteProfile" :is-open="modalIds.deleteProfile"> <modal id="deleteProfile" :is-open="modalIds.deleteProfile">
<h3 slot="header">{{ __('shop::app.customer.account.address.index.enter-password') }} <h3 slot="header">
{{ __('shop::app.customer.account.address.index.enter-password') }}
</h3> </h3>
<i class="rango-close"></i> <i class="rango-close"></i>
<div slot="body"> <div slot="body">
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password" class="required">{{ __('admin::app.users.users.password') }}</label> <label for="password" class="required">{{ __('admin::app.users.users.password') }}</label>
<input type="password" v-validate="'required|min:6|max:18'" class="control" id="password" name="password" data-vv-as="&quot;{{ __('admin::app.users.users.password') }}&quot;"/> <input type="password" v-validate="'required|min:6|max:18'" class="control" id="password" name="password" data-vv-as="&quot;{{ __('admin::app.users.users.password') }}&quot;"/>
<span class="control-error" v-if="errors.has('password')" v-text="errors.first('password')"></span> <span class="control-error" v-if="errors.has('password')" v-text="errors.first('password')"></span>
</div> </div>
@ -111,6 +117,20 @@
</modal> </modal>
</form> </form>
</div> </div>
</div>
{!! view_render_event('bagisto.shop.customers.account.profile.view.after', ['customer' => $customer]) !!} {!! view_render_event('bagisto.shop.customers.account.profile.view.after', ['customer' => $customer]) !!}
@endsection @endsection
@push('scripts')
<script>
/**
* Show delete profile modal.
*/
function showDeleteProfileModal() {
document.getElementById('deleteProfileForm').classList.remove('d-none');
window.app.showModal('deleteProfile');
}
</script>
@endpush