@foreach($checkinsList as $checkin)
@php
$hasEmbed = null;
$embedMissing = null;
if (preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath)) {
if (preg_match("/\.webm/", $filepath[1])) {
$hasEmbed = 'video';
if (file_exists(public_path() . "/videos/" . $filepath[1])) {
$embed = '';
} 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() . "/audio/" . $filepath[1])) {
$embed = '';
} 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($hasEmbed)
@if($hasEmbed === 'video')
📹
@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