@extends('layouts.app') @section('title', 'My Journal') @section('content')
{{-- Header --}}

My Devotional Journal

Your personal reflections and notes on each devotional.

{{-- Export Buttons --}}
@if($totalNotes > 0) Export All ({{ $year }}) @if($monthFilter) Export {{ $monthFilter }} @endif @endif
{{-- Stats Bar --}}
{{ $totalNotes }}
{{ $totalNotes === 1 ? 'Note' : 'Notes' }} Written
{{ $monthsCovered }}
{{ $monthsCovered === 1 ? 'Month' : 'Months' }} Covered
{{ number_format($totalWords) }}
Total Words
{{-- Filters --}}
{{-- Year selector --}}
Year: @foreach($availableYears as $y) {{ $y }} @endforeach
| {{-- Month filter pills --}}
All @foreach($months as $m) @php $hasNotes = $notesByMonth->has($m) || ($monthFilter && strtolower($monthFilter) === strtolower($m)); @endphp @if(!$monthFilter || $hasNotes || $notesByMonth->keys()->contains($m)) {{ substr($m, 0, 3) }} @endif @endforeach
{{-- Notes Content --}} @if($notesByMonth->isEmpty())

Your journal is empty

Start watching devotionals and writing your reflections. Your thoughts and insights will appear here.

Browse Devotionals
@else @foreach($notesByMonth as $monthName => $notes)

{{ $monthName }}

({{ $notes->count() }} {{ $notes->count() === 1 ? 'note' : 'notes' }})
Export
@foreach($notes->sortBy(function ($note) { if ($note->video && preg_match('/^\w+\s+(\d{1,2})/', $note->video->title, $m)) { return (int) $m[1]; } return 99; }) as $note)
{{ $note->video->title }}
{{ str_word_count($note->content) }} words

{{ $note->content }}

Last updated {{ $note->updated_at->format('M j, Y \a\t g:i A') }}
@endforeach
@endforeach @endif
@endsection