@extends('backend.layouts.app') @section('title', __('Notifications Template')) @section('styles') @endsection @section('content') @php $allTemplatesQuery = request()->except('page', 'user_type'); $userTemplatesQuery = array_merge(request()->except('page', 'user_type'), ['user_type' => \App\Enums\UserType::USER->value]); $adminTemplatesQuery = array_merge(request()->except('page', 'user_type'), ['user_type' => \App\Enums\UserType::ADMIN->value]); $selectedUserType = request('user_type', ''); @endphp
{{ __('Manage and configure all system notification templates and channel preferences.') }}

{{ __('Notification Templates') }}

{{ __('Track template coverage, review active channels, and quickly manage delivery configuration from one place.') }}

@can('plugins-manage') {{ __('Notification Integrations') }} @endcan
{{ $templateStats['total'] }}
{{ __('Total Templates') }}
{{ $templateStats['active'] }}
{{ __('Active Templates') }}
{{ $templateStats['inactive'] }}
{{ __('Inactive Templates') }}
{{ $templateStats['channels'] }}
{{ __('Channels') }}

{{ __('Template Management') }}

{{ __('Search templates, narrow down delivery channels, and open any template for channel-level management.') }}

{{ __('Results') }}: {{ $notifyTemplates->total() }} @if($activeFilterCount > 0) {{ __('Active Filters') }}: {{ $activeFilterCount }} @endif
@if($activeFilterCount > 0) @endif
@if($selectedUserType !== '') @endif
@can('notification-template-manage') @endcan @forelse($notifyTemplates as $template) @php // collect variables and count $vars = collect($template->variables); $count = $vars->count(); if ($count > 3) { // split into two pretty-even chunks $half = (int) ceil($count / 2); $first = $vars->slice(0, $half); $second = $vars->slice($half); } else { // 3 or fewer: just one row $first = $vars; $second = collect(); } @endphp @can('notification-template-manage') @endcan @empty @can('notification-template-manage') @endforelse
{{ __('Template') }} {{ __('Channels') }} {{ __('Variables') }} {{ __('Updated') }}{{ __('Action') }}
{{ $template->name }}
{{ $template->user_type->label() }} {{ $template->action_type->label() }}
{{ $template->info }}
{{ __('Identifier') }}: {{ $template->identifier }}
@foreach($template->channels as $channel)
{{ $channel->channel->label() }}
{{ $channel->is_active ? __('Active') : __('Inactive') }}
@endforeach
{{ __('Active') }}: {{ $template->active_channels_count }} / {{ __('Inactive') }}: {{ $template->inactive_channels_count }}
{{ $count }} {{ __('Available placeholders') }}
@foreach($first as $variable) {{ '{'.$variable.'}' }} @endforeach
@if($second->isNotEmpty())
@foreach($second as $variable) {{ '{'.$variable.'}' }} @endforeach
@endif
{{ $template->updated_at?->diffForHumans() ?? __('N/A') }}
{{ __('Last synced template configuration') }}
{{ __('Manage') }}
@else @endcan
{{-- Pagination --}}
{{ __('Showing') }} {{ $notifyTemplates->count() }} {{ __('of') }} {{ $notifyTemplates->total() }} {{ __('templates') }}
{{ $notifyTemplates->links() }}
@endsection