Where-in-the-World-is-Ben/resources/views/partials/checkins-list.blade.php
Ben Goldsworthy b0908035a7 Change media embed links to use Laravel URL generation
This means that they should work in email digests now.
2022-12-03 13:09:11 -06:00

31 lines
1.5 KiB
PHP

@foreach($checkinsList as $checkin)
<li>
<details class="checkin" id="{{ $checkin->id }}" ontoggle="toggleCheckin(this.open, this.id)">
<summary class="checkin__summary">
<h2 class="checkin__title">{!! $checkin->title ?? "<i>Untitled</i>" !!}</h2>
<p class="checkin__meta">{!! render_date_difference($checkin->date) !!}</p>
</summary>
@if($checkin->note)
@if(preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath))
@if(preg_match("/\.webm/", $filepath[1]))
<video class="popup__video" controls>
<source src="{{ url("/videos/$filepath[1]") }}" type="video/webm">
<p>Your browser doesn't support HTML video. Here is a <a href="{{ url("/videos/$filepath[1]") }}">link to the video</a> instead.</p>
</video>
@elseif(preg_match("/\.ogg/", $filepath[1]))
<audio class="popup__audio" controls>
<source src="{{ url("/audio/$filepath[1]") }}" type="audio/ogg">
<p>Download <a href="{{ url("/audio/$filepath[1]") }}">OGG</a> audio.</p>
</audio>
@endif
@else
{!! $checkin->note !!}
@endif
@endif
@if($checkin->image_url)
<img class="popup__image" loading="lazy" src="{{ $checkin->image_url }}">
@endif
</details>
</li>
@endforeach