From b08d86220ac439f312d4d1ebe5d471d5c0c90f6c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 28 Aug 2025 16:53:13 -0700 Subject: [PATCH] First pass at moving to table structure --- .../markdown/report-expiring-assets.blade.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/resources/views/notifications/markdown/report-expiring-assets.blade.php b/resources/views/notifications/markdown/report-expiring-assets.blade.php index f6391aa64e..da9ec5ca50 100644 --- a/resources/views/notifications/markdown/report-expiring-assets.blade.php +++ b/resources/views/notifications/markdown/report-expiring-assets.blade.php @@ -2,16 +2,29 @@ {{ trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count'=>$assets->count(), 'threshold' => $threshold]) }} @component('mail::table') - - +{{--
 {{ trans('mail.name') }}{{ trans('mail.serial') }}{{ trans('mail.Days') }}{{ trans('mail.expires') }}{{ trans('mail.supplier') }}{{ trans('mail.assigned_to') }}
--}} +{{----}} @foreach ($assets as $asset) @php $expires = Helper::getFormattedDateObject($asset->present()->warranty_expires, 'date'); $diff = round(abs(strtotime($asset->present()->warranty_expires) - strtotime(date('Y-m-d')))/86400); $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' '); @endphp - + {{----}} +@component('mail::table') +| | | +| ------------- | ------------- | +| {{ $icon }} **{{ trans('mail.name') }}** | {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}} | +| **{{ trans('mail.Days') }}** | {{ $diff }} {{ trans('mail.Days') }} | +| **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} | +@if ($asset->supplier) +| **{{ trans('mail.supplier') }}** | {{ ($asset->supplier ? e($asset->supplier->name) : '') }} | +@endif +@if ($asset->assignedTo) +| **{{ trans('mail.assigned_to') }}** | e($asset->assignedTo->present()->display_name) | +@endif +@endcomponent @endforeach -
 {{ trans('mail.name') }}{{ trans('mail.serial') }}{{ trans('mail.Days') }}{{ trans('mail.expires') }}{{ trans('mail.supplier') }}{{ trans('mail.assigned_to') }}
{{ $icon }} {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}}
{{ $diff }} {{ trans('mail.Days') }} {{ !is_null($expires) ? $expires['formatted'] : '' }} {{ ($asset->supplier ? e($asset->supplier->name) : '') }} {{ ($asset->assignedTo ? e($asset->assignedTo->present()->display_name) : '') }}
{{ $icon }} {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}}
{{ $diff }} {{ trans('mail.Days') }} {{ !is_null($expires) ? $expires['formatted'] : '' }} {{ ($asset->supplier ? e($asset->supplier->name) : '') }} {{ ($asset->assignedTo ? e($asset->assignedTo->present()->display_name) : '') }}
+{{----}} @endcomponent @endcomponent