aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/skeleton.php
blob: f7670c09cf3e3a836a4f9f0ece7a049b76de5f6c (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
use Digitigrade\GlobalSettings;
use Digitigrade\Model\FollowRelation;
use Digitigrade\Model\UserAccount;

$user = UserAccount::findByCurrentSession();
$settings = GlobalSettings::getInstance();
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <title><?= $pageTitle ?> &mdash; <?= $settings->get('instance.name') ?></title>
    <?php call_template('head_tags'); ?>
</head>

<body hx-boost="true" hx-indicator="#loadingIndicator">
    <header>
        <nav>
            <?php if ($user != null): ?>
                <a id="leftPaneActivator" href="/mobilepane/left" class="inlineIcon material-symbols-outlined">
                    menu
                </a>
            <?php else: ?>
                <span id="leftPaneActivator"></span>
            <?php endif; ?>

            <?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"><?= $settings->get('instance.name') ?></span>
            <img id="loadingIndicator" class="htmx-indicator" src="/static/tail-spin.svg">

            <?php if ($user != null): ?>
                <a id="rightPaneActivator" href="/mobilepane/right" class="inlineIcon material-symbols-outlined">
                    notifications
                </a>
            <?php endif; ?>

            <?php if ($user == null):
                call_template('navigation_links', ['links' => [
                    '/login' => __('navigation.login')
                ]]);
            else: ?>
                <a href="/@/<?= $user->actor->handle ?>" id="currentUserInfo">
                    <?php call_template('actor_avatar', ['actor' => $user->actor]) ?>
                    <?= $user->actor->displayName ?>
                </a>
            <?php endif; ?>
        </nav>
    </header>
    <main>
        <div>
            <section id="leftPane">
                <?php
                if ($user != null) {
                    call_template('write_note_form');
                }
                call_template('left_side_navigation');
                ?>
                <p class="versionInfo"><?= sprintf(__('version'), get_version()) ?></p>
            </section>
        </div>
        <div>
            <section id="centrePane">
                <?php if (!isset($renderTitleHeading) || $renderTitleHeading): ?>
                    <h1><?= $pageTitle ?></h1>
                <?php endif; ?>
                <?php slot(); ?>
            </section>
        </div>
        <div>
            <section id="rightPane">
                <?php if ($user != null) {
                    call_template('notifications_panel', ['user' => $user]);
                } ?>
            </section>
        </div>
    </main>
</body>

</html>