affiliations
This commit is contained in:
1 parent
4f3f9c9aad
commit
0b5b3dd3ee
177 files changed
+9660
-8531
No files matched your search
@@ -30,44 +30,43 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mobile" class="form-label">Mobile Number</label>
|
||||
<div class="input-group" onclick="event.stopPropagation()">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle country-dropdown-btn d-flex align-items-center" type="button" id="country_codeDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="fi fi-bh me-2" id="country_codeSelectedFlag"></span>
|
||||
<span class="country-label" id="country_codeSelectedCountry">{{ old('mobile_code', '+973') }}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2" aria-labelledby="country_codeDropdown" style="min-width: 200px;" onclick="event.stopPropagation()">
|
||||
<input type="text" class="form-control form-control-sm mb-2" placeholder="Search country..." id="country_codeSearch" onkeydown="event.stopPropagation()">
|
||||
<div class="country-list" id="country_codeList" style="max-height: 300px; overflow-y: auto;"></div>
|
||||
</div>
|
||||
<input type="hidden" id="country_code" name="mobile_code" value="{{ old('mobile_code', '+973') }}">
|
||||
<input id="mobile_number" type="tel" class="form-control @error('mobile') is-invalid @enderror" name="mobile" value="{{ old('mobile') }}" autocomplete="tel" placeholder="Phone number">
|
||||
</div>
|
||||
<x-country-code-dropdown
|
||||
name="mobile_code"
|
||||
id="country_code"
|
||||
:value="old('mobile_code', '+973')"
|
||||
:required="false"
|
||||
:error="$errors->first('mobile_code')">
|
||||
<input id="mobile_number" type="tel"
|
||||
class="form-control @error('mobile') is-invalid @enderror"
|
||||
name="mobile"
|
||||
value="{{ old('mobile') }}"
|
||||
autocomplete="tel"
|
||||
placeholder="Phone number">
|
||||
</x-country-code-dropdown>
|
||||
@error('mobile')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
@error('mobile_code')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="m" {{ old('gender') == 'm' ? 'selected' : '' }}>Male</option>
|
||||
<option value="f" {{ old('gender') == 'f' ? 'selected' : '' }}>Female</option>
|
||||
</select>
|
||||
@error('gender')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<x-gender-dropdown
|
||||
name="gender"
|
||||
id="gender"
|
||||
:value="old('gender')"
|
||||
:required="true"
|
||||
:error="$errors->first('gender')" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="birthdate" class="form-label">Birthdate</label>
|
||||
<input type="date" class="form-control @error('birthdate') is-invalid @enderror" id="birthdate" name="birthdate" value="{{ old('birthdate') }}" required>
|
||||
@error('birthdate')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<x-birthdate-dropdown
|
||||
name="birthdate"
|
||||
id="birthdate"
|
||||
label="Birthdate"
|
||||
:value="old('birthdate')"
|
||||
:required="true"
|
||||
:min-age="0"
|
||||
:max-age="120"
|
||||
:error="$errors->first('birthdate')" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -91,7 +90,7 @@
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<x-country-dropdown
|
||||
<x-nationality-dropdown
|
||||
name="nationality"
|
||||
id="nationality"
|
||||
:value="old('nationality')"
|
||||
@@ -205,6 +204,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let socialLinkIndex = {{ count($formLinks ?? []) }};
|
||||
@@ -271,74 +271,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Load countries for mobile code dropdown
|
||||
fetch('/data/countries.json')
|
||||
.then(response => response.json())
|
||||
.then(countries => {
|
||||
const listElement = document.getElementById('country_codeList');
|
||||
const selectedFlag = document.getElementById('country_codeSelectedFlag');
|
||||
const selectedCountry = document.getElementById('country_codeSelectedCountry');
|
||||
const hiddenInput = document.getElementById('country_code');
|
||||
const searchInput = document.getElementById('country_codeSearch');
|
||||
|
||||
if (!listElement) return;
|
||||
|
||||
// Populate dropdown
|
||||
countries.forEach(country => {
|
||||
const button = document.createElement('button');
|
||||
button.className = 'dropdown-item d-flex align-items-center';
|
||||
button.type = 'button';
|
||||
button.setAttribute('data-country-code', country.call_code);
|
||||
button.setAttribute('data-country-name', country.name);
|
||||
button.setAttribute('data-flag-code', country.flag);
|
||||
button.setAttribute('data-search', `${country.name.toLowerCase()} ${country.call_code}`);
|
||||
button.innerHTML = `<span class="fi fi-${country.flag.toLowerCase()} me-2"></span><span>${country.name} (${country.call_code})</span>`;
|
||||
button.addEventListener('click', function() {
|
||||
const code = this.getAttribute('data-country-code');
|
||||
const flag = this.getAttribute('data-flag-code');
|
||||
const name = this.getAttribute('data-country-name');
|
||||
selectedFlag.className = `fi fi-${flag.toLowerCase()} me-2`;
|
||||
selectedCountry.textContent = code;
|
||||
hiddenInput.value = code;
|
||||
// Close dropdown
|
||||
const dropdown = bootstrap.Dropdown.getInstance(document.getElementById('country_codeDropdown'));
|
||||
if (dropdown) dropdown.hide();
|
||||
});
|
||||
listElement.appendChild(button);
|
||||
});
|
||||
|
||||
// Set initial value
|
||||
const initialValue = '{{ old('mobile_code', '+973') }}';
|
||||
if (initialValue) {
|
||||
hiddenInput.value = initialValue;
|
||||
selectedCountry.textContent = initialValue;
|
||||
const country = countries.find(c => c.call_code === initialValue);
|
||||
if (country) {
|
||||
selectedFlag.className = `fi fi-${country.flag.toLowerCase()} me-2`;
|
||||
}
|
||||
}
|
||||
|
||||
// Search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchTerm = this.value.toLowerCase();
|
||||
const items = listElement.querySelectorAll('.dropdown-item');
|
||||
items.forEach(item => {
|
||||
const searchData = item.getAttribute('data-search');
|
||||
if (searchData.includes(searchTerm)) {
|
||||
item.style.display = '';
|
||||
} else {
|
||||
item.style.display = 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error loading countries:', error));
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@endsection
|
||||
@@ -160,223 +160,22 @@
|
||||
|
||||
<!-- Add New Family Member Card -->
|
||||
<div class="col">
|
||||
<div class="card h-100 shadow-sm border-dashed add-card">
|
||||
<div class="card-body text-center text-decoration-none d-flex flex-column justify-content-center align-items-center" style="height: 100%; cursor: pointer;" data-bs-toggle="modal" data-bs-target="#addFamilyMemberModal">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-plus-circle" style="font-size: 3rem;"></i>
|
||||
<a href="{{ route('family.create') }}" class="text-decoration-none">
|
||||
<div class="card h-100 shadow-sm border-dashed add-card">
|
||||
<div class="card-body text-center d-flex flex-column justify-content-center align-items-center" style="height: 100%; cursor: pointer;">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-plus-circle" style="font-size: 3rem;"></i>
|
||||
</div>
|
||||
<h5 class="card-title text-muted">Add Family Member</h5>
|
||||
</div>
|
||||
<h5 class="card-title text-muted">Add Family Member</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Add Family Member Modal -->
|
||||
<div class="modal fade" id="addFamilyMemberModal" tabindex="-1" aria-labelledby="addFamilyMemberModalLabel" aria-hidden="true" data-bs-focus="false">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="addFamilyMemberModalLabel">Add Family Member</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addFamilyMemberForm" method="POST" action="{{ route('family.store') }}">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="full_name" class="form-label">Full Name</label>
|
||||
<input type="text" class="form-control @error('full_name') is-invalid @enderror" id="full_name" name="full_name" value="{{ old('full_name') }}" required>
|
||||
@error('full_name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email Address <span class="text-muted">(Optional for children)</span></label>
|
||||
<input type="email" class="form-control @error('email') is-invalid @enderror" id="email" name="email" value="{{ old('email') }}">
|
||||
@error('email')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mobile" class="form-label">Mobile Number</label>
|
||||
<div class="input-group" onclick="event.stopPropagation()">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle country-dropdown-btn d-flex align-items-center" type="button" id="country_codeDropdown" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false">
|
||||
<span class="fi fi-bh me-2" id="country_codeSelectedFlag"></span>
|
||||
<span class="country-label" id="country_codeSelectedCountry">{{ old('mobile_code', '+973') }}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2" aria-labelledby="country_codeDropdown" style="min-width: 200px;" onclick="event.stopPropagation()">
|
||||
<input type="text" class="form-control form-control-sm mb-2" placeholder="Search country..." id="country_codeSearch" onkeydown="event.stopPropagation()" tabindex="0">
|
||||
<div class="country-list" id="country_codeList" style="max-height: 300px; overflow-y: auto;"></div>
|
||||
</div>
|
||||
<input type="hidden" id="country_code" name="mobile_code" value="{{ old('mobile_code', '+973') }}">
|
||||
<input id="mobile_number" type="tel" class="form-control @error('mobile') is-invalid @enderror" name="mobile" value="{{ old('mobile') }}" autocomplete="tel" placeholder="Phone number">
|
||||
</div>
|
||||
@error('mobile')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
@error('mobile_code')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="m" {{ old('gender') == 'm' ? 'selected' : '' }}>Male</option>
|
||||
<option value="f" {{ old('gender') == 'f' ? 'selected' : '' }}>Female</option>
|
||||
</select>
|
||||
@error('gender')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="birthdate" class="form-label">Birthdate</label>
|
||||
<input type="date" class="form-control @error('birthdate') is-invalid @enderror" id="birthdate" name="birthdate" value="{{ old('birthdate') }}" required>
|
||||
@error('birthdate')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="blood_type" class="form-label">Blood Type</label>
|
||||
<select class="form-select @error('blood_type') is-invalid @enderror" id="blood_type" name="blood_type">
|
||||
<option value="">Select Blood Type</option>
|
||||
<option value="A+" {{ old('blood_type') == 'A+' ? 'selected' : '' }}>A+</option>
|
||||
<option value="A-" {{ old('blood_type') == 'A-' ? 'selected' : '' }}>A-</option>
|
||||
<option value="B+" {{ old('blood_type') == 'B+' ? 'selected' : '' }}>B+</option>
|
||||
<option value="B-" {{ old('blood_type') == 'B-' ? 'selected' : '' }}>B-</option>
|
||||
<option value="AB+" {{ old('blood_type') == 'AB+' ? 'selected' : '' }}>AB+</option>
|
||||
<option value="AB-" {{ old('blood_type') == 'AB-' ? 'selected' : '' }}>AB-</option>
|
||||
<option value="O+" {{ old('blood_type') == 'O+' ? 'selected' : '' }}>O+</option>
|
||||
<option value="O-" {{ old('blood_type') == 'O-' ? 'selected' : '' }}>O-</option>
|
||||
<option value="Unknown" {{ old('blood_type') == 'Unknown' ? 'selected' : '' }}>Unknown</option>
|
||||
</select>
|
||||
@error('blood_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<x-country-dropdown
|
||||
name="nationality"
|
||||
id="nationality"
|
||||
:value="old('nationality')"
|
||||
:required="true"
|
||||
:error="$errors->first('nationality')" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<h5 class="form-label d-flex justify-content-between align-items-center">
|
||||
Social Media Links
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" id="addSocialLink">
|
||||
<i class="bi bi-plus"></i> Add Link
|
||||
</button>
|
||||
</h5>
|
||||
<div id="socialLinksContainer">
|
||||
@php
|
||||
$existingLinks = old('social_links', []);
|
||||
if (!is_array($existingLinks)) {
|
||||
$existingLinks = [];
|
||||
}
|
||||
// Convert associative array to array of arrays for form display
|
||||
$formLinks = [];
|
||||
foreach ($existingLinks as $platform => $url) {
|
||||
$formLinks[] = ['platform' => $platform, 'url' => $url];
|
||||
}
|
||||
@endphp
|
||||
@foreach($formLinks as $index => $link)
|
||||
<div class="social-link-row mb-3 d-flex align-items-end">
|
||||
<div class="me-2 flex-grow-1">
|
||||
<label class="form-label">Platform</label>
|
||||
<select class="form-select platform-select" name="social_links[{{ $index }}][platform]" required>
|
||||
<option value="">Select Platform</option>
|
||||
<option value="facebook" {{ ($link['platform'] ?? '') == 'facebook' ? 'selected' : '' }}>Facebook</option>
|
||||
<option value="twitter" {{ ($link['platform'] ?? '') == 'twitter' ? 'selected' : '' }}>Twitter/X</option>
|
||||
<option value="instagram" {{ ($link['platform'] ?? '') == 'instagram' ? 'selected' : '' }}>Instagram</option>
|
||||
<option value="linkedin" {{ ($link['platform'] ?? '') == 'linkedin' ? 'selected' : '' }}>LinkedIn</option>
|
||||
<option value="youtube" {{ ($link['platform'] ?? '') == 'youtube' ? 'selected' : '' }}>YouTube</option>
|
||||
<option value="tiktok" {{ ($link['platform'] ?? '') == 'tiktok' ? 'selected' : '' }}>TikTok</option>
|
||||
<option value="snapchat" {{ ($link['platform'] ?? '') == 'snapchat' ? 'selected' : '' }}>Snapchat</option>
|
||||
<option value="whatsapp" {{ ($link['platform'] ?? '') == 'whatsapp' ? 'selected' : '' }}>WhatsApp</option>
|
||||
<option value="telegram" {{ ($link['platform'] ?? '') == 'telegram' ? 'selected' : '' }}>Telegram</option>
|
||||
<option value="discord" {{ ($link['platform'] ?? '') == 'discord' ? 'selected' : '' }}>Discord</option>
|
||||
<option value="reddit" {{ ($link['platform'] ?? '') == 'reddit' ? 'selected' : '' }}>Reddit</option>
|
||||
<option value="pinterest" {{ ($link['platform'] ?? '') == 'pinterest' ? 'selected' : '' }}>Pinterest</option>
|
||||
<option value="twitch" {{ ($link['platform'] ?? '') == 'twitch' ? 'selected' : '' }}>Twitch</option>
|
||||
<option value="github" {{ ($link['platform'] ?? '') == 'github' ? 'selected' : '' }}>GitHub</option>
|
||||
<option value="spotify" {{ ($link['platform'] ?? '') == 'spotify' ? 'selected' : '' }}>Spotify</option>
|
||||
<option value="skype" {{ ($link['platform'] ?? '') == 'skype' ? 'selected' : '' }}>Skype</option>
|
||||
<option value="slack" {{ ($link['platform'] ?? '') == 'slack' ? 'selected' : '' }}>Slack</option>
|
||||
<option value="medium" {{ ($link['platform'] ?? '') == 'medium' ? 'selected' : '' }}>Medium</option>
|
||||
<option value="vimeo" {{ ($link['platform'] ?? '') == 'vimeo' ? 'selected' : '' }}>Vimeo</option>
|
||||
<option value="messenger" {{ ($link['platform'] ?? '') == 'messenger' ? 'selected' : '' }}>Messenger</option>
|
||||
<option value="wechat" {{ ($link['platform'] ?? '') == 'wechat' ? 'selected' : '' }}>WeChat</option>
|
||||
<option value="line" {{ ($link['platform'] ?? '') == 'line' ? 'selected' : '' }}>Line</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="me-2 flex-grow-1">
|
||||
<label class="form-label">URL</label>
|
||||
<input type="url" class="form-control" name="social_links[{{ $index }}][url]" value="{{ $link['url'] ?? '' }}" placeholder="https://example.com/username" required>
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<button type="button" class="btn btn-outline-danger btn-sm remove-social-link">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="motto" class="form-label">Personal Motto</label>
|
||||
<textarea class="form-control @error('motto') is-invalid @enderror" id="motto" name="motto" rows="3" placeholder="Enter personal motto or quote...">{{ old('motto') }}</textarea>
|
||||
<div class="form-text">Share a personal motto or quote that inspires them.</div>
|
||||
@error('motto')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="relationship_type" class="form-label">Relationship</label>
|
||||
<select class="form-select @error('relationship_type') is-invalid @enderror" id="relationship_type" name="relationship_type" required>
|
||||
<option value="">Select Relationship</option>
|
||||
<option value="son" {{ old('relationship_type') == 'son' ? 'selected' : '' }}>Son</option>
|
||||
<option value="daughter" {{ old('relationship_type') == 'daughter' ? 'selected' : '' }}>Daughter</option>
|
||||
<option value="spouse" {{ old('relationship_type') == 'spouse' ? 'selected' : '' }}>Wife</option>
|
||||
<option value="sponsor" {{ old('relationship_type') == 'sponsor' ? 'selected' : '' }}>Sponsor</option>
|
||||
<option value="other" {{ old('relationship_type') == 'other' ? 'selected' : '' }}>Other</option>
|
||||
</select>
|
||||
@error('relationship_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_billing_contact" name="is_billing_contact" value="1" {{ old('is_billing_contact') ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_billing_contact">Is Billing Contact</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" form="addFamilyMemberForm" class="btn btn-primary">Add Family Member</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.border-dashed {
|
||||
border-style: dashed !important;
|
||||
@@ -425,16 +224,6 @@
|
||||
color: #0d6efd;
|
||||
transition: color 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
/* Fix Select2 dropdown in modal */
|
||||
.select2-container--open {
|
||||
z-index: 1060;
|
||||
}
|
||||
|
||||
/* Fix custom dropdown in modal */
|
||||
.dropdown-menu {
|
||||
z-index: 1060;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
@@ -462,191 +251,6 @@
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error loading countries:', error));
|
||||
|
||||
// Social links script for modal
|
||||
let socialLinkIndex = 0;
|
||||
|
||||
// Add new social link row
|
||||
document.addEventListener('click', function(e) {
|
||||
if (e.target && e.target.id === 'addSocialLink') {
|
||||
addSocialLinkRow();
|
||||
}
|
||||
});
|
||||
|
||||
// Remove social link row
|
||||
document.addEventListener('click', function(e) {
|
||||
if (e.target.classList.contains('remove-social-link') || e.target.closest('.remove-social-link')) {
|
||||
e.target.closest('.social-link-row').remove();
|
||||
}
|
||||
});
|
||||
|
||||
function addSocialLinkRow(platform = '', url = '') {
|
||||
const container = document.getElementById('socialLinksContainer');
|
||||
if (!container) return;
|
||||
const row = document.createElement('div');
|
||||
row.className = 'social-link-row mb-3 d-flex align-items-end';
|
||||
|
||||
row.innerHTML = `
|
||||
<div class="me-2 flex-grow-1">
|
||||
<label class="form-label">Platform</label>
|
||||
<select class="form-select platform-select" name="social_links[${socialLinkIndex}][platform]" required>
|
||||
<option value="">Select Platform</option>
|
||||
<option value="facebook" ${platform === 'facebook' ? 'selected' : ''}>Facebook</option>
|
||||
<option value="twitter" ${platform === 'twitter' ? 'selected' : ''}>Twitter/X</option>
|
||||
<option value="instagram" ${platform === 'instagram' ? 'selected' : ''}>Instagram</option>
|
||||
<option value="linkedin" ${platform === 'linkedin' ? 'selected' : ''}>LinkedIn</option>
|
||||
<option value="youtube" ${platform === 'youtube' ? 'selected' : ''}>YouTube</option>
|
||||
<option value="tiktok" ${platform === 'tiktok' ? 'selected' : ''}>TikTok</option>
|
||||
<option value="snapchat" ${platform === 'snapchat' ? 'selected' : ''}>Snapchat</option>
|
||||
<option value="whatsapp" ${platform === 'whatsapp' ? 'selected' : ''}>WhatsApp</option>
|
||||
<option value="telegram" ${platform === 'telegram' ? 'selected' : ''}>Telegram</option>
|
||||
<option value="discord" ${platform === 'discord' ? 'selected' : ''}>Discord</option>
|
||||
<option value="reddit" ${platform === 'reddit' ? 'selected' : ''}>Reddit</option>
|
||||
<option value="pinterest" ${platform === 'pinterest' ? 'selected' : ''}>Pinterest</option>
|
||||
<option value="twitch" ${platform === 'twitch' ? 'selected' : ''}>Twitch</option>
|
||||
<option value="github" ${platform === 'github' ? 'selected' : ''}>GitHub</option>
|
||||
<option value="spotify" ${platform === 'spotify' ? 'selected' : ''}>Spotify</option>
|
||||
<option value="skype" ${platform === 'skype' ? 'selected' : ''}>Skype</option>
|
||||
<option value="slack" ${platform === 'slack' ? 'selected' : ''}>Slack</option>
|
||||
<option value="medium" ${platform === 'medium' ? 'selected' : ''}>Medium</option>
|
||||
<option value="vimeo" ${platform === 'vimeo' ? 'selected' : ''}>Vimeo</option>
|
||||
<option value="messenger" ${platform === 'messenger' ? 'selected' : ''}>Messenger</option>
|
||||
<option value="wechat" ${platform === 'wechat' ? 'selected' : ''}>WeChat</option>
|
||||
<option value="line" ${platform === 'line' ? 'selected' : ''}>Line</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="me-2 flex-grow-1">
|
||||
<label class="form-label">URL</label>
|
||||
<input type="url" class="form-control" name="social_links[${socialLinkIndex}][url]" value="${url}" placeholder="https://example.com/username" required>
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<button type="button" class="btn btn-outline-danger btn-sm remove-social-link">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
container.appendChild(row);
|
||||
socialLinkIndex++;
|
||||
}
|
||||
|
||||
// Mobile dropdown script for modal
|
||||
fetch('/data/countries.json')
|
||||
.then(response => response.json())
|
||||
.then(countries => {
|
||||
const listElement = document.getElementById('country_codeList');
|
||||
const selectedFlag = document.getElementById('country_codeSelectedFlag');
|
||||
const selectedCountry = document.getElementById('country_codeSelectedCountry');
|
||||
const hiddenInput = document.getElementById('country_code');
|
||||
const searchInput = document.getElementById('country_codeSearch');
|
||||
|
||||
if (!listElement) return;
|
||||
|
||||
// Populate dropdown
|
||||
countries.forEach(country => {
|
||||
const button = document.createElement('button');
|
||||
button.className = 'dropdown-item d-flex align-items-center';
|
||||
button.type = 'button';
|
||||
button.setAttribute('data-country-code', country.call_code);
|
||||
button.setAttribute('data-country-name', country.name);
|
||||
button.setAttribute('data-flag-code', country.flag);
|
||||
button.setAttribute('data-search', `${country.name.toLowerCase()} ${country.call_code}`);
|
||||
button.innerHTML = `<span class="fi fi-${country.flag.toLowerCase()} me-2"></span><span>${country.name} (${country.call_code})</span>`;
|
||||
button.addEventListener('click', function() {
|
||||
const code = this.getAttribute('data-country-code');
|
||||
const flag = this.getAttribute('data-flag-code');
|
||||
const name = this.getAttribute('data-country-name');
|
||||
if (selectedFlag) selectedFlag.className = `fi fi-${flag.toLowerCase()} me-2`;
|
||||
if (selectedCountry) selectedCountry.textContent = code;
|
||||
if (hiddenInput) hiddenInput.value = code;
|
||||
// Close dropdown
|
||||
const dropdown = bootstrap.Dropdown.getInstance(document.getElementById('country_codeDropdown'));
|
||||
if (dropdown) dropdown.hide();
|
||||
});
|
||||
listElement.appendChild(button);
|
||||
});
|
||||
|
||||
// Set initial value
|
||||
const initialValue = '{{ old('mobile_code', '+973') }}';
|
||||
if (initialValue && selectedCountry && hiddenInput) {
|
||||
hiddenInput.value = initialValue;
|
||||
selectedCountry.textContent = initialValue;
|
||||
const country = countries.find(c => c.call_code === initialValue);
|
||||
if (country && selectedFlag) {
|
||||
selectedFlag.className = `fi fi-${country.flag.toLowerCase()} me-2`;
|
||||
}
|
||||
}
|
||||
|
||||
// Search functionality
|
||||
if (searchInput) {
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchTerm = this.value.toLowerCase();
|
||||
const items = listElement.querySelectorAll('.dropdown-item');
|
||||
items.forEach(item => {
|
||||
const searchData = item.getAttribute('data-search');
|
||||
if (searchData.includes(searchTerm)) {
|
||||
item.classList.remove('d-none');
|
||||
} else {
|
||||
item.classList.add('d-none');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => console.error('Error loading countries for mobile:', error));
|
||||
|
||||
// Initialize nationality dropdown when modal is shown
|
||||
$('#addFamilyMemberModal').on('shown.bs.modal', function () {
|
||||
const selectElement = document.getElementById('nationality');
|
||||
if (selectElement && !$(selectElement).hasClass('select2-hidden-accessible')) {
|
||||
// Load countries and initialize Select2
|
||||
fetch('/data/countries.json')
|
||||
.then(response => response.json())
|
||||
.then(countries => {
|
||||
// Clear existing options except the first one
|
||||
while (selectElement.options.length > 1) {
|
||||
selectElement.remove(1);
|
||||
}
|
||||
|
||||
// Populate dropdown
|
||||
countries.forEach(country => {
|
||||
const option = document.createElement('option');
|
||||
option.value = country.iso3;
|
||||
option.textContent = country.name;
|
||||
option.setAttribute('data-flag', country.flag);
|
||||
selectElement.appendChild(option);
|
||||
});
|
||||
|
||||
// Set initial value if provided
|
||||
const initialValue = '{{ old('nationality') }}';
|
||||
if (initialValue) {
|
||||
selectElement.value = initialValue;
|
||||
}
|
||||
|
||||
// Initialize Select2
|
||||
$(selectElement).select2({
|
||||
templateResult: function(state) {
|
||||
if (!state.id) {
|
||||
return state.text;
|
||||
}
|
||||
const option = $(state.element);
|
||||
const flagCode = option.data('flag');
|
||||
return $(`<span><span class="fi fi-${flagCode} me-2"></span>${state.text}</span>`);
|
||||
},
|
||||
templateSelection: function(state) {
|
||||
if (!state.id) {
|
||||
return state.text;
|
||||
}
|
||||
const option = $(state.element);
|
||||
const flagCode = option.data('flag');
|
||||
return $(`<span><span class="fi fi-${flagCode} me-2"></span>${state.text}</span>`);
|
||||
},
|
||||
width: '100%'
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error loading countries:', error));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,906 @@
|
||||
@php
|
||||
// Helper function to calculate age at a specific date with detailed format
|
||||
function calculateAgeAtDate($birthdate, $date) {
|
||||
if (!$birthdate || !$date) return null;
|
||||
$birth = \Carbon\Carbon::parse($birthdate);
|
||||
$targetDate = \Carbon\Carbon::parse($date);
|
||||
|
||||
$diff = $birth->diff($targetDate);
|
||||
$parts = [];
|
||||
|
||||
if ($diff->y > 0) $parts[] = $diff->y . ' year' . ($diff->y > 1 ? 's' : '');
|
||||
if ($diff->m > 0) $parts[] = $diff->m . ' month' . ($diff->m > 1 ? 's' : '');
|
||||
if ($diff->d > 0) $parts[] = $diff->d . ' day' . ($diff->d > 1 ? 's' : '');
|
||||
|
||||
return implode(' ', $parts) ?: 'Same day';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-4">
|
||||
<!-- Header with Filter -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h5 class="fw-bold mb-1"><i class="bi bi-diagram-3 me-2"></i>Club Affiliations & Skills Journey</h5>
|
||||
<p class="text-muted small mb-0">Complete history of club memberships, skills acquired, and instructors</p>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<select class="form-select form-select-sm" id="skillFilter" style="width: 200px;">
|
||||
<option value="all">All Skills</option>
|
||||
@foreach($allSkills ?? [] as $skill)
|
||||
<option value="{{ $skill }}">{{ $skill }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-sm btn-outline-secondary" id="resetFilters">
|
||||
<i class="bi bi-arrow-clockwise"></i> Reset
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($clubAffiliations->count() > 0)
|
||||
<!-- Summary Stats -->
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-3">
|
||||
<div class="card shadow-sm h-100" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none;">
|
||||
<div class="card-body text-center text-white p-3">
|
||||
<i class="bi bi-building display-5 mb-2"></i>
|
||||
<h3 class="fw-bold mb-1">{{ $totalAffiliations }}</h3>
|
||||
<small class="opacity-75">Total Clubs</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card shadow-sm h-100" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); border: none;">
|
||||
<div class="card-body text-center text-white p-3">
|
||||
<i class="bi bi-star-fill display-5 mb-2"></i>
|
||||
<h3 class="fw-bold mb-1">{{ $distinctSkills }}</h3>
|
||||
<small class="opacity-75">Unique Skills</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card shadow-sm h-100" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); border: none;">
|
||||
<div class="card-body text-center text-white p-3">
|
||||
<i class="bi bi-calendar-check display-5 mb-2"></i>
|
||||
<h3 class="fw-bold mb-1">{{ floor($totalMembershipDuration / 12) }}y {{ $totalMembershipDuration % 12 }}m</h3>
|
||||
<small class="opacity-75">Total Training</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card shadow-sm h-100" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); border: none;">
|
||||
<div class="card-body text-center text-white p-3">
|
||||
<i class="bi bi-people-fill display-5 mb-2"></i>
|
||||
<h3 class="fw-bold mb-1">{{ $totalInstructors ?? 0 }}</h3>
|
||||
<small class="opacity-75">Instructors</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timeline -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-header" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none;">
|
||||
<h6 class="card-title mb-0 text-white">
|
||||
<i class="bi bi-clock-history me-2"></i>Membership Timeline
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card-body p-4" style="max-height: 800px; overflow-y: auto;">
|
||||
<div class="timeline-enhanced">
|
||||
@foreach($clubAffiliations as $index => $affiliation)
|
||||
@php
|
||||
$ageAtStart = calculateAgeAtDate($user->birthdate, $affiliation->start_date);
|
||||
$ageAtEnd = $affiliation->end_date ? calculateAgeAtDate($user->birthdate, $affiliation->end_date) : null;
|
||||
$isOngoing = !$affiliation->end_date;
|
||||
|
||||
// Get all skills for this affiliation
|
||||
$affiliationSkills = $affiliation->skillAcquisitions ?? collect();
|
||||
$skillNames = $affiliationSkills->pluck('skill_name')->unique()->implode(',');
|
||||
@endphp
|
||||
|
||||
<div class="timeline-item-enhanced mb-4" data-affiliation-id="{{ $affiliation->id }}" data-skills="{{ $skillNames }}">
|
||||
<!-- Timeline Marker -->
|
||||
<div class="timeline-marker-enhanced {{ $isOngoing ? 'pulse' : '' }}"></div>
|
||||
|
||||
<!-- Affiliation Card -->
|
||||
<div class="affiliation-card-enhanced card border-0 shadow-sm">
|
||||
<!-- Card Header with Gradient -->
|
||||
<div class="card-header border-0 p-3" style="background: linear-gradient(135deg, {{ $index % 4 == 0 ? '#667eea 0%, #764ba2' : ($index % 4 == 1 ? '#f093fb 0%, #f5576c' : ($index % 4 == 2 ? '#4facfe 0%, #00f2fe' : '#fa709a 0%, #fee140')) }} 100%);">
|
||||
<div class="d-flex align-items-center">
|
||||
@if($affiliation->logo)
|
||||
<img src="{{ asset('storage/' . $affiliation->logo) }}" alt="{{ $affiliation->club_name }}" class="rounded-circle me-3" style="width: 50px; height: 50px; object-fit: cover; border: 3px solid white;">
|
||||
@else
|
||||
<div class="rounded-circle bg-white d-flex align-items-center justify-content-center me-3" style="width: 50px; height: 50px;">
|
||||
<i class="bi bi-building" style="font-size: 1.5rem; color: #667eea;"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex-grow-1 text-white">
|
||||
<h5 class="mb-1 fw-bold">{{ $affiliation->club_name }}</h5>
|
||||
<div class="d-flex gap-3 flex-wrap">
|
||||
<small class="opacity-90">
|
||||
<i class="bi bi-calendar-event me-1"></i>{{ $affiliation->start_date->format('M Y') }} - {{ $isOngoing ? 'Present' : $affiliation->end_date->format('M Y') }}
|
||||
</small>
|
||||
<small class="opacity-90">
|
||||
<i class="bi bi-hourglass-split me-1"></i>{{ $affiliation->formatted_duration }}
|
||||
</small>
|
||||
@if($ageAtStart)
|
||||
<small class="opacity-90">
|
||||
<i class="bi bi-person me-1"></i>Age: {{ $ageAtStart }}{{ $ageAtEnd && $ageAtEnd != $ageAtStart ? " to $ageAtEnd" : '' }}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@if($isOngoing)
|
||||
<span class="badge bg-success">
|
||||
<i class="bi bi-circle-fill me-1" style="font-size: 0.5rem;"></i>Active
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card Body -->
|
||||
<div class="card-body p-3">
|
||||
@if($affiliation->location)
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-geo-alt text-primary me-2"></i>
|
||||
<span class="text-muted">{{ $affiliation->location }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Skills Acquired as Badges -->
|
||||
@if($affiliationSkills->count() > 0)
|
||||
<div class="mb-3">
|
||||
<h6 class="fw-bold mb-2">
|
||||
<i class="bi bi-star-fill me-2 text-warning"></i>Skills Acquired ({{ $affiliationSkills->count() }})
|
||||
</h6>
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
@foreach($affiliationSkills as $skill)
|
||||
<span class="badge skill-badge bg-{{ $skill->proficiency_level == 'expert' ? 'danger' : ($skill->proficiency_level == 'advanced' ? 'warning' : ($skill->proficiency_level == 'intermediate' ? 'info' : 'secondary')) }}"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
data-bs-html="true"
|
||||
title="<strong>{{ $skill->skill_name }}</strong><br>
|
||||
Proficiency: {{ ucfirst($skill->proficiency_level) }}<br>
|
||||
Duration: {{ $skill->formatted_duration }}<br>
|
||||
@if($skill->instructor)Instructor: {{ $skill->instructor->user->full_name ?? 'Unknown' }}<br>@endif
|
||||
Started: {{ $skill->start_date->format('M Y') }}">
|
||||
<i class="bi bi-star-fill me-1"></i>{{ $skill->skill_name }}
|
||||
<span class="badge bg-white text-dark ms-1" style="font-size: 0.65rem;">{{ ucfirst($skill->proficiency_level) }}</span>
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Training Packages -->
|
||||
@if($affiliation->subscriptions && $affiliation->subscriptions->count() > 0)
|
||||
<div class="mb-3">
|
||||
<h6 class="fw-bold mb-2">
|
||||
<i class="bi bi-box-seam me-2 text-primary"></i>Training Packages ({{ $affiliation->subscriptions->count() }})
|
||||
</h6>
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
@foreach($affiliation->subscriptions as $subIndex => $subscription)
|
||||
@if($subscription->package)
|
||||
<button type="button" class="btn btn-sm btn-outline-primary package-card-btn"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#packageModal_{{ $affiliation->id }}_{{ $subscription->id }}">
|
||||
<i class="bi bi-box me-1"></i>{{ $subscription->package->name }}
|
||||
</button>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Instructors -->
|
||||
@php
|
||||
$instructors = $affiliationSkills->pluck('instructor')->filter()->unique('id');
|
||||
@endphp
|
||||
@if($instructors->count() > 0)
|
||||
<div class="mb-2">
|
||||
<h6 class="fw-bold mb-2">
|
||||
<i class="bi bi-people-fill me-2 text-success"></i>Instructors ({{ $instructors->count() }})
|
||||
</h6>
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
@foreach($instructors as $instructor)
|
||||
<div class="instructor-badge" role="button"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#instructorModal_{{ $instructor->id }}">
|
||||
<div class="d-flex align-items-center gap-2 p-2 bg-light rounded">
|
||||
<div class="rounded-circle bg-success text-white d-flex align-items-center justify-content-center" style="width: 32px; height: 32px; font-size: 0.8rem;">
|
||||
{{ strtoupper(substr($instructor->user->full_name ?? 'I', 0, 1)) }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="fw-semibold small">{{ $instructor->user->full_name ?? 'Unknown' }}</div>
|
||||
<div class="text-muted" style="font-size: 0.7rem;">{{ $instructor->role ?? 'Instructor' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<!-- Instructor Modals -->
|
||||
@php
|
||||
$allInstructors = collect();
|
||||
foreach($clubAffiliations as $aff) {
|
||||
$affInstructors = $aff->skillAcquisitions->pluck('instructor')->filter()->unique('id');
|
||||
$allInstructors = $allInstructors->merge($affInstructors);
|
||||
}
|
||||
$allInstructors = $allInstructors->unique('id');
|
||||
@endphp
|
||||
|
||||
@foreach($allInstructors as $instructor)
|
||||
<div class="modal fade" id="instructorModal_{{ $instructor->id }}" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" style="max-width: 600px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);">
|
||||
<h5 class="modal-title text-white">
|
||||
<i class="bi bi-person-badge me-2"></i>Instructor Profile
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body" style="max-height: 70vh; overflow-y: auto;">
|
||||
<div class="text-center mb-4">
|
||||
<!-- Profile Picture -->
|
||||
<div class="mb-3">
|
||||
@if($instructor->user->profile_picture)
|
||||
<img src="{{ asset('storage/' . $instructor->user->profile_picture) }}"
|
||||
alt="{{ $instructor->user->full_name }}"
|
||||
class="rounded-circle"
|
||||
style="width: 100px; height: 100px; object-fit: cover; border: 4px solid #11998e;">
|
||||
@else
|
||||
<div class="rounded-circle mx-auto d-flex align-items-center justify-content-center text-white"
|
||||
style="width: 100px; height: 100px; font-size: 2.5rem; background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);">
|
||||
{{ strtoupper(substr($instructor->user->full_name ?? 'I', 0, 1)) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Name & Role -->
|
||||
<h5 class="fw-bold mb-1">{{ $instructor->user->full_name ?? 'Unknown Instructor' }}</h5>
|
||||
<p class="text-muted mb-2">{{ $instructor->role ?? 'Instructor' }}</p>
|
||||
|
||||
<!-- Average Rating -->
|
||||
@php
|
||||
$avgRating = $instructor->reviews()->avg('rating') ?? 0;
|
||||
$reviewCount = $instructor->reviews()->count();
|
||||
@endphp
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
||||
<div class="stars-display">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="bi bi-star{{ $i <= round($avgRating) ? '-fill' : '' }} text-warning"></i>
|
||||
@endfor
|
||||
</div>
|
||||
<span class="text-muted small">({{ number_format($avgRating, 1) }} / {{ $reviewCount }} {{ $reviewCount == 1 ? 'review' : 'reviews' }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Stats -->
|
||||
<div class="row g-2 mb-3">
|
||||
@php
|
||||
$instructorSkills = \App\Models\SkillAcquisition::where('instructor_id', $instructor->id)->get();
|
||||
$studentsCount = $instructorSkills->pluck('clubAffiliation.member_id')->unique()->count();
|
||||
$skillsTaught = $instructorSkills->pluck('skill_name')->unique();
|
||||
@endphp
|
||||
<div class="col-6">
|
||||
<div class="card bg-light border-0">
|
||||
<div class="card-body p-2">
|
||||
<div class="h4 mb-0 text-primary">{{ $studentsCount }}</div>
|
||||
<small class="text-muted">Students</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="card bg-light border-0">
|
||||
<div class="card-body p-2">
|
||||
<div class="h4 mb-0 text-success">{{ $skillsTaught->count() }}</div>
|
||||
<small class="text-muted">Skills</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Skills Taught -->
|
||||
@if($skillsTaught->count() > 0)
|
||||
<div class="mb-3 text-start">
|
||||
<label class="text-muted small fw-semibold mb-2">Specializes In:</label>
|
||||
<div class="d-flex gap-1 flex-wrap">
|
||||
@foreach($skillsTaught as $skill)
|
||||
<span class="badge bg-success">{{ $skill }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Contact Info -->
|
||||
@if($instructor->user->email)
|
||||
<div class="mb-2 text-start">
|
||||
<small class="text-muted">
|
||||
<i class="bi bi-envelope me-1"></i>{{ $instructor->user->email }}
|
||||
</small>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($instructor->user->mobile)
|
||||
<div class="mb-3 text-start">
|
||||
<small class="text-muted">
|
||||
<i class="bi bi-phone me-1"></i>{{ $instructor->user->mobile }}
|
||||
</small>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Reviews Section -->
|
||||
<div class="mt-4">
|
||||
<h6 class="fw-bold mb-3">
|
||||
<i class="bi bi-chat-left-text me-2"></i>Reviews
|
||||
</h6>
|
||||
|
||||
<!-- Add/Edit Review Form -->
|
||||
@php
|
||||
$userReview = $instructor->reviews()->where('reviewer_user_id', auth()->id())->first();
|
||||
@endphp
|
||||
|
||||
<div class="card bg-light mb-3" id="reviewForm_{{ $instructor->id }}">
|
||||
<div class="card-body">
|
||||
<form class="instructor-review-form" data-instructor-id="{{ $instructor->id }}" data-review-id="{{ $userReview->id ?? '' }}">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Your Rating</label>
|
||||
<div class="star-rating" data-rating="{{ $userReview->rating ?? 0 }}">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="bi bi-star{{ $userReview && $i <= $userReview->rating ? '-fill' : '' }} star-input" data-value="{{ $i }}"></i>
|
||||
@endfor
|
||||
</div>
|
||||
<input type="hidden" name="rating" value="{{ $userReview->rating ?? 0 }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Your Review</label>
|
||||
<textarea name="comment" class="form-control form-control-sm" rows="3" placeholder="Share your experience...">{{ $userReview->comment ?? '' }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success btn-sm w-100">
|
||||
<i class="bi bi-{{ $userReview ? 'pencil' : 'plus-circle' }} me-1"></i>
|
||||
{{ $userReview ? 'Update Review' : 'Submit Review' }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reviews List -->
|
||||
<div class="reviews-list" id="reviewsList_{{ $instructor->id }}">
|
||||
@foreach($instructor->reviews()->with('reviewer')->latest()->get() as $review)
|
||||
<div class="card mb-2">
|
||||
<div class="card-body p-3">
|
||||
<div class="d-flex align-items-start mb-2">
|
||||
<div class="flex-grow-1">
|
||||
<div class="fw-semibold small">{{ $review->reviewer->full_name }}</div>
|
||||
<div class="stars-display small">
|
||||
@for($i = 1; $i <= 5; $i++)
|
||||
<i class="bi bi-star{{ $i <= $review->rating ? '-fill' : '' }} text-warning"></i>
|
||||
@endfor
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
{{ $review->wasUpdated() ? 'Updated ' : '' }}{{ $review->wasUpdated() ? $review->updated_at->diffForHumans() : $review->reviewed_at->diffForHumans() }}
|
||||
</small>
|
||||
</div>
|
||||
@if($review->comment)
|
||||
<p class="mb-0 small text-muted">{{ $review->comment }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="{{ route('family.show', $instructor->user_id) }}" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-person-lines-fill me-1"></i>View Full Profile
|
||||
</a>
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<!-- Package Modals (Outside Timeline Loop) -->
|
||||
@foreach($clubAffiliations as $affiliation)
|
||||
@foreach($affiliation->subscriptions as $subIndex => $subscription)
|
||||
@if($subscription->package)
|
||||
<div class="modal fade" id="packageModal_{{ $affiliation->id }}_{{ $subscription->id }}" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
||||
<h5 class="modal-title text-white">
|
||||
<i class="bi bi-box-seam me-2"></i>{{ $subscription->package->name }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label class="text-muted small fw-semibold">Subscription Period</label>
|
||||
<div>
|
||||
<i class="bi bi-calendar-range me-2 text-primary"></i>
|
||||
{{ $subscription->start_date->format('M d, Y') }} - {{ $subscription->end_date->format('M d, Y') }}
|
||||
</div>
|
||||
@php
|
||||
$duration = $subscription->start_date->diff($subscription->end_date);
|
||||
$durationParts = [];
|
||||
if ($duration->y > 0) $durationParts[] = $duration->y . ' year' . ($duration->y > 1 ? 's' : '');
|
||||
if ($duration->m > 0) $durationParts[] = $duration->m . ' month' . ($duration->m > 1 ? 's' : '');
|
||||
if ($duration->d > 0) $durationParts[] = $duration->d . ' day' . ($duration->d > 1 ? 's' : '');
|
||||
$durationText = implode(' ', $durationParts) ?: 'Same day';
|
||||
@endphp
|
||||
<small class="text-muted">
|
||||
<i class="bi bi-hourglass-split me-1"></i>Duration: {{ $durationText }}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
@if($subscription->package->description)
|
||||
<div class="mb-3">
|
||||
<label class="text-muted small fw-semibold">Description</label>
|
||||
<p class="mb-0">{{ $subscription->package->description }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($subscription->package->price)
|
||||
<div class="mb-3">
|
||||
<label class="text-muted small fw-semibold">Price</label>
|
||||
<div class="h5 mb-0 text-success">
|
||||
<i class="bi bi-currency-dollar"></i>{{ number_format($subscription->package->price, 2) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($subscription->package->packageActivities && $subscription->package->packageActivities->count() > 0)
|
||||
<div class="mb-3">
|
||||
<label class="text-muted small fw-semibold">Activities & Skills Included</label>
|
||||
<div class="list-group">
|
||||
@foreach($subscription->package->packageActivities as $pkgActivity)
|
||||
@if($pkgActivity->activity)
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex align-items-start mb-2">
|
||||
<i class="bi bi-check-circle-fill text-success me-2 mt-1"></i>
|
||||
<div class="flex-grow-1">
|
||||
<div class="fw-semibold">{{ $pkgActivity->activity->name }}</div>
|
||||
@if($pkgActivity->activity->description)
|
||||
<small class="text-muted d-block mb-2">{{ $pkgActivity->activity->description }}</small>
|
||||
@endif
|
||||
|
||||
@php
|
||||
// Get skills taught in this activity
|
||||
$activitySkills = \App\Models\SkillAcquisition::where('activity_id', $pkgActivity->activity_id)
|
||||
->where('club_affiliation_id', $affiliation->id)
|
||||
->get();
|
||||
@endphp
|
||||
|
||||
@if($activitySkills->count() > 0)
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block mb-1">Skills Practiced:</small>
|
||||
<div class="d-flex gap-1 flex-wrap">
|
||||
@foreach($activitySkills as $actSkill)
|
||||
<span class="badge bg-{{ $actSkill->proficiency_level == 'expert' ? 'danger' : ($actSkill->proficiency_level == 'advanced' ? 'warning' : ($actSkill->proficiency_level == 'intermediate' ? 'info' : 'secondary')) }}" style="font-size: 0.7rem;">
|
||||
<i class="bi bi-star-fill me-1"></i>{{ $actSkill->skill_name }}
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if($pkgActivity->instructor && $pkgActivity->instructor->user)
|
||||
<div class="text-end">
|
||||
<small class="text-muted">
|
||||
<i class="bi bi-person-badge"></i>
|
||||
{{ $pkgActivity->instructor->user->full_name }}
|
||||
</small>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@php
|
||||
// Check if this package was subscribed to multiple times
|
||||
$samePackageSubscriptions = $affiliation->subscriptions
|
||||
->where('package_id', $subscription->package_id)
|
||||
->where('id', '!=', $subscription->id);
|
||||
@endphp
|
||||
|
||||
@if($samePackageSubscriptions->count() > 0)
|
||||
<div class="mb-3">
|
||||
<label class="text-muted small fw-semibold">
|
||||
<i class="bi bi-arrow-repeat me-1"></i>Other Subscriptions to This Package
|
||||
</label>
|
||||
<div class="alert alert-info mb-0" style="font-size: 0.85rem;">
|
||||
<div class="fw-semibold mb-1">You subscribed to this package {{ $samePackageSubscriptions->count() + 1 }} times:</div>
|
||||
<ul class="mb-0 ps-3">
|
||||
<li class="text-primary fw-semibold">
|
||||
{{ $subscription->start_date->format('M d, Y') }} - {{ $subscription->end_date->format('M d, Y') }} (Current)
|
||||
</li>
|
||||
@foreach($samePackageSubscriptions as $otherSub)
|
||||
<li>
|
||||
{{ $otherSub->start_date->format('M d, Y') }} - {{ $otherSub->end_date->format('M d, Y') }}
|
||||
@php
|
||||
$gap = $subscription->start_date->diffInMonths($otherSub->start_date);
|
||||
@endphp
|
||||
@if($gap > 0)
|
||||
<small class="text-muted">({{ abs($gap) }} months {{ $subscription->start_date->gt($otherSub->start_date) ? 'before' : 'after' }} current)</small>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mb-0">
|
||||
<label class="text-muted small fw-semibold">Status</label>
|
||||
<div>
|
||||
<span class="badge bg-{{ $subscription->status == 'active' ? 'success' : 'secondary' }}">
|
||||
{{ ucfirst($subscription->status) }}
|
||||
</span>
|
||||
<span class="badge bg-{{ $subscription->payment_status == 'paid' ? 'success' : 'warning' }} ms-2">
|
||||
Payment: {{ ucfirst($subscription->payment_status) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-diagram-3 text-muted" style="font-size: 3rem;"></i>
|
||||
<h5 class="text-muted mt-3 mb-2">No Affiliations Yet</h5>
|
||||
<p class="text-muted mb-0">Club affiliations and skills will appear here once added</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Enhanced Timeline Styles */
|
||||
.timeline-enhanced {
|
||||
position: relative;
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
.timeline-enhanced::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.timeline-item-enhanced {
|
||||
position: relative;
|
||||
animation: fadeInUp 0.5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-marker-enhanced {
|
||||
position: absolute;
|
||||
left: -28px;
|
||||
top: 25px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: 3px solid #fff;
|
||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.timeline-marker-enhanced.pulse {
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% {
|
||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.affiliation-card-enhanced {
|
||||
transition: all 0.3s ease;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.affiliation-card-enhanced:hover {
|
||||
transform: translateX(5px);
|
||||
box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
|
||||
}
|
||||
|
||||
.skill-badge {
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.skill-badge:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.package-card-btn {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.package-card-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.instructor-badge {
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.instructor-badge:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.instructor-badge:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* Star Rating Styles */
|
||||
.star-rating {
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.star-rating .star-input {
|
||||
color: #ddd;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.star-rating .star-input:hover,
|
||||
.star-rating .star-input.active {
|
||||
color: #ffc107;
|
||||
}
|
||||
|
||||
.star-rating .bi-star-fill {
|
||||
color: #ffc107;
|
||||
}
|
||||
|
||||
.stars-display {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.stars-display .bi-star-fill {
|
||||
color: #ffc107;
|
||||
}
|
||||
|
||||
.stars-display .bi-star {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
/* Filter transition */
|
||||
.timeline-item-enhanced.filtered-out {
|
||||
display: none;
|
||||
animation: fadeOut 0.3s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const skillFilter = document.getElementById('skillFilter');
|
||||
const resetButton = document.getElementById('resetFilters');
|
||||
const timelineItems = document.querySelectorAll('.timeline-item-enhanced');
|
||||
|
||||
// Initialize Bootstrap tooltips
|
||||
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
});
|
||||
|
||||
// Star Rating Functionality
|
||||
document.querySelectorAll('.star-rating').forEach(ratingContainer => {
|
||||
const stars = ratingContainer.querySelectorAll('.star-input');
|
||||
const ratingInput = ratingContainer.parentElement.querySelector('input[name="rating"]');
|
||||
|
||||
stars.forEach((star, index) => {
|
||||
star.addEventListener('click', function() {
|
||||
const value = this.getAttribute('data-value');
|
||||
ratingInput.value = value;
|
||||
|
||||
// Update star display
|
||||
stars.forEach((s, i) => {
|
||||
if (i < value) {
|
||||
s.classList.remove('bi-star');
|
||||
s.classList.add('bi-star-fill');
|
||||
} else {
|
||||
s.classList.remove('bi-star-fill');
|
||||
s.classList.add('bi-star');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
star.addEventListener('mouseenter', function() {
|
||||
const value = this.getAttribute('data-value');
|
||||
stars.forEach((s, i) => {
|
||||
if (i < value) {
|
||||
s.classList.add('active');
|
||||
} else {
|
||||
s.classList.remove('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
ratingContainer.addEventListener('mouseleave', function() {
|
||||
stars.forEach(s => s.classList.remove('active'));
|
||||
});
|
||||
});
|
||||
|
||||
// Review Form Submission
|
||||
document.querySelectorAll('.instructor-review-form').forEach(form => {
|
||||
form.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const instructorId = this.getAttribute('data-instructor-id');
|
||||
const reviewId = this.getAttribute('data-review-id');
|
||||
const formData = new FormData(this);
|
||||
const data = {
|
||||
rating: formData.get('rating'),
|
||||
comment: formData.get('comment')
|
||||
};
|
||||
|
||||
// Validate rating
|
||||
if (!data.rating || data.rating == 0) {
|
||||
alert('Please select a rating');
|
||||
return;
|
||||
}
|
||||
|
||||
const url = reviewId
|
||||
? `/instructor/reviews/${reviewId}`
|
||||
: `/instructor/${instructorId}/reviews`;
|
||||
|
||||
const method = reviewId ? 'PUT' : 'POST';
|
||||
|
||||
fetch(url, {
|
||||
method: method,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content')
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.success) {
|
||||
// Show success message
|
||||
showAlert(result.message, 'success');
|
||||
|
||||
// Reload the page to show updated reviews
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
} else {
|
||||
showAlert(result.message || 'Error submitting review', 'danger');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
showAlert('Error submitting review. Please try again.', 'danger');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function showAlert(message, type) {
|
||||
const alertDiv = document.createElement('div');
|
||||
alertDiv.className = `alert alert-${type} alert-dismissible fade show position-fixed`;
|
||||
alertDiv.style.cssText = 'top: 20px; right: 20px; z-index: 9999; min-width: 300px;';
|
||||
alertDiv.innerHTML = `
|
||||
${message}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
`;
|
||||
document.body.appendChild(alertDiv);
|
||||
|
||||
setTimeout(() => {
|
||||
if (alertDiv.parentNode) {
|
||||
alertDiv.remove();
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
if (skillFilter) {
|
||||
skillFilter.addEventListener('change', function() {
|
||||
const selectedSkill = this.value;
|
||||
|
||||
timelineItems.forEach(item => {
|
||||
const itemSkills = item.getAttribute('data-skills');
|
||||
|
||||
if (selectedSkill === 'all') {
|
||||
item.classList.remove('filtered-out');
|
||||
item.style.display = '';
|
||||
} else {
|
||||
if (itemSkills && itemSkills.includes(selectedSkill)) {
|
||||
item.classList.remove('filtered-out');
|
||||
item.style.display = '';
|
||||
} else {
|
||||
item.classList.add('filtered-out');
|
||||
setTimeout(() => {
|
||||
item.style.display = 'none';
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (resetButton) {
|
||||
resetButton.addEventListener('click', function() {
|
||||
if (skillFilter) {
|
||||
skillFilter.value = 'all';
|
||||
skillFilter.dispatchEvent(new Event('change'));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -10,34 +10,26 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Profile Picture Section -->
|
||||
<div class="mb-4 text-center">
|
||||
<div class="mb-3">
|
||||
@if($user->profile_picture && file_exists(public_path('storage/' . $user->profile_picture)))
|
||||
<img src="{{ asset('storage/' . $user->profile_picture) }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.png')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.png') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.jpg')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.jpg') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.jpeg')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.jpeg') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@else
|
||||
<div style="width: 300px; height: 400px; background-color: #f0f0f0; border: 3px solid #dee2e6; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 0 auto;">
|
||||
<div class="text-center">
|
||||
<i class="bi bi-person-circle" style="font-size: 100px; color: #dee2e6;"></i>
|
||||
<p class="text-muted mt-2">No profile picture</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<x-takeone-cropper
|
||||
@php
|
||||
$currentProfileImage = '';
|
||||
|
||||
// Check user's profile_picture field first (set by upload controller)
|
||||
if ($user->profile_picture && file_exists(public_path('storage/' . $user->profile_picture))) {
|
||||
$currentProfileImage = asset('storage/' . $user->profile_picture);
|
||||
} else {
|
||||
// Fallback: check for files with common extensions
|
||||
$extensions = ['png', 'jpg', 'jpeg', 'webp'];
|
||||
foreach ($extensions as $ext) {
|
||||
$path = 'storage/images/profiles/profile_' . $user->id . '.' . $ext;
|
||||
if (file_exists(public_path($path))) {
|
||||
$currentProfileImage = asset($path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<div class="mb-4">
|
||||
<x-image-upload
|
||||
id="profile_picture"
|
||||
width="300"
|
||||
height="400"
|
||||
@@ -45,6 +37,10 @@
|
||||
folder="images/profiles"
|
||||
filename="profile_{{ $user->id }}"
|
||||
uploadUrl="{{ route('profile.upload-picture') }}"
|
||||
currentImage="{{ $currentProfileImage }}"
|
||||
placeholder="No profile picture"
|
||||
placeholderIcon="bi-person-circle"
|
||||
buttonText="Change Photo"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -69,45 +65,44 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mobile" class="form-label">Mobile Number</label>
|
||||
<div class="input-group" onclick="event.stopPropagation()">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle country-dropdown-btn d-flex align-items-center" type="button" id="country_codeDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="fi fi-bh me-2" id="country_codeSelectedFlag"></span>
|
||||
<span class="country-label" id="country_codeSelectedCountry">{{ old('mobile_code', $user->mobile_code ?? '+973') }}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2" aria-labelledby="country_codeDropdown" style="min-width: 200px;" onclick="event.stopPropagation()">
|
||||
<input type="text" class="form-control form-control-sm mb-2" placeholder="Search country..." id="country_codeSearch" onkeydown="event.stopPropagation()">
|
||||
<div class="country-list" id="country_codeList" style="max-height: 300px; overflow-y: auto;"></div>
|
||||
</div>
|
||||
<input type="hidden" id="country_code" name="mobile_code" value="{{ old('mobile_code', $user->mobile['code'] ?? '+973') }}" required="">
|
||||
<input id="mobile_number" type="tel" class="form-control @error('mobile') is-invalid @enderror" name="mobile" value="{{ old('mobile', $user->mobile['number'] ?? '') }}" required="" autocomplete="tel" placeholder="Phone number">
|
||||
</div>
|
||||
<label for="mobile_number" class="form-label">Mobile Number</label>
|
||||
<x-country-code-dropdown
|
||||
name="mobile_code"
|
||||
id="country_code"
|
||||
:value="old('mobile_code', $user->mobile['code'] ?? '+973')"
|
||||
:required="true"
|
||||
:error="$errors->first('mobile_code')">
|
||||
<input id="mobile_number" type="tel"
|
||||
class="form-control @error('mobile') is-invalid @enderror"
|
||||
name="mobile"
|
||||
value="{{ old('mobile', $user->mobile['number'] ?? '') }}"
|
||||
required autocomplete="tel"
|
||||
placeholder="Phone number">
|
||||
</x-country-code-dropdown>
|
||||
@error('mobile')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
@error('mobile_code')
|
||||
<div class="invalid-feedback d-block">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="m" {{ old('gender', $user->gender) == 'm' ? 'selected' : '' }}>Male</option>
|
||||
<option value="f" {{ old('gender', $user->gender) == 'f' ? 'selected' : '' }}>Female</option>
|
||||
</select>
|
||||
@error('gender')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<x-gender-dropdown
|
||||
name="gender"
|
||||
id="gender"
|
||||
:value="old('gender', $user->gender)"
|
||||
:required="true"
|
||||
:error="$errors->first('gender')" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="birthdate" class="form-label">Birthdate</label>
|
||||
<input type="date" class="form-control @error('birthdate') is-invalid @enderror" id="birthdate" name="birthdate" value="{{ old('birthdate', $user->birthdate->format('Y-m-d')) }}" required>
|
||||
@error('birthdate')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<x-birthdate-dropdown
|
||||
name="birthdate"
|
||||
id="birthdate"
|
||||
label="Birthdate"
|
||||
:value="old('birthdate', $user->birthdate?->format('Y-m-d'))"
|
||||
:required="true"
|
||||
:min-age="10"
|
||||
:max-age="120"
|
||||
:error="$errors->first('birthdate')" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +126,7 @@
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<x-country-dropdown
|
||||
<x-nationality-dropdown
|
||||
name="nationality"
|
||||
id="nationality"
|
||||
:value="old('nationality', $user->nationality)"
|
||||
@@ -227,69 +222,6 @@
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Load countries for mobile code dropdown
|
||||
fetch('/data/countries.json')
|
||||
.then(response => response.json())
|
||||
.then(countries => {
|
||||
const listElement = document.getElementById('country_codeList');
|
||||
const selectedFlag = document.getElementById('country_codeSelectedFlag');
|
||||
const selectedCountry = document.getElementById('country_codeSelectedCountry');
|
||||
const hiddenInput = document.getElementById('country_code');
|
||||
const searchInput = document.getElementById('country_codeSearch');
|
||||
|
||||
if (!listElement) return;
|
||||
|
||||
// Populate dropdown
|
||||
countries.forEach(country => {
|
||||
const button = document.createElement('button');
|
||||
button.className = 'dropdown-item d-flex align-items-center';
|
||||
button.type = 'button';
|
||||
button.setAttribute('data-country-code', country.call_code);
|
||||
button.setAttribute('data-country-name', country.name);
|
||||
button.setAttribute('data-flag-code', country.flag);
|
||||
button.setAttribute('data-search', `${country.name.toLowerCase()} ${country.call_code}`);
|
||||
button.innerHTML = `<span class="fi fi-${country.flag.toLowerCase()} me-2"></span><span>${country.name} (${country.call_code})</span>`;
|
||||
button.addEventListener('click', function() {
|
||||
const code = this.getAttribute('data-country-code');
|
||||
const flag = this.getAttribute('data-flag-code');
|
||||
const name = this.getAttribute('data-country-name');
|
||||
selectedFlag.className = `fi fi-${flag.toLowerCase()} me-2`;
|
||||
selectedCountry.textContent = code;
|
||||
hiddenInput.value = code;
|
||||
// Close dropdown
|
||||
const dropdown = bootstrap.Dropdown.getInstance(document.getElementById('country_codeDropdown'));
|
||||
if (dropdown) dropdown.hide();
|
||||
});
|
||||
listElement.appendChild(button);
|
||||
});
|
||||
|
||||
// Set initial value
|
||||
const initialValue = '{{ old('mobile_code', $user->mobile['code'] ?? '+973') }}';
|
||||
if (initialValue) {
|
||||
hiddenInput.value = initialValue;
|
||||
selectedCountry.textContent = initialValue;
|
||||
const country = countries.find(c => c.call_code === initialValue);
|
||||
if (country) {
|
||||
selectedFlag.className = `fi fi-${country.flag.toLowerCase()} me-2`;
|
||||
}
|
||||
}
|
||||
|
||||
// Search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchTerm = this.value.toLowerCase();
|
||||
const items = listElement.querySelectorAll('.dropdown-item');
|
||||
items.forEach(item => {
|
||||
const searchData = item.getAttribute('data-search');
|
||||
if (searchData.includes(searchTerm)) {
|
||||
item.style.display = '';
|
||||
} else {
|
||||
item.style.display = 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error loading countries:', error));
|
||||
|
||||
let socialLinkIndex = {{ count($formLinks ?? []) }};
|
||||
|
||||
// Add new social link row
|
||||
@@ -355,4 +287,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@stack('styles')
|
||||
@endsection
|
||||
@@ -988,129 +988,13 @@
|
||||
|
||||
<!-- Affiliations Tab -->
|
||||
<div class="tab-pane fade" id="affiliations" role="tabpanel">
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="fw-bold mb-3"><i class="bi bi-diagram-3 me-2"></i>Affiliations & Skills</h5>
|
||||
|
||||
@if($clubAffiliations->count() > 0)
|
||||
<!-- Summary Stats -->
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm bg-primary text-white">
|
||||
<div class="card-body text-center">
|
||||
<i class="bi bi-building display-4 mb-2"></i>
|
||||
<h4 class="fw-bold mb-1">{{ $totalAffiliations }}</h4>
|
||||
<small>Total Affiliations</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm bg-success text-white">
|
||||
<div class="card-body text-center">
|
||||
<i class="bi bi-star display-4 mb-2"></i>
|
||||
<h4 class="fw-bold mb-1">{{ $distinctSkills }}</h4>
|
||||
<small>Distinct Skills</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm bg-info text-white">
|
||||
<div class="card-body text-center">
|
||||
<i class="bi bi-calendar-check display-4 mb-2"></i>
|
||||
<h4 class="fw-bold mb-1">{{ floor($totalMembershipDuration / 12) }}y {{ $totalMembershipDuration % 12 }}m</h4>
|
||||
<small>Total Membership</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timeline and Skills Wheel Container -->
|
||||
<div class="row">
|
||||
<!-- Timeline -->
|
||||
<div class="col-lg-6 mb-4">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h6 class="card-title mb-0"><i class="bi bi-timeline me-2"></i>Club Affiliations Timeline</h6>
|
||||
</div>
|
||||
<div class="card-body" style="max-height: 600px; overflow-y: auto;">
|
||||
<div class="timeline">
|
||||
@foreach($clubAffiliations as $index => $affiliation)
|
||||
<div class="timeline-item mb-4 position-relative" data-affiliation-id="{{ $affiliation->id }}">
|
||||
<div class="timeline-marker bg-primary"></div>
|
||||
<div class="timeline-content card border {{ $index === 0 ? 'border-primary' : '' }} affiliation-card" style="cursor: pointer;" data-affiliation-id="{{ $affiliation->id }}">
|
||||
<div class="card-body p-3">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
@if($affiliation->logo)
|
||||
<img src="{{ asset('storage/' . $affiliation->logo) }}" alt="{{ $affiliation->club_name }}" class="me-3 rounded" style="width: 40px; height: 40px; object-fit: cover;">
|
||||
@else
|
||||
<div class="bg-primary text-white rounded d-flex align-items-center justify-content-center me-3" style="width: 40px; height: 40px;">
|
||||
<i class="bi bi-building"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="mb-0 fw-bold">{{ $affiliation->club_name }}</h6>
|
||||
<small class="text-muted">{{ $affiliation->date_range }}</small>
|
||||
<br>
|
||||
<span class="badge bg-info text-dark small">{{ $affiliation->formatted_duration }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@if($affiliation->location)
|
||||
<div class="text-muted small mb-1">
|
||||
<i class="bi bi-geo-alt me-1"></i>{{ $affiliation->location }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="text-muted small">
|
||||
<i class="bi bi-star me-1"></i>{{ $affiliation->skillAcquisitions->count() }} skills acquired
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Skills Wheel and Details -->
|
||||
<div class="col-lg-6">
|
||||
<!-- Skills Wheel -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h6 class="card-title mb-0"><i class="bi bi-pie-chart me-2"></i>Skills Wheel</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
<canvas id="skillsChart" width="300" height="300"></canvas>
|
||||
<p id="noSkillsMessage" class="text-muted mt-3 d-none">Select an affiliation to view skills</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Affiliation Details -->
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h6 class="card-title mb-0"><i class="bi bi-info-circle me-2"></i>Affiliation Details</h6>
|
||||
</div>
|
||||
<div class="card-body" id="affiliationDetails">
|
||||
<p class="text-muted">Select an affiliation from the timeline to view details</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-diagram-3 text-muted" style="font-size: 3rem;"></i>
|
||||
<h5 class="text-muted mt-3 mb-2">No Affiliations Yet</h5>
|
||||
<p class="text-muted mb-0">Club affiliations and skills will appear here once added</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@include('family.partials.affiliations-enhanced')
|
||||
</div>
|
||||
|
||||
<!-- Tournaments Tab -->
|
||||
<div class="tab-pane fade" id="tournaments" role="tabpanel">
|
||||
<div class="card shadow-sm border-0">
|
||||
<!-- Tournament & Event Participation Card -->
|
||||
<div class="card shadow-sm border-0 mb-4">
|
||||
<div class="card-body p-4">
|
||||
<!-- Section Title & Subtitle -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
@@ -1131,7 +1015,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Award Summary Cards -->
|
||||
<div class="row g-3 mb-4" id="awardCards">
|
||||
<div class="row g-3" id="awardCards">
|
||||
<div class="col-md-3">
|
||||
<div class="card shadow-sm border-0 text-center" style="background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);">
|
||||
<div class="card-body p-3">
|
||||
@@ -1169,114 +1053,114 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tournament History Table -->
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-4">
|
||||
<h6 class="fw-bold mb-3"><i class="bi bi-list-ul me-2"></i>Tournament & Championships History</h6>
|
||||
<!-- Tournament & Championships History Card -->
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-4">
|
||||
<h6 class="fw-bold mb-3"><i class="bi bi-list-ul me-2"></i>Tournament & Championships History</h6>
|
||||
|
||||
@if($tournamentEvents->count() > 0)
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle" id="tournamentsTable">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="text-muted small fw-semibold">Tournament Details</th>
|
||||
<th class="text-muted small fw-semibold">Club Affiliation</th>
|
||||
<th class="text-muted small fw-semibold">Performance & Result</th>
|
||||
<th class="text-muted small fw-semibold">Notes & Media</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tournamentEvents as $event)
|
||||
<tr data-sport="{{ $event->sport }}">
|
||||
<td>
|
||||
<div class="fw-bold">{{ $event->title }}</div>
|
||||
<div class="d-flex gap-2 mt-1 flex-wrap">
|
||||
<span class="badge bg-{{ $event->type == 'championship' ? 'primary' : 'secondary' }} small">{{ ucfirst($event->type) }}</span>
|
||||
<span class="badge bg-info small">{{ $event->sport }}</span>
|
||||
</div>
|
||||
<div class="text-muted small mt-1">
|
||||
<i class="bi bi-calendar-event me-1"></i>{{ $event->date->format('M j, Y') }}
|
||||
@if($event->time)
|
||||
<i class="bi bi-clock me-1 ms-2"></i>{{ $event->time->format('H:i') }}
|
||||
@if($tournamentEvents->count() > 0)
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle" id="tournamentsTable">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="text-muted small fw-semibold">Tournament Details</th>
|
||||
<th class="text-muted small fw-semibold">Club Affiliation</th>
|
||||
<th class="text-muted small fw-semibold">Performance & Result</th>
|
||||
<th class="text-muted small fw-semibold">Notes & Media</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tournamentEvents as $event)
|
||||
<tr data-sport="{{ $event->sport }}">
|
||||
<td>
|
||||
<div class="fw-bold">{{ $event->title }}</div>
|
||||
<div class="d-flex gap-2 mt-1 flex-wrap">
|
||||
<span class="badge bg-{{ $event->type == 'championship' ? 'primary' : 'secondary' }} small">{{ ucfirst($event->type) }}</span>
|
||||
<span class="badge bg-info small">{{ $event->sport }}</span>
|
||||
</div>
|
||||
<div class="text-muted small mt-1">
|
||||
<i class="bi bi-calendar-event me-1"></i>{{ $event->date->format('M j, Y') }}
|
||||
@if($event->time)
|
||||
<i class="bi bi-clock me-1 ms-2"></i>{{ $event->time->format('H:i') }}
|
||||
@endif
|
||||
@if($event->location)
|
||||
<i class="bi bi-geo-alt me-1 ms-2"></i>{{ $event->location }}
|
||||
@endif
|
||||
@if($event->participants_count)
|
||||
<i class="bi bi-people me-1 ms-2"></i>{{ $event->participants_count }} participants
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@if($event->clubAffiliation)
|
||||
<div>
|
||||
<div class="small fw-semibold">{{ $event->clubAffiliation->club_name }}</div>
|
||||
<div class="text-muted small">{{ $event->clubAffiliation->location }}</div>
|
||||
</div>
|
||||
@else
|
||||
<span class="text-muted small">Individual</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($event->performanceResults->count() > 0)
|
||||
@foreach($event->performanceResults as $result)
|
||||
<div class="d-flex align-items-center gap-2 mb-1">
|
||||
@if($result->medal_type == '1st')
|
||||
<i class="bi bi-award-fill text-warning"></i>
|
||||
<span class="badge bg-warning text-dark small">1st Place</span>
|
||||
@elseif($result->medal_type == '2nd')
|
||||
<i class="bi bi-award-fill text-secondary"></i>
|
||||
<span class="badge bg-secondary small">2nd Place</span>
|
||||
@elseif($result->medal_type == '3rd')
|
||||
<i class="bi bi-award-fill" style="color: #CD7F32;"></i>
|
||||
<span class="badge" style="background-color: #CD7F32; color: white;" small>3rd Place</span>
|
||||
@elseif($result->medal_type == 'special')
|
||||
<i class="bi bi-trophy-fill text-warning"></i>
|
||||
<span class="badge bg-warning text-dark small">Special Award</span>
|
||||
@endif
|
||||
@if($event->location)
|
||||
<i class="bi bi-geo-alt me-1 ms-2"></i>{{ $event->location }}
|
||||
@endif
|
||||
@if($event->participants_count)
|
||||
<i class="bi bi-people me-1 ms-2"></i>{{ $event->participants_count }} participants
|
||||
@if($result->points)
|
||||
<small class="text-muted">{{ $result->points }} pts</small>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@if($event->clubAffiliation)
|
||||
<div>
|
||||
<div class="small fw-semibold">{{ $event->clubAffiliation->club_name }}</div>
|
||||
<div class="text-muted small">{{ $event->clubAffiliation->location }}</div>
|
||||
</div>
|
||||
@else
|
||||
<span class="text-muted small">Individual</span>
|
||||
@if($result->description)
|
||||
<small class="text-muted">{{ $result->description }}</small>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($event->performanceResults->count() > 0)
|
||||
@foreach($event->performanceResults as $result)
|
||||
<div class="d-flex align-items-center gap-2 mb-1">
|
||||
@if($result->medal_type == '1st')
|
||||
<i class="bi bi-award-fill text-warning"></i>
|
||||
<span class="badge bg-warning text-dark small">1st Place</span>
|
||||
@elseif($result->medal_type == '2nd')
|
||||
<i class="bi bi-award-fill text-secondary"></i>
|
||||
<span class="badge bg-secondary small">2nd Place</span>
|
||||
@elseif($result->medal_type == '3rd')
|
||||
<i class="bi bi-award-fill" style="color: #CD7F32;"></i>
|
||||
<span class="badge" style="background-color: #CD7F32; color: white;" small>3rd Place</span>
|
||||
@elseif($result->medal_type == 'special')
|
||||
<i class="bi bi-trophy-fill text-warning"></i>
|
||||
<span class="badge bg-warning text-dark small">Special Award</span>
|
||||
@endif
|
||||
@if($result->points)
|
||||
<small class="text-muted">{{ $result->points }} pts</small>
|
||||
@endif
|
||||
</div>
|
||||
@if($result->description)
|
||||
<small class="text-muted">{{ $result->description }}</small>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted small">No results recorded</span>
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted small">No results recorded</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($event->notesMedia->count() > 0)
|
||||
@foreach($event->notesMedia as $note)
|
||||
@if($note->note_text)
|
||||
<p class="mb-1 small">{{ $note->note_text }}</p>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($event->notesMedia->count() > 0)
|
||||
@foreach($event->notesMedia as $note)
|
||||
@if($note->note_text)
|
||||
<p class="mb-1 small">{{ $note->note_text }}</p>
|
||||
@endif
|
||||
@if($note->media_link)
|
||||
<a href="{{ $note->media_link }}" target="_blank" class="btn btn-sm btn-outline-primary small">
|
||||
<i class="bi bi-image me-1"></i>View Media
|
||||
</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted small">No notes available</span>
|
||||
@if($note->media_link)
|
||||
<a href="{{ $note->media_link }}" target="_blank" class="btn btn-sm btn-outline-primary small">
|
||||
<i class="bi bi-image me-1"></i>View Media
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-trophy text-muted" style="font-size: 3rem;"></i>
|
||||
<p class="text-muted mt-3">No tournament records found</p>
|
||||
<small class="text-muted">Tournament participation will appear here once records are added</small>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted small">No notes available</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-trophy text-muted" style="font-size: 3rem;"></i>
|
||||
<p class="text-muted mt-3">No tournament records found</p>
|
||||
<small class="text-muted">Tournament participation will appear here once records are added</small>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1461,8 +1345,14 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="tournament_date" class="form-label">Date <span class="text-danger">*</span></label>
|
||||
<input type="date" class="form-control" id="tournament_date" name="date" required>
|
||||
<x-birthdate-dropdown
|
||||
name="date"
|
||||
id="tournament_date"
|
||||
label="Date"
|
||||
:required="true"
|
||||
:min-year="2000"
|
||||
:max-year="date('Y')"
|
||||
:error="$errors->first('date')" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="tournament_time" class="form-label">Time</label>
|
||||
|
||||
Reference in new issue
Block a user