diff --git a/app/Http/Controllers/TrackerController.php b/app/Http/Controllers/TrackerController.php index f584af8..cbd59fc 100644 --- a/app/Http/Controllers/TrackerController.php +++ b/app/Http/Controllers/TrackerController.php @@ -21,23 +21,7 @@ class TrackerController extends Controller */ public function show_past_trips_list() { - $trips = []; - - foreach (config('app.past_trip_ids') as $tripId) { - $tripData = $this->get_trip_data($tripId, false); - $trips[$tripId] = [ - 'name' => $tripData->name, - 'start_date' => new DateTime($tripData->date_start), - 'end_date' => new DateTime($tripData->date_end) - ]; - } - - return view( - 'past-trips', - [ - 'trips' => $trips - ] - ); + return view('past-trips'); } /** diff --git a/resources/views/past-trips.blade.php b/resources/views/past-trips.blade.php index 3db331f..b246a1a 100644 --- a/resources/views/past-trips.blade.php +++ b/resources/views/past-trips.blade.php @@ -14,10 +14,9 @@
    - @php $DATE_FORMAT = 'M Y' @endphp - @foreach ($trips as $trip_id => $trip) -
  1. {{ $trip['name'] }} ({{ $trip['start_date']->format($DATE_FORMAT) }} to {{ $trip['end_date']->format($DATE_FORMAT) }})
  2. - @endforeach +
  3. Monkey Run Scotland 2022
  4. +
  5. Europespedition III: Leds Free or Die Hard
  6. +
  7. Bentral American Diaries
diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 750c365..ae17123 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -66,20 +66,18 @@ @if(!in_array($location->id, config('app.current_trip_ignore'))) @php - // Privacy zones - $privacyLatLons = config('app.privacy_lat_lons'); - foreach ($privacyLatLons as $latLonUnparsed) { - $latLon = explode(',', $latLonUnparsed); - if ( - !( - ( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) || - ( $location->longitude - $latLon[1] > 0.01 ) || ( $location->longitude - $latLon[1] < -0.01 ) - ) - ) { - $location->latitude = $location->latitude + ((rand(0,2)-1)/100); - $location->longitude = $location->longitude + ((rand(0,2)-1)/100); - } - } + // Privacy zones + $privacyLatLons = config('app.privacy_lat_lons'); + $latLon = explode(',', $privacyLatLons[0]); + if ( + !( + ( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) || + ( $location->longitude - $latLon[1] > 0.01 ) || ( $location->longitude - $latLon[1] < -0.01 ) + ) + ) { + $location->latitude = $location->latitude + ((rand(0,2)-1)/100); + $location->longitude = $location->longitude + ((rand(0,2)-1)/100); + } @endphp [{{ $location->latitude }}, {{ $location->longitude }}],