@extends('layouts.front.app') @section('title', $q ? "Search: {$q} — JotiJournal" : 'Search — JotiJournal') @section('content')
@if($q === '')

Start typing to search the legal corpus

Acts, amendments, judgements, articles, circulars, samasya, research articles — one search.

@else
@switch($intent['kind']) @case('section') Section search @break @case('citation') Citation lookup @break @case('party') Party name @break @default Free-text @endswitch
@if($intent['kind'] === 'section')
Showing judgements citing Section {{ $intent['number'] }}@if($intent['act_hint']) of {{ $intent['act_hint'] }}@endif
@endif @if($results->isEmpty())

No results found

Try different keywords, fewer words, or a broader search.

@else
@php $clean = fn ($s) => trim(html_entity_decode(strip_tags((string) $s), ENT_QUOTES | ENT_HTML5)); @endphp @foreach($results as $r)

{{ $clean($r['title']) }}

{{ $r['type'] }}
@if(!empty($r['subtitle']))
{{ $clean($r['subtitle']) }}
@endif @if(!empty($r['body']))

{{ \Illuminate\Support\Str::limit($clean($r['body']), 240) }}

@endif @php $rawYear = $r['year'] ?? null; // Journals store a year only; everything else stores YYYY-MM-DD. $pubDate = ($rawYear && \Illuminate\Support\Str::contains($rawYear, '-')) ? \Illuminate\Support\Carbon::parse($rawYear)->format('d M Y') : $rawYear; @endphp
@if(!empty($r['sections'])) {{ implode(' · ', $r['sections']) }} @endif @switch($r['type']) @case('Journal') @if(!empty($pubDate)) Pub Year: {{ $pubDate }} @endif @if(!empty($r['extra2'])) Vol: {{ $r['extra2'] }} @endif @if(!empty($r['extra1'])) Note No: {{ $r['extra1'] }} @endif @if(!empty($r['id'])) ID: {{ $r['id'] }} @endif @break @case('Article') @if(!empty($r['extra1'])) {{ $r['extra1'] }} @endif @if(!empty($pubDate)) Published: {{ $pubDate }} @endif @if(!empty($r['extra2'])) Category: {{ $r['extra2'] }} @endif ID: {{ $r['id'] }} @break @case('Circular') @if(!empty($r['extra1'])) Notification / Circular No: {{ $r['extra1'] }} @endif @if(!empty($pubDate)) Published: {{ $pubDate }} @endif @if(!empty($r['extra2'])) Subject: {{ $r['extra2'] }} @endif ID: {{ $r['id'] }} @break @case('Samasya') @if(!empty($pubDate)) Published: {{ $pubDate }} @endif @if(!empty($r['extra1'])) Category: {{ $r['extra1'] }} @endif @if(!empty($r['extra2'])) Subcategory: {{ $r['extra2'] }} @endif @break @default @if(!empty($pubDate)) {{ $pubDate }} @endif @endswitch
@endforeach
@endif @endif
@once @endonce @endsection