diff options
| author | winter | 2025-01-18 20:02:39 +0000 |
|---|---|---|
| committer | winter | 2025-01-18 20:02:39 +0000 |
| commit | 66bdcf04f431d615b5fac93e7677e7304888e90c (patch) | |
| tree | d75f1b299e8ed2ff8d2fd6ccd42185cfb06b6729 /templates/skeleton.php | |
| parent | 00ab9734e880219fa68fed98cefda5ce12958e4b (diff) | |
implement settings editor page
Diffstat (limited to 'templates/skeleton.php')
| -rw-r--r-- | templates/skeleton.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/templates/skeleton.php b/templates/skeleton.php index b274484..3aaf132 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -1,5 +1,6 @@ <?php +use Digitigrade\GlobalSettings; use Digitigrade\Model\FollowRelation; $user = Digitigrade\Model\UserAccount::findByCurrentSession(); ?> @@ -28,7 +29,7 @@ $user = Digitigrade\Model\UserAccount::findByCurrentSession(); ]); call_template('navigation_links', ['links' => $links]); ?> - <span id="siteTitle"><?= __('digitigrade') ?></span> + <span id="siteTitle"><?= GlobalSettings::getInstance()->get('instance.name') ?></span> <img id="loadingIndicator" class="htmx-indicator" src="/static/tail-spin.svg"> <?php if ($user == null): call_template('navigation_links', ['links' => [ @@ -47,15 +48,17 @@ $user = Digitigrade\Model\UserAccount::findByCurrentSession(); <?php if ($user != null) { call_template('write_note_form'); - call_template('side_navigation', ['links' => [ - [ - 'href' => '/followrequests', - 'icon' => 'person_add', - 'label' => __('navigation.followRequests'), - 'unreadCount' => FollowRelation::countWhere("object = ? AND status = 'pending'", [$user->actor->id]) - ], - ['href' => '/logout', 'icon' => 'logout', 'label' => __('navigation.logout')] - ]]); + $links = [[ + 'href' => '/followrequests', + 'icon' => 'person_add', + 'label' => __('navigation.followRequests'), + 'unreadCount' => FollowRelation::countWhere("object = ? AND status = 'pending'", [$user->actor->id]) + ]]; + if ($user->isAdmin) { + $links[] = ['href' => '/admin/settings/instance', 'icon' => 'settings', 'label' => __('navigation.instanceSettings')]; + } + $links[] = ['href' => '/logout', 'icon' => 'logout', 'label' => __('navigation.logout')]; + call_template('side_navigation', ['links' => $links]); } ?> </section> |
