Add past trip view
This commit is contained in:
parent
a75d45b03f
commit
7793a01828
6 changed files with 193 additions and 4 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
<header>
|
||||
<h1>Where in the World is Ben?</h1>
|
||||
<p><a href="/past-trips">Past trips</a></p>
|
||||
<p>
|
||||
<span> Tracking started: {{ date('j M Y (G:H)', strtotime($trip->date_start)) }}</span> |
|
||||
<span class="{{ ($trip->is_active) ? "positive" : "negative" }}">{{ ($trip->is_active) ? "Active" : "Ended" }}</span> |
|
||||
|
@ -38,7 +39,7 @@
|
|||
<summary><h2>{{ $checkin->title ?? "[No title]" }}</h2> <span>{{ date('j M Y (G:H)', strtotime($checkin->date)) }}</span></summary>
|
||||
{{ $checkin->note ?? "[No note]" }}
|
||||
@if($checkin->image_url)
|
||||
<img class="popup__image" src="{{ $checkin->image_url }}">
|
||||
<img class="popup__image" loading="lazy" src="{{ $checkin->image_url }}">
|
||||
@endif
|
||||
</details>
|
||||
</li>
|
||||
|
@ -66,6 +67,7 @@
|
|||
|
||||
var marker = null, popupMarkup = null;
|
||||
@foreach($trip->checkins as $checkin)
|
||||
@if($checkin->id != 2602)
|
||||
marker = L.marker([{{ $checkin->location->latitude }}, {{ $checkin->location->longitude }}]).addTo(map);
|
||||
|
||||
popupMarkup = '<h2 class="popup__title">{{ $checkin->title ?? "No Title" }}</h2>';
|
||||
|
@ -74,6 +76,7 @@
|
|||
marker.bindPopup(popupMarkup).openPopup();
|
||||
|
||||
checkinMarkers[{{ $checkin->id }}] = marker;
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
var currLocation = L.marker(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue