aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/skeleton.php
blob: 6eb6bd1392633bf598787521b5f3d27b3582dfeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
$user = Digitigrade\Model\UserAccount::findByCurrentSession();
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <title><?= $pageTitle ?></title>
    <link rel="stylesheet" href="/static/style.css">
    <link rel="stylesheet" href="https://fonts.bunny.net/css?family=dm-sans:400,400i,800,800i">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://unpkg.com/htmx.org@2.0.4"></script>
    <script src="https://unpkg.com/hyperscript.org@0.9.13"></script>
    <script src="/static/language-switch.js" defer></script>
</head>

<body hx-boost="true">
    <header>
        <nav>
            <?php
            $links = $user == null ? [] : ['/feed/home' => __('timeline.home.shortName')];
            $links = array_merge($links, [
                '/feed/global' => __('timeline.global.shortName'),
                '/feed/local' => __('timeline.local.shortName'),
            ]);
            call_template('navigation_links', ['links' => $links]);
            ?>
            <span id="siteTitle"><?= __('digitigrade') ?></span>
            <?php if ($user == null):
                call_template('navigation_links', ['links' => [
                    '/login' => __('navigation.login')
                ]]);
            else: ?>
                <div>
                    <?php call_template('actor_avatar', ['actor' => $user->actor]) ?>
                    <?= $user->actor->displayName ?>
                </div>
            <?php endif; ?>
        </nav>
    </header>
    <main>
        <section id="leftPane">
            <?php
            if ($user != null) {
                call_template('write_note_form');
            }
            ?>
        </section>
        <section id="centrePane">
            <?php if (!isset($renderTitleHeading) || $renderTitleHeading): ?>
                <h1><?= $pageTitle ?></h1>
            <?php endif; ?>
            <?php slot(); ?>
        </section>
        <section id="rightPane">

        </section>
    </main>
</body>

</html>