From 8dc74febcf28c981d63180797482159628ebeb0b Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 28 Nov 2022 13:46:12 -0600 Subject: [PATCH] Move checkin list to partial --- .../views/partials/checkin-list.blade.php | 16 ++++++++++++++++ resources/views/tracker.blade.php | 18 ++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 resources/views/partials/checkin-list.blade.php diff --git a/resources/views/partials/checkin-list.blade.php b/resources/views/partials/checkin-list.blade.php new file mode 100644 index 0000000..c533718 --- /dev/null +++ b/resources/views/partials/checkin-list.blade.php @@ -0,0 +1,16 @@ +@foreach($checkinsList as $checkin) +
  • +
    + +

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

    +

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

    +
    + @if($checkin->note) + {!! $checkin->note !!} + @endif + @if($checkin->image_url) + + @endif +
    +
  • +@endforeach diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 8eb518f..b956e7d 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -38,22 +38,8 @@ @php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp @endif - @foreach($checkinsList as $checkin) -
  • -
    - -

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

    -

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

    -
    - @if($checkin->note) - {!! $checkin->note !!} - @endif - @if($checkin->image_url) - - @endif -
    -
  • - @endforeach + @include('partials.checkin-list') + @if (!$showAllCheckins)

    Show all checkins