planiverse

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

commit cfaf2009ab326f77eeef25459a69c295a1e433a6
parent a134a6e38330a7c9c54cda28f1870238e24d817c
Author: St John Karp <stjohn@fuzzjunket.com>
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