feat: add visual progress timeline to the intern application dashboard
This commit is contained in:
@@ -50,6 +50,275 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$status = $intern->status;
|
||||
$hasToBeSigned = !empty($intern->to_be_signed_internship_form_path);
|
||||
$hasSigned = !empty($intern->signed_internship_form_path);
|
||||
|
||||
$step1_state = 'completed';
|
||||
|
||||
if (in_array($status, ['reviewed', 'waiting_document', 'accepted']) || $hasToBeSigned || $hasSigned) {
|
||||
$step2_state = 'completed';
|
||||
} elseif ($status === 'rejected') {
|
||||
$step2_state = 'rejected';
|
||||
} else {
|
||||
$step2_state = 'active';
|
||||
}
|
||||
|
||||
if ($hasToBeSigned || $hasSigned) {
|
||||
$step3_state = 'completed';
|
||||
} elseif ($step2_state === 'completed' && $status !== 'rejected') {
|
||||
$step3_state = 'active';
|
||||
} else {
|
||||
$step3_state = 'pending';
|
||||
}
|
||||
|
||||
if ($hasSigned) {
|
||||
$step4_state = 'completed';
|
||||
} elseif ($step3_state === 'completed' && !$hasSigned && $status !== 'rejected') {
|
||||
$step4_state = 'active';
|
||||
} else {
|
||||
$step4_state = 'pending';
|
||||
}
|
||||
|
||||
if ($status === 'accepted' && $hasSigned) {
|
||||
$step5_state = 'completed';
|
||||
} elseif ($step4_state === 'completed' && $status !== 'rejected') {
|
||||
$step5_state = 'active';
|
||||
} else {
|
||||
$step5_state = 'pending';
|
||||
}
|
||||
|
||||
$completedCount = 0;
|
||||
if ($step1_state === 'completed') $completedCount++;
|
||||
if ($step2_state === 'completed') $completedCount++;
|
||||
if ($step3_state === 'completed') $completedCount++;
|
||||
if ($step4_state === 'completed') $completedCount++;
|
||||
if ($step5_state === 'completed') $completedCount++;
|
||||
|
||||
$progressPercent = (($completedCount - 1) / 4) * 100;
|
||||
if ($status === 'rejected') {
|
||||
$progressPercent = 25;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<!-- Stage Timeline Card -->
|
||||
<div class="bg-white rounded-3xl p-6 md:p-8 shadow-xl border border-slate-100/50 mb-8">
|
||||
<h3 class="font-bold text-slate-800 text-lg mb-6 pb-2 border-b border-slate-100 flex items-center gap-2">
|
||||
<i class="uil uil-chart-growth text-blue-600 text-xl"></i>
|
||||
<span>Staj Süreci İlerleme Durumu</span>
|
||||
</h3>
|
||||
|
||||
<!-- Desktop Timeline (Horizontal) -->
|
||||
<div class="hidden md:block relative my-6">
|
||||
<!-- Background Line -->
|
||||
<div class="absolute top-6 left-8 right-8 h-1 bg-slate-100 rounded-full -z-10">
|
||||
<div class="h-full bg-blue-600 rounded-full transition-all duration-500" style="width: {{ $progressPercent }}%;"></div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-start">
|
||||
<!-- Step 1 -->
|
||||
<div class="flex flex-col items-center text-center w-1/5 px-2">
|
||||
<div class="w-12 h-12 rounded-full bg-blue-600 text-white flex items-center justify-center text-xl shadow-lg shadow-blue-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-clipboard-notes"></i>
|
||||
</div>
|
||||
<span class="text-xs font-extrabold text-slate-800 mt-3">Başvuru Alındı</span>
|
||||
<span class="text-[10px] text-slate-400 font-semibold mt-1">Staj başvurunuz sisteme ulaştı.</span>
|
||||
</div>
|
||||
|
||||
<!-- Step 2 -->
|
||||
<div class="flex flex-col items-center text-center w-1/5 px-2">
|
||||
@if($step2_state === 'completed')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-600 text-white flex items-center justify-center text-xl shadow-lg shadow-blue-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@elseif($step2_state === 'rejected')
|
||||
<div class="w-12 h-12 rounded-full bg-red-600 text-white flex items-center justify-center text-xl shadow-lg shadow-red-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-multiply"></i>
|
||||
</div>
|
||||
@elseif($step2_state === 'active')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-xl z-10 border-4 border-white ring-2 ring-blue-500 animate-pulse">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-12 h-12 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-xl z-10 border-4 border-white">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-xs font-extrabold @if($step2_state === 'active') text-blue-600 @elseif($step2_state === 'rejected') text-red-600 @else text-slate-800 @endif mt-3">Ön Değerlendirme</span>
|
||||
@if($step2_state === 'rejected')
|
||||
<span class="text-[10px] text-red-500 font-semibold mt-1">Başvurunuz olumsuz sonuçlandı.</span>
|
||||
@else
|
||||
<span class="text-[10px] text-slate-400 font-semibold mt-1">Evrak ve kriterler inceleniyor.</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Step 3 -->
|
||||
<div class="flex flex-col items-center text-center w-1/5 px-2">
|
||||
@if($step3_state === 'completed')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-600 text-white flex items-center justify-center text-xl shadow-lg shadow-blue-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@elseif($step3_state === 'active')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-xl z-10 border-4 border-white ring-2 ring-blue-500 animate-pulse">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-12 h-12 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-xl z-10 border-4 border-white">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-xs font-extrabold @if($step3_state === 'active') text-blue-600 @else text-slate-800 @endif mt-3">Staj Formu Yükleme</span>
|
||||
<span class="text-[10px] text-slate-400 font-semibold mt-1">İmzalanacak staj formunu yükleyin.</span>
|
||||
</div>
|
||||
|
||||
<!-- Step 4 -->
|
||||
<div class="flex flex-col items-center text-center w-1/5 px-2">
|
||||
@if($step4_state === 'completed')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-600 text-white flex items-center justify-center text-xl shadow-lg shadow-blue-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@elseif($step4_state === 'active')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-xl z-10 border-4 border-white ring-2 ring-blue-500 animate-pulse">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-12 h-12 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-xl z-10 border-4 border-white">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-xs font-extrabold @if($step4_state === 'active') text-blue-600 @else text-slate-800 @endif mt-3">İmzalı Form Onayı</span>
|
||||
<span class="text-[10px] text-slate-400 font-semibold mt-1">İmzalanmış formunuz hazırlanıyor.</span>
|
||||
</div>
|
||||
|
||||
<!-- Step 5 -->
|
||||
<div class="flex flex-col items-center text-center w-1/5 px-2">
|
||||
@if($step5_state === 'completed')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-600 text-white flex items-center justify-center text-xl shadow-lg shadow-blue-500/20 z-10 border-4 border-white">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@elseif($step5_state === 'active')
|
||||
<div class="w-12 h-12 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-xl z-10 border-4 border-white ring-2 ring-blue-500 animate-pulse">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-12 h-12 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-xl z-10 border-4 border-white">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-xs font-extrabold @if($step5_state === 'active') text-blue-600 @else text-slate-800 @endif mt-3">Oryantasyon & Başlangıç</span>
|
||||
<span class="text-[10px] text-slate-400 font-semibold mt-1">Staj süreci ve eğitimler başlar.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mobile Timeline (Vertical) -->
|
||||
<div class="md:hidden space-y-6 pl-4 relative before:content-[''] before:absolute before:left-[21px] before:top-2 before:bottom-2 before:w-1 before:bg-slate-100">
|
||||
<!-- Step 1 -->
|
||||
<div class="flex gap-4 items-start relative">
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-blue-500/10">
|
||||
<i class="uil uil-clipboard-notes"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="text-sm font-extrabold text-slate-800">Başvuru Alındı</h4>
|
||||
<p class="text-xs text-slate-400 mt-0.5">Staj başvurunuz sisteme ulaştı.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 2 -->
|
||||
<div class="flex gap-4 items-start relative">
|
||||
@if($step2_state === 'completed')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-blue-500/10">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@elseif($step2_state === 'rejected')
|
||||
<div class="w-8 h-8 rounded-full bg-red-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-red-500/10">
|
||||
<i class="uil uil-multiply"></i>
|
||||
</div>
|
||||
@elseif($step2_state === 'active')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-sm z-10 border border-blue-500 animate-pulse">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-sm z-10">
|
||||
<i class="uil uil-search-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<h4 class="text-sm font-extrabold @if($step2_state === 'active') text-blue-600 @elseif($step2_state === 'rejected') text-red-600 @else text-slate-800 @endif">Ön Değerlendirme</h4>
|
||||
@if($step2_state === 'rejected')
|
||||
<p class="text-xs text-red-500 mt-0.5">Başvurunuz olumsuz sonuçlandı.</p>
|
||||
@else
|
||||
<p class="text-xs text-slate-400 mt-0.5">Evrak ve kriterler inceleniyor.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 3 -->
|
||||
<div class="flex gap-4 items-start relative">
|
||||
@if($step3_state === 'completed')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-blue-500/10">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@elseif($step3_state === 'active')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-sm z-10 border border-blue-500 animate-pulse">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-sm z-10">
|
||||
<i class="uil uil-file-upload-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<h4 class="text-sm font-extrabold @if($step3_state === 'active') text-blue-600 @else text-slate-800 @endif">Staj Formu Yükleme</h4>
|
||||
<p class="text-xs text-slate-400 mt-0.5">İmzalanacak staj formunu yükleyin.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 4 -->
|
||||
<div class="flex gap-4 items-start relative">
|
||||
@if($step4_state === 'completed')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-blue-500/10">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@elseif($step4_state === 'active')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-sm z-10 border border-blue-500 animate-pulse">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-sm z-10">
|
||||
<i class="uil uil-file-check-alt"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<h4 class="text-sm font-extrabold @if($step4_state === 'active') text-blue-600 @else text-slate-800 @endif">İmzalı Form Onayı</h4>
|
||||
<p class="text-xs text-slate-400 mt-0.5">İmzalanmış formunuz hazırlanıyor.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 5 -->
|
||||
<div class="flex gap-4 items-start relative">
|
||||
@if($step5_state === 'completed')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 text-white flex items-center justify-center text-sm z-10 shadow-md shadow-blue-500/10">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@elseif($step5_state === 'active')
|
||||
<div class="w-8 h-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center text-sm z-10 border border-blue-500 animate-pulse">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-slate-100 text-slate-400 flex items-center justify-center text-sm z-10">
|
||||
<i class="uil uil-rocket"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<h4 class="text-sm font-extrabold @if($step5_state === 'active') text-blue-600 @else text-slate-800 @endif">Oryantasyon & Başlangıç</h4>
|
||||
<p class="text-xs text-slate-400 mt-0.5">Staj süreci ve eğitimler başlar.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Application Info & Document Download Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-12 gap-8">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user