@extends('layouts.app') @section('content')
{{-- Dark Header Banner --}}
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
{{-- Embedded Form --}}
@php $src = ''; if (!empty($dataCollection->iframe_code) && preg_match('/src="([^"]+)"/', $dataCollection->iframe_code, $matches)) { $src = $matches[1]; } @endphp @if($src)
Loading...

Loading form...

@else
No form is embedded for this data collection.
@endif
@endsection