aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorwinter2024-12-24 15:32:56 +0000
committerwinter2024-12-24 15:32:56 +0000
commitd5a57276eb27e215dd0b1bd5eb67ac26acc9575b (patch)
tree0cb3a14fa9a82d2438a7c12838f04ea12e02a9fa /templates
parent01b7c47c68b8b3c5a9fd9137b067b34b566b951d (diff)
more stuff and things
Diffstat (limited to 'templates')
-rw-r--r--templates/actor_profile.php6
-rw-r--r--templates/actor_profile_page.php3
-rw-r--r--templates/note.php4
-rw-r--r--templates/placeholder_text.php1
-rw-r--r--templates/thread_page.php8
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