aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/skeleton.php
diff options
context:
space:
mode:
authorwinter2024-12-31 22:30:16 +0000
committerwinter2024-12-31 22:31:26 +0000
commit4cd7017da9a37e5b9f38c3f50dd1c904ea41cbcb (patch)
treed77f1fd223dae44f40b22c9810aeba238733310d /templates/skeleton.php
parent982e6213622bcb78a40d17f54cda27225a1d84b3 (diff)
implement user accounts and login
Diffstat (limited to 'templates/skeleton.php')
-rw-r--r--templates/skeleton.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/templates/skeleton.php b/templates/skeleton.php
index 0d8afb4..94bc2f2 100644
--- a/templates/skeleton.php
+++ b/templates/skeleton.php
@@ -1,3 +1,6 @@
+<?php
+$user = Digitigrade\Model\UserAccount::findByCurrentSession();
+?>
<!DOCTYPE html>
<html lang="en">
@@ -18,6 +21,16 @@
<li><a href="/feed/local"><?= __('timeline.local.shortName') ?></a></li>
</ul>
<span id="siteTitle"><?= __('digitigrade') ?></span>
+ <?php if ($user == null): ?>
+ <ul>
+ <li><a href="/login"><?= __('navigation.login') ?></a></li>
+ </ul>
+ <?php else: ?>
+ <div>
+ <?php call_template('actor_avatar', ['actor' => $user->actor]) ?>
+ <?= $user->actor->displayName ?>
+ </div>
+ <?php endif; ?>
</nav>
</header>
<main>