diff options
| -rw-r--r-- | static/note.css | 7 | ||||
| -rw-r--r-- | templates/actor_profile_page.php | 2 | ||||
| -rw-r--r-- | templates/note_hidden.php | 3 | ||||
| -rw-r--r-- | templates/thread_page.php | 8 |
4 files changed, 19 insertions, 1 deletions
diff --git a/static/note.css b/static/note.css index 7e0f529..3051488 100644 --- a/static/note.css +++ b/static/note.css @@ -167,3 +167,10 @@ article.note { } } } + +article.note.hidden { + padding-top: 0; + padding-bottom: 0; + display: block; + text-align: center; +} diff --git a/templates/actor_profile_page.php b/templates/actor_profile_page.php index eba9d04..3b6eb84 100644 --- a/templates/actor_profile_page.php +++ b/templates/actor_profile_page.php @@ -15,6 +15,8 @@ call_template('skeleton', [ $notes = Note::findAllWithAuthor($actor, 20); if (count($notes) == 0) { call_template('placeholder_text', ['message' => __('user.notes.placeholder')]); + } elseif ($user != null && $user->actor->blocks($actor)) { + call_template('placeholder_text', ['message' => __('user.profile.notesHidden')]); } else { foreach ($notes as $n) { if ($n->isViewableBy($user)) diff --git a/templates/note_hidden.php b/templates/note_hidden.php new file mode 100644 index 0000000..baad0d6 --- /dev/null +++ b/templates/note_hidden.php @@ -0,0 +1,3 @@ +<article class="note hidden"> + <?php call_template('placeholder_text', ['message' => __('note.hidden')]); ?> +</article>
\ No newline at end of file diff --git a/templates/thread_page.php b/templates/thread_page.php index e5e5389..d16c6aa 100644 --- a/templates/thread_page.php +++ b/templates/thread_page.php @@ -1,5 +1,6 @@ <?php use Digitigrade\Model\Note; +use Digitigrade\Model\UserAccount; call_template('skeleton', [ 'pageTitle' => '"' . $note->plainContent . '" - @' . $note->author->getFullHandle(), @@ -7,7 +8,12 @@ call_template('skeleton', [ ], function () { global $note; $notes = Note::findAllInThread($note->threadApex ?? $note); + $user = UserAccount::findByCurrentSession(); foreach ($notes as $n) { - call_template('note', ['note' => $n, 'selected' => $n == $note]); + if ($user != null && $user->actor->blocks($n->author)) { + call_template('note_hidden'); + } else { + call_template('note', ['note' => $n, 'selected' => $n == $note]); + } } });
\ No newline at end of file |
