planiverse

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

commit 50bf84c4e46fade3d8c9b7fd2af7e06272609633
parent 3902114ac0b9f0dce6b4b23f1156a6e38b466c0d
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Sun, 12 Aug 2018 16:53:59 -0700

Show status timestamps

Show how long ago the status was posted. Includes support for
Swatch Internet time if SHOW_BEATS=true.

Diffstat:
Mcomposer.json | 1+
Mcomposer.lock | 4++--
Mpublic/css/styles.css | 5+++++
Mresources/views/status.blade.php | 9+++++++++
4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/composer.json b/composer.json @@ -9,6 +9,7 @@ "fideloper/proxy": "~3.3", "laravel/framework": "5.5.*", "laravel/tinker": "~1.0", + "nesbot/carbon": "^1.33", "revolution/laravel-mastodon-api": "^1.5", "revolution/socialite-mastodon": "^1.2" }, diff --git a/composer.lock b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "777e302fe64df7b4f6c3d53b0d67ca01", - "content-hash": "99e2b15adf8ee6829bad59f44cae2cef", + "hash": "c699abc4e7b0c1784938122332cc0b9b", + "content-hash": "d3b83177a4165b407a361c33e1deac23", "packages": [ { "name": "dnoegel/php-xdg-base-dir", diff --git a/public/css/styles.css b/public/css/styles.css @@ -54,6 +54,11 @@ div.actions span { margin-right: 1em; } +time { + font-size: smaller; + margin-left: 1em; +} + /* Tooltip container */ .tooltip { position: relative; diff --git a/resources/views/status.blade.php b/resources/views/status.blade.php @@ -10,6 +10,15 @@ </a> <span class="tooltiptext">{{ $status['account']['acct'] }}</span> </div> + <time datetime="{{ $status['created_at'] }}"> + @php + $created_at = new Carbon\Carbon($status['created_at']); + @endphp + @if (env('SHOW_BEATS') === true) + {{ '@' . $created_at->format('B') }} | + @endif + {{ $created_at->diffForHumans(null, false, true) }} + </time> @if ($status['reblog'] === null) <p>{!! $status['content'] !!}</p> @foreach ($status['media_attachments'] as $attachment)