@extends('layouts.app') @section('title', __('whatsappnotification::lang.whatsapp_notification') . ' - ' . __('whatsappnotification::lang.manage_templates')) @section('content') @component('components.widget', ['class' => 'box-primary']) @slot('title') {{ __('whatsappnotification::lang.manage_templates') }} @endslot @slot('tool') {{ __('whatsappnotification::lang.add_template') }} {{ __('whatsappnotification::lang.settings') }} @endslot @if(session('success'))
{{ session('success') }}
@endif @if($templates->isEmpty())
{{ __('whatsappnotification::lang.no_templates_yet') }} {{ __('whatsappnotification::lang.create_first_template') }}
@else
@foreach($templates as $template) @endforeach
{{ __('whatsappnotification::lang.template_name') }} {{ __('whatsappnotification::lang.trigger_type') }} {{ __('whatsappnotification::lang.reminder_days') }} {{ __('whatsappnotification::lang.send_time') }} {{ __('whatsappnotification::lang.status') }} {{ __('lang_v1.action') }}
{{ $template->name }} @if($template->message_title)
{{ Str::limit($template->message_title, 60) }} @endif
@php $badge_class = [ 'new_sale' => 'success', 'sale_update' => 'warning', 'payment_reminder' => 'danger', 'manual' => 'info', ][$template->trigger_type] ?? 'default'; @endphp {{ $trigger_labels[$template->trigger_type] ?? $template->trigger_type }} @if($template->trigger_type === 'payment_reminder') @if(!is_null($template->reminder_days_overdue)) {{ $template->reminder_days_overdue }} {{ __('whatsappnotification::lang.days') }} @else {{ __('whatsappnotification::lang.any_due') }} @endif @else — @endif @if($template->trigger_type === 'payment_reminder' && $template->reminder_send_time) {{ \Carbon\Carbon::createFromTimeString($template->reminder_send_time)->format('h:i A') }} @else — @endif {{ $template->is_active ? __('lang_v1.active') : __('lang_v1.inactive') }} {{ __('lang_v1.edit') }}
@endif {{-- Delete form (hidden) --}} @endcomponent @stop @section('javascript') @endsection