aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorwinter2024-12-23 19:48:28 +0000
committerwinter2024-12-23 19:48:28 +0000
commit505d25e29f1c13403bfbfe7cd9d1ab125be87a4b (patch)
tree1f2e914b3aacd57defb84acf78a871ad1f896927 /templates
parentbccad1118364427ea5c97c08d132fd128368760b (diff)
make the timelines look nicer and add local tl
Diffstat (limited to 'templates')
-rw-r--r--templates/alertbox.php3
-rw-r--r--templates/global_timeline.php4
-rw-r--r--templates/local_timeline.php10
-rw-r--r--templates/note.php7
-rw-r--r--templates/skeleton.php7
5 files changed, 27 insertions, 4 deletions
diff --git a/templates/alertbox.php b/templates/alertbox.php
new file mode 100644
index 0000000..5d1f607
--- /dev/null
+++ b/templates/alertbox.php
@@ -0,0 +1,3 @@
+<div class="alertbox <?= $variety ?>">
+ <p><?= $message ?></p>
+</div> \ No newline at end of file
diff --git a/templates/global_timeline.php b/templates/global_timeline.php
index dbecd7b..cdaac5e 100644
--- a/templates/global_timeline.php
+++ b/templates/global_timeline.php
@@ -1,5 +1,9 @@
<?php call_template('skeleton', ['pageTitle' => 'Global timeline'], function () {
global $notes;
+ call_template('alertbox', [
+ 'variety' => 'info',
+ 'message' => 'This timeline shows all known public indexable notes'
+ ]);
foreach ($notes as $n) {
call_template('note', ['note' => $n]);
}
diff --git a/templates/local_timeline.php b/templates/local_timeline.php
new file mode 100644
index 0000000..a4624b5
--- /dev/null
+++ b/templates/local_timeline.php
@@ -0,0 +1,10 @@
+<?php call_template('skeleton', ['pageTitle' => 'Local timeline'], function () {
+ global $notes;
+ call_template('alertbox', [
+ 'variety' => 'info',
+ 'message' => 'This timeline shows all public indexable notes posted by users on this server'
+ ]);
+ foreach ($notes as $n) {
+ call_template('note', ['note' => $n]);
+ }
+}); \ No newline at end of file
diff --git a/templates/note.php b/templates/note.php
index c3ec9fd..93a22fd 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -1,11 +1,14 @@
<article class="note">
- <img class="authorAvatar" src="<?= $note->author->avatar ?>">
+ <picture>
+ <source srcset="<?= $note->author->avatar ?>">
+ <img class="authorAvatar" src="/static/default-avatar.svg">
+ </picture>
<div>
<a class="authorName" <?= isset($note->author->homepage) ? 'href="' . $note->author->homepage . '"' : '' ?>>
<?= $note->author->displayName ?>
</a>
<div class="postContent">
- <?= $note->plainContent ?>
+ <?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
</div>
</div>
</article> \ No newline at end of file
diff --git a/templates/skeleton.php b/templates/skeleton.php
index d1e08e0..5e181b6 100644
--- a/templates/skeleton.php
+++ b/templates/skeleton.php
@@ -8,9 +8,12 @@
<body>
<header>
- <span id="siteTitle">Digitigrade???????</span>
<nav>
- <span>navigation links go here i suppose?</span>
+ <ul>
+ <li><a href="/feed/global">Global</a></li>
+ <li><a href="/feed/local">Local</a></li>
+ </ul>
+ <span id="siteTitle">Digitigrade</span>
</nav>
</header>
<main>