@extends('layouts.app') @section('title', $project->name . ' Success Stories - UN-Habitat Nepal') @section('content')
{{-- All Projects --}}
@if($project->short_name) {{ $project->short_name }} @endif @if($project->is_completed) Completed @else Ongoing @endif

{{ $project->name }}

{{ $stories->total() }}
Impact Stories
@if($stories->isEmpty())

No stories have been published for this project yet.

@else
@foreach($stories as $story) @php $firstTextBlock = collect($story->content)->firstWhere('type', 'text'); $summary = $firstTextBlock ? Str::limit(strip_tags($firstTextBlock['data']['content']), 150) : 'Click to read this success story...'; @endphp
@if($story->image) {{ $story->image_alt ?: $story->title }} @endif @if($story->is_featured)
@endif
{{ $story->published_date ? $story->published_date->format('M d, Y') : $story->created_at->format('M d, Y') }}

{{ $story->title }}

{{ $summary }}

@endforeach
{{ $stories->links() }}
@endif
@endsection