Back
{{ $dataCollection->title }}
@if($dataCollection->description)
{{ $dataCollection->description }}
@endif
@php
$today = \Carbon\Carbon::today();
$isActive = $today->between($dataCollection->start_date, $dataCollection->end_date);
$authUser = auth()->user();
$isAdmin = $authUser && (method_exists($authUser, 'isAdmin') ? $authUser->isAdmin() : $authUser->hasRole('Admin'));
@endphp
{{-- Date Pills --}}
{{ $dataCollection->start_date->format('d M Y') }}
→
{{ $dataCollection->end_date->format('d M Y') }}
{{-- Status Badge --}}
@if($isActive)
Active
@else
Expired
@endif
{{-- Admin-only: Excel Download & Open Sheet --}}
@if($isAdmin)
@php
$sheetExportUrl = null;
if (!empty($dataCollection->sheet_url) && preg_match('/\/spreadsheets\/d\/([a-zA-Z0-9_-]+)/', $dataCollection->sheet_url, $sm)) {
$sheetExportUrl = 'https://docs.google.com/spreadsheets/d/' . $sm[1] . '/export?format=xlsx';
}
@endphp
@if($sheetExportUrl)
Download Responses
Open Sheet
@endif
@endif