planiverse

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

commit c3e6b50f37b8d674278a2834ffd5a81b6ec8dc0f
parent c0e7838308764c74486c8c348cbfe7765e7c2a04
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Mon,  8 Oct 2018 06:38:16 -0700

Show visibility of statuses

Added an icon to show the visibility of a status (public, unlisted,
private, or direct). This goes next to the up arrow indicating
a reply, so this area can be used for other symbols regarding the
status' properties.

Diffstat:
Mpublic/css/styles.css | 2+-
Mresources/views/event_info.blade.php | 46+++++++++++++++++++++++++++++++---------------
Mresources/views/status.blade.php | 3++-
3 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/public/css/styles.css b/public/css/styles.css @@ -71,7 +71,7 @@ div.actions span.reblogged a { color: green; } -time, span.event-action { +time, span.event-indicators { font-size: smaller; margin-left: 1em; } diff --git a/resources/views/event_info.blade.php b/resources/views/event_info.blade.php @@ -10,21 +10,37 @@ </a> </span> - @if ($type !== null) - <span class="event-action"> - @if ($type === 'mention') - mentioned - @elseif ($type === 'reblog') - reblogged - @elseif ($type === 'favourite') - favourited - @elseif ($type === 'follow') - followed you. - @elseif ($type === 'reply') - &#8624; - @endif - </span> - @endif + <span class="event-indicators"> + @if ($visibility !== null) + <span class="visibility"> + @if ($visibility === 'public') + <span title="public">&#9675;</span> + @elseif ($visibility === 'unlisted') + <span title="unlisted">&#9676;</span> + @elseif ($visibility === 'private') + <span title="private">&#128274;</span> + @elseif ($visibility === 'direct') + <span title="direct">&#9993;</span> + @endif + </span> + @endif + + @if ($type !== null) + <span class="event-action"> + @if ($type === 'mention') + mentioned + @elseif ($type === 'reblog') + reblogged + @elseif ($type === 'favourite') + favourited + @elseif ($type === 'follow') + followed you. + @elseif ($type === 'reply') + &#8624; + @endif + </span> + @endif + </span> <time datetime="{{ $created_at }}"> @php diff --git a/resources/views/status.blade.php b/resources/views/status.blade.php @@ -2,7 +2,8 @@ @component('event_info', [ 'account' => $status['account'], 'created_at' => $status['created_at'], - 'type' => $status['in_reply_to_id'] === null ? null : 'reply' + 'type' => $status['in_reply_to_id'] === null ? null : 'reply', + 'visibility' => $status['visibility'] ]) @endcomponent