diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/actor_profile.php | 6 | ||||
| -rw-r--r-- | templates/actor_profile_page.php | 3 | ||||
| -rw-r--r-- | templates/note.php | 4 | ||||
| -rw-r--r-- | templates/placeholder_text.php | 1 | ||||
| -rw-r--r-- | templates/thread_page.php | 8 |
5 files changed, 19 insertions, 3 deletions
diff --git a/templates/actor_profile.php b/templates/actor_profile.php index 0d99d05..f721fc8 100644 --- a/templates/actor_profile.php +++ b/templates/actor_profile.php @@ -13,5 +13,9 @@ <?php endif; ?> </div> </div> - <p class="bio"><?= $actor->bio ?></p> + <?php if (isset($actor->bio) && $actor->bio != '') { ?> + <p class="bio"><?= $actor->bio ?></p> + <?php } else { + call_template('placeholder_text', ['message' => "This user hasn't written a bio yet."]); + } ?> </div>
\ No newline at end of file diff --git a/templates/actor_profile_page.php b/templates/actor_profile_page.php index e745433..ffa94e3 100644 --- a/templates/actor_profile_page.php +++ b/templates/actor_profile_page.php @@ -10,6 +10,9 @@ call_template('skeleton', [ call_template('actor_profile', ['actor' => $actor]); echo '<hr>'; $notes = Note::findAllWithAuthor($actor, 50); + if (count($notes) == 0) { + call_template('placeholder_text', ['message' => "This user hasn't posted anything yet."]); + } foreach ($notes as $n) { call_template('note', ['note' => $n]); } diff --git a/templates/note.php b/templates/note.php index 6e718f5..8887afb 100644 --- a/templates/note.php +++ b/templates/note.php @@ -6,7 +6,7 @@ <div class="infoLine"> <span class="authorName"><?= $note->author->displayName ?></span> <span class="authorHandle">@<?= $note->author->getFullHandle() ?></span> - <span class="timestamp"> + <a class="timestamp" href="/@/<?= $note->author->getFullHandle() ?>/note/<?= $note->id ?>"> <?= $note->created->format('Y-m-d \a\t H:i') . (isset($note->modified) && $note->modified != $note->created @@ -14,7 +14,7 @@ : '' ) ?> - </span> + </a> </div> <div class="content"> <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?> diff --git a/templates/placeholder_text.php b/templates/placeholder_text.php new file mode 100644 index 0000000..b27e490 --- /dev/null +++ b/templates/placeholder_text.php @@ -0,0 +1 @@ +<p class="placeholder"><?= $message ?? "There's nothing here." ?></p>
\ No newline at end of file diff --git a/templates/thread_page.php b/templates/thread_page.php new file mode 100644 index 0000000..73d8f0b --- /dev/null +++ b/templates/thread_page.php @@ -0,0 +1,8 @@ +<?php +call_template('skeleton', [ + 'pageTitle' => '"' . $note->plainContent . '" - @' . $note->author->getFullHandle(), + 'renderTitleHeading' => false +], function () { + global $note; + call_template('note', ['note' => $note]); +});
\ No newline at end of file |
