diff --git a/app/Http/Controllers/TrackerController.php b/app/Http/Controllers/TrackerController.php index 20bffb6..cb63aa9 100644 --- a/app/Http/Controllers/TrackerController.php +++ b/app/Http/Controllers/TrackerController.php @@ -34,26 +34,13 @@ class TrackerController extends Controller if (!$tripId) return view('no-trip'); $viewMode = $request->input('show', null); - $fromCheckin = $request->input('from', null); - $toCheckin = $request->input('to', null); - $tripData = $this->get_trip_data($tripId); - if ($fromCheckin) { - $tripData->checkins = array_filter($tripData->checkins, function($key) use ($fromCheckin) { return $key >= $fromCheckin; }, ARRAY_FILTER_USE_KEY); - } - - if ($toCheckin) { - $tripData->checkins = array_filter($tripData->checkins, function($key) use ($toCheckin) { return $key <= $toCheckin; }, ARRAY_FILTER_USE_KEY); - } - return view( 'tracker', [ 'trip' => $tripData, - 'showAllCheckins' => ($viewMode === 'all'), - 'fromCheckin' => $fromCheckin, - 'toCheckin' => $toCheckin + 'showAllCheckins' => ($viewMode === 'all') ] ); } diff --git a/app/Mail/Digest.php b/app/Mail/Digest.php index bfaf608..4de5749 100644 --- a/app/Mail/Digest.php +++ b/app/Mail/Digest.php @@ -55,9 +55,6 @@ class Digest extends Mailable case 'weekly': $cutoffDateTime->modify('-1 week'); break; - case 'fortnightly': - $cutoffDateTime->modify('-2 weeks'); - break; case 'monthly': $cutoffDateTime->modify('-1 month'); break; diff --git a/resources/views/emails/digest.blade.php b/resources/views/emails/digest.blade.php index 166f215..131247d 100644 --- a/resources/views/emails/digest.blade.php +++ b/resources/views/emails/digest.blade.php @@ -37,25 +37,21 @@

View the tracker here.


Checkins

-@if($checkins) -
    - @foreach($checkins as $checkin) -
  1. -
    - -

    {!! $checkin->title ?? "Untitled" !!}

    -

    {!! render_date_difference($checkin->date) !!}

    -
    - @if($checkin->note) - {!! $checkin->note !!} - @endif - @if($checkin->image_url) - - @endif -
    -
  2. - @endforeach -
-@else -

No new checkins

-@endif +
    +@foreach($checkins as $checkin) +
  1. +
    + +

    {!! $checkin->title ?? "Untitled" !!}

    +

    {!! render_date_difference($checkin->date) !!}

    +
    + @if($checkin->note) + {!! $checkin->note !!} + @endif + @if($checkin->image_url) + + @endif +
    +
  2. +@endforeach +
diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 8eb518f..5b095b0 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -31,8 +31,8 @@

@if ($showAllCheckins) Check-ins @else Recent Check-ins @endif

-
    - @if($showAllCheckins || $toCheckin || $fromCheckin) +
      + @if($showAllCheckins) @php $checkinsList = array_reverse($trip->checkins) @endphp @else @php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp