planiverse

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

commit 0143d70112d3224be416591dd2b0ac4ad2efcfd4
parent b5f39c096a1186308260cef1d3340c1ac90cb9ea
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Sun, 12 Aug 2018 09:55:07 -0700

Display reblogs

Made statuses a recursive component so we can display reblogs
correctly.

Diffstat:
Aresources/views/status.blade.php | 33+++++++++++++++++++++++++++++++++
Mresources/views/timeline.blade.php | 17++---------------
2 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/resources/views/status.blade.php b/resources/views/status.blade.php @@ -0,0 +1,33 @@ +<div class="status"> + <div class="tooltip"> + <a href="{{ $status['account']['url'] }}"> + <img + src="{{ $status['account']['avatar'] }}" + alt="{{ $status['account']['acct'] }}" + class="avatar" + /> + {{ $status['account']['display_name'] }} + </a> + <span class="tooltiptext">{{ $status['account']['acct'] }}</span> + </div> + @if ($status['reblog'] === null) + <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> + @endif + @endforeach + @else + @component('status', ['status' => $status['reblog']]) + @endcomponent + @endif +</div> diff --git a/resources/views/timeline.blade.php b/resources/views/timeline.blade.php @@ -11,21 +11,8 @@ </head> <body> @foreach ($statuses as $status) - <div class="status"> - <div class="tooltip"> - <a href="{{ $status['account']['url'] }}"> - <img src="{{ $status['account']['avatar'] }}" alt="{{ $status['account']['acct'] }}" class="avatar" /> - {{ $status['account']['display_name'] }} - </a> - <span class="tooltiptext">{{ $status['account']['acct'] }}</span> - </div> - <p>{!! $status['content'] !!}</p> - @foreach ($status['media_attachments'] as $attachment) - @if ($attachment['type'] === 'image') - <p><img src="{{ $attachment['url'] }}" alt="{{ $attachment['description'] }}" /></p> - @endif - @endforeach - </div> + @component('status', ['status' => $status]) + @endcomponent @endforeach </body> </html>