@extends('front.layouts.app') @section('content') @php $campaign = $campaign ?? null; $user = $campaign->createdBy ?? null; // For days calculation, we'll use JavaScript to calculate based on browser timezone // But for initial display, calculate server-side (will be updated by JS) if ($campaign && $campaign->campaign_finished_at) { // Calculate days left using UTC (will be corrected by JavaScript) $daysLeft = now()->diffInDays(\Carbon\Carbon::parse($campaign->campaign_finished_at), false); } else { $daysLeft = 0; } $progress = $campaign && $campaign->fund_target > 0 ? ($campaign->fund_raised / $campaign->fund_target) * 100 : 0; $progress = min(100, max(0, $progress)); $remaining = $campaign ? ($campaign->fund_target - $campaign->fund_raised) : 0; $remaining = $remaining > 0 ? $remaining : 0; $avatar = $user ? $user->avatar : asset('front/assets/images/placeholder-avatar.png'); // Get UTC date in ISO format for JavaScript countdown $campaignFinishedAtUTC = $campaign && $campaign->campaign_finished_at ? \Carbon\Carbon::parse($campaign->campaign_finished_at, 'UTC')->toIso8601String() : null; @endphp
  • Athlete
  • {{ $user->full_name ?? 'Campaign' }}
Active {{ round($daysLeft) }} days left

{{ $campaign->title ?? 'Campaign Title' }}

{{ $user->full_name ?? 'Athlete' }}

{{ $user->full_name ?? 'Athlete Name' }}

{{ $user->roles->pluck('title')->implode(', ') }} - {{ $campaign->category->title ?? 'Sport' }}, Point Guard

15 Gold Medals National Champion
Sports

{{ $campaign->category->title ?? 'Basketball' }}

{{--
Location

{{ $campaign->location ?? 'Woodstock, Ontario, Canada' }}

--}}
Goal

{!! \App\Helpers\Helper::price($campaign->fund_target) !!}

Supporters

{{ $totalContributors }}

Campaign Progress

{!! \App\Helpers\Helper::price($campaign->fund_raised) !!}
{{ number_format($progress, 0) }}% funded
{!! \App\Helpers\Helper::price($remaining) !!} to go

Campaign Story

@php $fullText = $campaign->summary ?? ''; $truncatedLength = 200; // Characters to show initially $isLong = strlen($fullText) > $truncatedLength; $truncatedText = $isLong ? substr($fullText, 0, $truncatedLength) . '...' : $fullText; @endphp

{{ $isLong ? $truncatedText : $fullText }} @if($isLong) Read More @endif

@if(!empty($campaignImages ?? [])) @endif @include('front.campaigns.partials.recent-contributors')
@include('front.campaigns.partials.contribute-now')
@push('page_script') {{-- COMMENTED: Accept.js now loaded conditionally in contribute-now partial modal --}} {{-- --}} @endpush @endsection