@extends('layouts.app') @section('title', __('Email Templates')) @section('page-title', __('Email Templates')) @section('page-subtitle', __('Edit per-locale subject and body for every email the platform sends.')) @section('content') @include('super-admin._nav') @php $icons = [ 'verify_email' => ['shield', 'from-blue-500 to-blue-700'], 'reset_password' => ['shield', 'from-rose-500 to-rose-700'], 'user_welcome' => ['user', 'from-emerald-500 to-emerald-700'], 'user_invited' => ['users', 'from-indigo-500 to-indigo-700'], 'tenant_created' => ['building', 'from-amber-500 to-amber-700'], 'notification_generic' => ['bell', 'from-violet-500 to-violet-700'], ]; @endphp {{-- Stats --}}
{{ __('Templates') }}
{{ $stats['total'] }}
{{ __('Active') }}
{{ $stats['active'] }}
{{ __('Fully translated') }}
{{ $stats['fully_translated'] }}
{{ __('Languages') }}
{{ $stats['languages'] }}
{{-- List --}}
{{ __('All templates') }} {{ $stats['total'] }}
@forelse($templates as $tpl) @php [$icon, $gradient] = $icons[$tpl->key] ?? ['mail', 'from-slate-500 to-slate-700']; $filled = $tpl->filledLocales(); $pct = count($locales) > 0 ? round(count($filled) / count($locales) * 100) : 0; $subjectEn = ($tpl->subject ?? [])['en'] ?? '—'; @endphp
{{ $tpl->name }}
{{ $tpl->key }}
@ {{ $subjectEn }}
{{-- Locale badges --}}
@foreach($locales as $loc) @php $ok = in_array($loc, $filled, true); @endphp {{ $loc }} @endforeach
{{-- Progress --}}
{{ count($filled) }}/{{ count($locales) }}
{{-- Status --}} {{ $tpl->is_active ? __('Active') : __('Inactive') }} {{ __('Edit') }}
@empty
{{ __('No templates yet. Run') }} php artisan db:seed --class=EmailTemplateSeeder
@endforelse
@endsection