Display image attachments as previews

Display image attachments as previews with a link to the original.
This commit is contained in:
St John Karp 2018-08-25 10:16:38 -07:00
parent a134a6e383
commit cfaf2009ab
1 changed files with 14 additions and 10 deletions

View File

@ -2,16 +2,20 @@
<p>{!! $status['content'] !!}</p>
@foreach ($status['media_attachments'] as $attachment)
@if ($attachment['type'] === 'image')
<p>
<img
src="{{
$attachment['remote_url'] === null
? $attachment['url']
: $attachment['remote_url']
}}"
alt="{{ $attachment['description'] }}"
/>
</p>
<figure>
<a href="{{
$attachment['remote_url'] === null
? $attachment['url']
: $attachment['remote_url']
}}"
target="_blank"
>
<img
src="{{ $attachment['preview_url'] }}"
alt="{{ $attachment['description'] }}"
/>
</a>
</figure>
@endif
@endforeach
@else