done lots of work till now
This commit is contained in:
1 parent
a7434e33d7
commit
c87c4bfd6d
10 files changed
+256
-116
No files matched your search
@@ -3,7 +3,10 @@
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="mb-0">Members</h1>
|
||||
<div>
|
||||
<h1 class="mb-1">Family Members</h1>
|
||||
<p class="text-muted mb-0">Manage and view your family members</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Family Members Card Grid -->
|
||||
@@ -88,11 +91,17 @@
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-6">
|
||||
<div class="small text-muted text-uppercase fw-medium mb-1" style="font-size: 0.7rem; letter-spacing: 0.5px;">Gender</div>
|
||||
<div class="fw-semibold text-muted text-capitalize">{{ $relationship->dependent->gender == 'm' ? 'Male' : 'Female' }}</div>
|
||||
<div class="fw-semibold text-muted text-capitalize">
|
||||
<i class="bi {{ $relationship->dependent->gender == 'm' ? 'bi-man text-primary' : 'bi-woman text-danger' }} me-1"></i>
|
||||
{{ $relationship->dependent->gender == 'm' ? 'Male' : 'Female' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="small text-muted text-uppercase fw-medium mb-1" style="font-size: 0.7rem; letter-spacing: 0.5px;">Age</div>
|
||||
<div class="fw-semibold text-muted">{{ $relationship->dependent->age }} years</div>
|
||||
<div class="fw-semibold text-muted">
|
||||
<i class="bi bi-cake text-warning me-1"></i>
|
||||
{{ $relationship->dependent->age }} years
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mb-3">
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
<h2 class="fw-bold mb-1">Member Profile</h2>
|
||||
<p class="text-muted mb-0">Comprehensive member information and analytics</p>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="window.history.back()" class="btn btn-outline-primary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Profile Card -->
|
||||
@@ -58,6 +63,10 @@
|
||||
<i class="bi bi-pencil me-2"></i>Edit Info
|
||||
</a></li>
|
||||
<li><a class="dropdown-item" href="#"><i class="bi bi-bullseye me-2"></i>Set a Goal</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" data-bs-toggle="modal" data-bs-target="#deleteAccountModal">
|
||||
<i class="bi bi-trash me-2"></i>Delete Account
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2480,6 +2489,51 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// Delete Account Modal functionality
|
||||
const deleteAccountModal = document.getElementById('deleteAccountModal');
|
||||
const confirmNameInput = document.getElementById('confirmName');
|
||||
const deleteAccountBtn = document.getElementById('deleteAccountBtn');
|
||||
const expectedName = '{{ $relationship->dependent->full_name }}';
|
||||
|
||||
if (deleteAccountModal && confirmNameInput && deleteAccountBtn) {
|
||||
// Function to check if confirmation name matches
|
||||
function checkConfirmationName() {
|
||||
const enteredName = confirmNameInput.value.trim();
|
||||
const matches = enteredName === expectedName;
|
||||
deleteAccountBtn.disabled = !matches;
|
||||
|
||||
// Add visual feedback
|
||||
if (matches) {
|
||||
confirmNameInput.classList.remove('is-invalid');
|
||||
confirmNameInput.classList.add('is-valid');
|
||||
} else {
|
||||
confirmNameInput.classList.remove('is-valid');
|
||||
if (enteredName.length > 0) {
|
||||
confirmNameInput.classList.add('is-invalid');
|
||||
} else {
|
||||
confirmNameInput.classList.remove('is-invalid');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for input changes
|
||||
confirmNameInput.addEventListener('input', checkConfirmationName);
|
||||
|
||||
// Reset modal when opened
|
||||
deleteAccountModal.addEventListener('show.bs.modal', function() {
|
||||
confirmNameInput.value = '';
|
||||
confirmNameInput.classList.remove('is-valid', 'is-invalid');
|
||||
deleteAccountBtn.disabled = true;
|
||||
});
|
||||
|
||||
// Reset modal when closed
|
||||
deleteAccountModal.addEventListener('hidden.bs.modal', function() {
|
||||
confirmNameInput.value = '';
|
||||
confirmNameInput.classList.remove('is-valid', 'is-invalid');
|
||||
deleteAccountBtn.disabled = true;
|
||||
});
|
||||
}
|
||||
|
||||
// Handle form submission
|
||||
document.getElementById('tournamentParticipationForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
@@ -2547,4 +2601,49 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
:relationship="$relationship"
|
||||
/>
|
||||
|
||||
<!-- Delete Account Modal -->
|
||||
<div class="modal fade" id="deleteAccountModal" tabindex="-1" aria-labelledby="deleteAccountModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content border-danger">
|
||||
<div class="modal-header bg-danger text-white">
|
||||
<h5 class="modal-title" id="deleteAccountModalLabel">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i>Delete Account
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form id="deleteAccountForm" method="POST" action="{{ $relationship->relationship_type === 'admin_view' ? route('admin.platform.members.destroy', $relationship->dependent->id) : route('member.confirm-delete', $relationship->dependent->id) }}">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="modal-body">
|
||||
<div class="text-center mb-4">
|
||||
<i class="bi bi-exclamation-triangle-fill text-danger" style="font-size: 3rem;"></i>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<strong>Warning!</strong> This action cannot be undone. This will permanently delete the account for <strong>{{ $relationship->dependent->full_name }}</strong> and remove all associated data.
|
||||
</div>
|
||||
|
||||
<p class="text-muted small mb-3">
|
||||
To confirm deletion, please type the full name of the account holder below:
|
||||
</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="confirmName" class="form-label fw-semibold">Type "{{ $relationship->dependent->full_name }}" to confirm:</label>
|
||||
<input type="text" class="form-control" id="confirmName" name="confirm_name" required>
|
||||
<div class="form-text text-muted">
|
||||
This action will soft delete the account. The account can be restored by an administrator if needed.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-danger" id="deleteAccountBtn" disabled>
|
||||
<i class="bi bi-trash me-2"></i>Delete Account
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in new issue
Block a user