@foreach($checkinsList as $checkin)
@php
$hasEmbed = null;
$embedMissing = null;
if (preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath)) {
if (preg_match("/\.webm/", $filepath[1])) {
$hasEmbed = 'videos';
$trip_slug = preg_replace( '/[^A-Za-z0-9-]+/', '-', strtolower( $trip->name ) );
if (file_exists(public_path() . "/" . $trip_slug . "/" . $hasEmbed . "/" . $filepath[1])) {
$path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1];
$embed = '';
if (isset($email)) {
$embed .= 'If your email client doesn\'t support video embeds, here is a link to the file instead.
';
}
} else {
$embed = '[The video \'' . $filepath[1] . '\' has not yet been uploaded, try again later.]
';
$embedMissing = true;
}
} elseif (preg_match("/\.ogg/", $filepath[1])) {
$hasEmbed = 'audio';
if (file_exists(public_path() . "/" . $trip_slug . "/" . $hasEmbed . "/" . $filepath[1])) {
$path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1];
$embed = '';
if (isset($email)) {
$embed .= 'If your email client doesn\' support audio embeds, here is a link to the file instead.
';
}
} else {
$embed = '[The recording \'' . $filepath[1] . '\' has not yet been uploaded, try again later.]
';
$embedMissing = true;
}
}
$checkin->note = preg_replace("/\[\[[^\]]+\]\]/", $embed, $checkin->note);
}
@endphp
{!! $checkin->title ?? "Untitled" !!}
@if($checkin->image_url)
🖼️
@endif
@if($hasEmbed)
@if($hasEmbed === 'videos')
📹
@endif
@if($hasEmbed === 'audio')
🔈
@endif
@endif
{!! render_date_difference($checkin->date) !!}
@if($checkin->note)
@if($checkin->id === 3930)
@include('partials.abolition-checkin')
@else
{!! $checkin->note !!}
@endif
@endif
@if($checkin->image_url)
@endif
@endforeach