@extends('layouts.admin') @section('title', $story->title) @section('content')
← 🔯 Aaj nu Rashifal

🔯 {{ $story->title }}

{{ $cards->count() }} rashi cards · {{ ucfirst($story->status) }}

@csrf @method('DELETE')
@if (in_array($story->type, ['rashifal_short', 'rashifal_week'], true)) @php $isWeek = $story->type === 'rashifal_week'; @endphp {{-- 📺 YouTube Shorts / 🎬 Saptahik video — har part = ek video (sirf YouTube) --}}
@foreach ($story->parts->sortBy('sort_order') as $part) @php $first = $part->cards->sortBy('sort_order')->first(); @endphp
@if ($isWeek && $part->image_path) Thumbnail @endif

{{ \App\Models\Story::rashiShortLabel($part->body) }} — {{ $isWeek ? 'YouTube Video' : 'YouTube Short' }}

{{ $part->cards->count() }} frames • @if ($first?->yt_status === 'posted') ✅ Upload ho gaya{{ $first->yt_video_id ? ' (' . $first->yt_video_id . ')' : '' }} @elseif ($first?->yt_status === 'failed') ❌ Fail: {{ \Illuminate\Support\Str::limit($first->yt_error, 120) }} @elseif ($isWeek) ⏳ Auto-post {{ \Illuminate\Support\Carbon::parse($story->category)->format('d M') }} (Somvar) se pehle time slot me upload karega @else ⏳ Auto-post {{ \Illuminate\Support\Carbon::parse($story->category)->format('d M') }} ko upload karega @endif

📘 Facebook {{ $isWeek ? 'video' : 'Reel' }}: @if ($first?->fb_status === 'posted') ✅ Post ho gaya @elseif ($first?->fb_status === 'failed') ❌ Fail: {{ \Illuminate\Support\Str::limit($first->fb_error, 120) }} @elseif ($first?->fb_status === 'posting') ⏳ Post ho raha hai… @else ⏳ Auto-post YouTube ke baad bhejega @endif

@if ($first?->yt_status !== 'posted')
@csrf
@endif @if ($first && $first->fb_status !== 'posted' && ! ($first->fb_status === 'posting' && $first->updated_at?->gt(now()->subMinutes(\App\Models\PartCard::POSTING_STALE_MINUTES))))
@csrf
@endif
@endforeach
@endif @if ($story->type === 'rashifal' && $cards->isNotEmpty()) @php $fbLeft = $cards->filter(fn ($c) => $c->fb_status !== 'posted'); $fbBusy = $cards->contains(fn ($c) => $c->fb_status === 'posting' && $c->updated_at?->gt(now()->subMinutes(\App\Models\PartCard::POSTING_STALE_MINUTES))); @endphp {{-- 📘 Facebook: saare rashi cards ek album post me --}}

📘 Facebook Album — saari rashi ek post me

@if ($fbLeft->isEmpty()) ✅ Saare {{ $cards->count() }} cards Facebook par post ho gaye @elseif ($fbBusy) ⏳ Post ho raha hai… @else {{ $fbLeft->count() }} / {{ $cards->count() }} cards baaki • auto-post {{ \Illuminate\Support\Carbon::parse($story->category)->format('d M') }} ko ek album me bhejega @if ($f = $fbLeft->firstWhere('fb_status', 'failed'))
❌ Pichhli baar fail: {{ \Illuminate\Support\Str::limit($f->fb_error, 120) }} @endif @endif

@if ($fbLeft->isNotEmpty() && ! $fbBusy)
@csrf
@endif
@endif {{-- Reel & auto-post settings --}}
@include('admin.partials._reel_settings')
@if ($cards->isEmpty())
Koi card nahi.
@else
@csrf
@foreach ($cards as $i => $card)
📸 ▶️ 📘
⬇ Image
@endforeach
{{-- Hidden Individual Card Delete Forms --}} @foreach ($cards as $card) @endforeach

Har card ek rashi ka bhavishya hai — auto-post inhe sirf isi din post karta hai. Auto-post inhe drip post karta hai.

@endif
@push('scripts') @endpush @endsection