Replace checkins list with partial in email template
This commit is contained in:
parent
8dc74febcf
commit
33f9a8584d
3 changed files with 6 additions and 22 deletions
|
@ -33,7 +33,7 @@ class Digest extends Mailable
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $checkins;
|
public $checkinsList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
|
@ -72,8 +72,8 @@ class Digest extends Mailable
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->checkins = array_filter(
|
$this->checkinsList = array_filter(
|
||||||
$trip->checkins,
|
$trip->checkinsList,
|
||||||
function($elem) use ($cutoffDateTime) {
|
function($elem) use ($cutoffDateTime) {
|
||||||
$elemDateTime = new DateTime($elem->created_at);
|
$elemDateTime = new DateTime($elem->created_at);
|
||||||
return $elemDateTime > $cutoffDateTime;
|
return $elemDateTime > $cutoffDateTime;
|
||||||
|
|
|
@ -37,24 +37,9 @@
|
||||||
<p>View the tracker <a href="https://track.bengoldsworthy.net">here.</a></p>
|
<p>View the tracker <a href="https://track.bengoldsworthy.net">here.</a></p>
|
||||||
<hr>
|
<hr>
|
||||||
<h2>Checkins</h2>
|
<h2>Checkins</h2>
|
||||||
@if($checkins)
|
@if($checkinsList)
|
||||||
<ol>
|
<ol>
|
||||||
@foreach($checkins as $checkin)
|
@include('partials.checkins-list')
|
||||||
<li>
|
|
||||||
<details class="checkin" id="{{ $checkin->id }}">
|
|
||||||
<summary class="checkin__summary">
|
|
||||||
<h3 class="checkin__title">{!! $checkin->title ?? "<i>Untitled</i>" !!}</h3>
|
|
||||||
<p class="checkin__meta">{!! render_date_difference($checkin->date) !!}</p>
|
|
||||||
</summary>
|
|
||||||
@if($checkin->note)
|
|
||||||
{!! $checkin->note !!}
|
|
||||||
@endif
|
|
||||||
@if($checkin->image_url)
|
|
||||||
<img class="popup__image" loading="lazy" src="{{ $checkin->image_url }}">
|
|
||||||
@endif
|
|
||||||
</details>
|
|
||||||
</li>
|
|
||||||
@endforeach
|
|
||||||
</ol>
|
</ol>
|
||||||
@else
|
@else
|
||||||
<p>No new checkins</p>
|
<p>No new checkins</p>
|
||||||
|
|
|
@ -38,8 +38,7 @@
|
||||||
@php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp
|
@php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@include('partials.checkin-list')
|
@include('partials.checkins-list')
|
||||||
|
|
||||||
</ol>
|
</ol>
|
||||||
@if (!$showAllCheckins)
|
@if (!$showAllCheckins)
|
||||||
<p><a id="allCheckinsLink" href="?show=all">Show all checkins</a></p>
|
<p><a id="allCheckinsLink" href="?show=all">Show all checkins</a></p>
|
||||||
|
|
Loading…
Reference in a new issue