@extends('frontend.layout') @section('content') @php $commissioner = getContent('commissioner'); $principal = getContent('principal'); $about = getContent('about'); $course = getContent('course-link'); $latestVideo = \App\Models\Video::latest('id')->first(); // Quick-link buttons come from Static Content (admin: Static Content, type "home-buttons"): // title = button label, route = page path (e.g. dr-pages/nirf/nirf) or a full http(s) URL, // content = button colour class, priority = order. "priority" is a text column, so sort numerically. $homeButtons = getContents('home-buttons')->sortBy(fn($b) => (int) $b->priority)->values(); $buttonColors = ['btn-primary', 'btn-secondary', 'btn-success', 'btn-danger', 'btn-warning', 'btn-info', 'btn-light', 'btn-dark']; @endphp
{{-- LEFT: COMMISSIONER + QUICK LINKS --}}
{{ strtoupper($commissioner->title ?? 'Commissioner') }}
@if($commissioner && $commissioner->image) Commissioner @else Commissioner @endif

@if($commissioner) {!! $commissioner->content !!} @else

Content not available.

@endif
@foreach ($homeButtons as $button) @php $isExternal = (bool) preg_match('#^https?://#i', (string) $button->route); $colour = trim(strip_tags((string) $button->content)); $colour = in_array($colour, $buttonColors, true) ? $colour : 'btn-success'; @endphp

@endforeach
{{-- CENTRE: SLIDER + ABOUT --}}

@if($about) {!! $about->content !!} @else

Content not available.

@endif

@if(optional($course)->image) {{ $course->title }} @elseif(optional($course)->title) {{ $course->title }} @endif

{{-- RIGHT: PRINCIPAL + NEWS --}}

{{ strtoupper($principal->title ?? 'Principal') }}
@if($principal && $principal->image) Principal @else Principal @endif

@if($principal) {!! $principal->content !!} @else

Content not available.

@endif

News and Updates

@foreach($news as $item)
  • {{ $item->title }}

  • @endforeach

    {{-- UPCOMING EVENTS --}}
    Upcoming Events
    @if($events->count()) @foreach ($events as $event) @if (!empty($event->file)) {{ $event->title }} @else {{ $event->title }} @endif
    @endforeach
    @else

    No upcoming events.

    @endif
    {{-- ANNOUNCEMENTS --}}
    Announcements
    @if($announcements->count()) @foreach($announcements as $announcement) {{ $announcement->title }}
    @endforeach
    @else

    No announcements.

    @endif
    {{-- VIDEOS --}}
    Videos
    @if($latestVideo)
    {!! convertYoutube($latestVideo->video) !!}

    {{ $latestVideo->title }}

    @endif
    {{-- GALLERY --}}
    Gallery

     


    @endsection