planiverse

A minimalist, no-JS front-end for Mastodon.
git clone https://git.mulligrubs.me/planiverse
Log | Files | Refs | README | LICENSE

commit 1ccf787eb12549d1b155ab7ecbec4eab05a27f52
parent 8c6d6437c385562b08da9f29fb826757fdaa5851
Author: St John Karp <contact@stjo.hn>
Date:   Sat, 25 Aug 2018 10:16:38 -0700

Display image attachments as previews

Display image attachments as previews with a link to the original.

Diffstat:
Mresources/views/status_content.blade.php | 24++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/resources/views/status_content.blade.php b/resources/views/status_content.blade.php @@ -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