@extends('layouts.parent') @section('title', 'Subjects & Enrolments · '.config('brand.name')) @section('content')
@if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif @include('parent.partials.child-picker') @if (! $child)

Select or add a child to browse subjects for their class.

@elseif (! $child->studentProfile?->class_id)

{{ $child->first_name }} does not have a class yet. Update their details before enrolling in a subject.

@else
@if (! empty($programmes))
All courses @foreach ($programmes as $option) {{ $option['label'] }} @endforeach
@endif @if ($subjects->isNotEmpty()) @endif
@if ($lessons === null || $lessons->total() === 0)

@if ($enrolledOnly) {{ $child->first_name }} is not enrolled in a subject yet. @else No published subjects for {{ $child->first_name }}'s class yet. @endif

@else
@foreach ($lessons as $lesson) @php $isEnrolled = $enrolledIds->contains($lesson->id); @endphp
{{ $child->classLabel() }} @if ($isEnrolled) Enrolled @endif

{{ $lesson->studentDisplayName() }}

{{ $lesson->priceLabel() }}

{{ $lesson->yearlyPriceLabel() }}

{{ $lesson->curriculum_items_count }} curriculum {{ $lesson->curriculum_items_count === 1 ? 'unit' : 'units' }} · {{ $isEnrolled ? 'Enrolled — open to manage class times' : 'Enrol now; payment comes later' }}

{{ $isEnrolled ? 'View curriculum & times' : 'View' }} @unless ($isEnrolled)
@csrf
@endunless
@endforeach
@endif @endif
@endsection