From b08d86220ac439f312d4d1ebe5d471d5c0c90f6c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 28 Aug 2025 16:53:13 -0700 Subject: [PATCH 1/5] 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 From 751dad7f2eceb28df5204c0740f09310213bfff9 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 28 Aug 2025 16:56:12 -0700 Subject: [PATCH 2/5] Inline days --- .../markdown/report-expiring-assets.blade.php | 7 +++---- 1 file changed, 3 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 da9ec5ca50..fcf50067a0 100644 --- a/resources/views/notifications/markdown/report-expiring-assets.blade.php +++ b/resources/views/notifications/markdown/report-expiring-assets.blade.php @@ -14,14 +14,13 @@ $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' @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'] : '' }} | +| **{{ trans('mail.name') }}** | {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}} | +| **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} ( {{ $icon }} {{ $diff }} {{ trans('mail.Days') }} ) | @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) | +| **{{ trans('mail.assigned_to') }}** | {{ e($asset->assignedTo->present()->display_name) }} | @endif @endcomponent @endforeach From 35b79e4d148ceca5882486759676577b7d93bef8 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 28 Aug 2025 16:56:40 -0700 Subject: [PATCH 3/5] Remove old comments --- .../notifications/markdown/report-expiring-assets.blade.php | 4 ---- 1 file changed, 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 fcf50067a0..11dd5bc534 100644 --- a/resources/views/notifications/markdown/report-expiring-assets.blade.php +++ b/resources/views/notifications/markdown/report-expiring-assets.blade.php @@ -2,15 +2,12 @@ {{ trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count'=>$assets->count(), 'threshold' => $threshold]) }} @component('mail::table') -{{----}} -{{----}} @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') | | | | ------------- | ------------- | @@ -24,6 +21,5 @@ $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' @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) : '') }}
--}} @endcomponent @endcomponent From 65b66beb07b1ba28a723d6555467e90fb3688ca7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 2 Sep 2025 14:55:46 -0700 Subject: [PATCH 4/5] Make icon more prominent --- .../markdown/report-expiring-assets.blade.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/notifications/markdown/report-expiring-assets.blade.php b/resources/views/notifications/markdown/report-expiring-assets.blade.php index 11dd5bc534..de586bfd8c 100644 --- a/resources/views/notifications/markdown/report-expiring-assets.blade.php +++ b/resources/views/notifications/markdown/report-expiring-assets.blade.php @@ -9,15 +9,15 @@ $diff = round(abs(strtotime($asset->present()->warranty_expires) - strtotime(dat $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' '); @endphp @component('mail::table') -| | | -| ------------- | ------------- | -| **{{ trans('mail.name') }}** | {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}} | -| **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} ( {{ $icon }} {{ $diff }} {{ trans('mail.Days') }} ) | +| | | | +| ------------- | ------------- | ------------- | +| {{ $icon }} | **{{ trans('mail.name') }}** | {{ $asset->present()->name }}
{{trans('mail.serial').': '.$asset->serial}} | +| | **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} ({{ $diff }} {{ trans('mail.Days') }}) | @if ($asset->supplier) -| **{{ trans('mail.supplier') }}** | {{ ($asset->supplier ? e($asset->supplier->name) : '') }} | +| | **{{ trans('mail.supplier') }}** | {{ ($asset->supplier ? e($asset->supplier->name) : '') }} | @endif @if ($asset->assignedTo) -| **{{ trans('mail.assigned_to') }}** | {{ e($asset->assignedTo->present()->display_name) }} | +| | **{{ trans('mail.assigned_to') }}** | {{ e($asset->assignedTo->present()->display_name) }} | @endif @endcomponent @endforeach From 27022954b15452e211715e3e685552950f8c2185 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 3 Sep 2025 10:44:19 -0700 Subject: [PATCH 5/5] Inline icon --- .../markdown/report-expiring-assets.blade.php | 8 ++++---- 1 file changed, 4 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 31112ec4eb..0b760058ea 100644 --- a/resources/views/notifications/markdown/report-expiring-assets.blade.php +++ b/resources/views/notifications/markdown/report-expiring-assets.blade.php @@ -11,13 +11,13 @@ $icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' @component('mail::table') | | | | | ------------- | ------------- | ------------- | -| {{ $icon }} | **{{ trans('mail.name') }}** | {{ $asset->display_name }}
{{trans('mail.serial').': '.$asset->serial}} | -| | **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} ({{ $diff }} {{ trans('mail.Days') }}) | +| {{ $icon }} **{{ trans('mail.name') }}** | {{ $asset->display_name }}
{{trans('mail.serial').': '.$asset->serial}} | +| **{{ trans('mail.expires') }}** | {{ !is_null($expires) ? $expires['formatted'] : '' }} ({{ $diff }} {{ trans('mail.Days') }}) | @if ($asset->supplier) -| | **{{ trans('mail.supplier') }}** | {{ ($asset->supplier ? e($asset->supplier->name) : '') }} | +| **{{ trans('mail.supplier') }}** | {{ ($asset->supplier ? e($asset->supplier->name) : '') }} | @endif @if ($asset->assignedTo) -| | **{{ trans('mail.assigned_to') }}** | {{ e($asset->assignedTo->present()->display_name) }} | +| **{{ trans('mail.assigned_to') }}** | {{ e($asset->assignedTo->present()->display_name) }} | @endif @endcomponent @endforeach