feat: cherry-picked checkins

This commit is contained in:
Ben Goldsworthy 2024-07-06 00:28:30 +02:00
parent 1e0f82d435
commit 1b0b240de3
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE
2 changed files with 5 additions and 4 deletions

View file

@ -90,7 +90,8 @@ class TrackerController extends Controller
'trip' => $tripData,
'showAllCheckins' => ($viewMode === 'all'),
'fromCheckin' => $fromCheckin,
'toCheckin' => $toCheckin
'toCheckin' => $toCheckin,
'cherryPicked' => !!$cherryPickedCheckins
]
);
}

View file

@ -30,11 +30,11 @@
<div id="map"></div>
</section>
<section id="checkinList">
<h2 class="section__title">@if ($showAllCheckins) Posts @else Recent Posts @endif</h2>
<h2 class="section__title">@if ($showAllCheckins) Posts @elseif ($cherryPicked || $toCheckin || $fromCheckin) Selected Posts @else Recent Posts @endif</h2>
<p style="font-weight: bold; text-align: center;">Want to receive a regular email digest of updates?</p>
<p style="text-align: center;">Ask me and I'll add you to the list: weekly, fortnightly and monthly options available (or daily if you're really keen).</p>
<ol @if(!($showAllCheckins || $toCheckin || $fromCheckin)) start="{{ count($trip->checkins) }}" reversed @endif>
@if($showAllCheckins || $toCheckin || $fromCheckin)
<ol @if(!($showAllCheckins || $toCheckin || $fromCheckin || $cherryPicked)) start="{{ count($trip->checkins) }}" @if(!$cherryPicked) reversed @endif @endif>
@if($showAllCheckins || $toCheckin || $fromCheckin || $cherryPicked)
@php $checkinsList = $trip->checkins @endphp
@else
@php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp