diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/mobilepane_left.php | 29 | ||||
| -rw-r--r-- | templates/mobilepane_right.php | 9 | ||||
| -rw-r--r-- | templates/skeleton.php | 20 |
3 files changed, 31 insertions, 27 deletions
diff --git a/templates/mobilepane_left.php b/templates/mobilepane_left.php index 83e9e4a..6af4664 100644 --- a/templates/mobilepane_left.php +++ b/templates/mobilepane_left.php @@ -14,7 +14,7 @@ $settings = GlobalSettings::getInstance(); </head> <body> - <header> + <header id="header" hx-swap-oob="true"> <nav> <a id="leftPaneActivator" class="inlineIcon material-symbols close" _="on click go back"></a> <span></span> @@ -24,19 +24,22 @@ $settings = GlobalSettings::getInstance(); </span> </nav> </header> - <main class="mobilePane"> - <?php - $links = [ - '/feed/home' => __('timeline.home.shortName'), - '/feed/global' => __('timeline.global.shortName'), - '/feed/local' => __('timeline.local.shortName'), - ]; - call_template('navigation/header_links', ['links' => $links]); + <main class="mobilePane" id="main" hx-boost="true" hx-indicator="#loadingIndicator" hx-vals='{"fl": 1}' + hx-swap-oob="true"> + <section id="centrePane"> + <?php + $links = [ + '/feed/home' => __('timeline.home.shortName'), + '/feed/global' => __('timeline.global.shortName'), + '/feed/local' => __('timeline.local.shortName'), + ]; + call_template('navigation/header_links', ['links' => $links]); - call_template('note/write_form', ['actor' => $user->actor]); - call_template('navigation/left_side'); - ?> - <p class="versionInfo"><?= sprintf(__('version'), get_version()) ?></p> + call_template('note/write_form', ['actor' => $user->actor]); + call_template('navigation/left_side'); + ?> + <p class="versionInfo"><?= sprintf(__('version'), get_version()) ?></p> + </section> </main> </body> diff --git a/templates/mobilepane_right.php b/templates/mobilepane_right.php index 02749ac..f1cf46a 100644 --- a/templates/mobilepane_right.php +++ b/templates/mobilepane_right.php @@ -13,7 +13,7 @@ $settings = GlobalSettings::getInstance(); </head> <body> - <header> + <header id="header" hx-swap-oob="true"> <nav> <span> <img id="loadingIndicator" class="htmx-indicator" src="/static/tail-spin.svg"></span> @@ -22,8 +22,11 @@ $settings = GlobalSettings::getInstance(); <a id="rightPaneActivator" class="inlineIcon material-symbols close" _="on click go back"></a> </nav> </header> - <main class="mobilePane"> - <?php call_template('notifications_panel', ['user' => UserAccount::requireByCurrentSession()]); ?> + <main class="mobilePane" id="main" hx-boost="true" hx-indicator="#loadingIndicator" hx-vals='{"fl": 1}' + hx-swap-oob="true"> + <section id="centrePane"> + <?php call_template('notifications_panel', ['user' => UserAccount::requireByCurrentSession()]); ?> + </section> </main> </body> diff --git a/templates/skeleton.php b/templates/skeleton.php index c9e28c5..f4963da 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -7,7 +7,7 @@ $settings = GlobalSettings::getInstance(); $fullTitle = $pageTitle . ' — ' . $settings->get('instance.name'); -$loadPartialPage = isset($_SERVER['HTTP_HX_REQUEST']); +$loadPartialPage ??= isset($_SERVER['HTTP_HX_REQUEST']) && !isset($_GET['fl']); if ($loadPartialPage) { echo '<title>' . htmlspecialchars($fullTitle) . '</title>'; goto skipStart; @@ -46,12 +46,11 @@ if ($loadPartialPage) { </head> <body hx-boost="true" hx-indicator="#loadingIndicator" hx-target="#centrePane" hx-swap="outerHTML show:window:top"> - <header> - <?php skipStart: ?> - <nav id="nav" <?= $loadPartialPage ? 'hx-swap-oob="true"' : '' ?>> + <?php skipStart: ?> + <header id="header" hx-swap-oob="true"> + <nav> <?php if ($user != null): ?> - <a id="leftPaneActivator" href="/mobilepane/left" class="inlineIcon material-symbols menu" - hx-boost="false"></a> + <a id="leftPaneActivator" href="/mobilepane/left" class="inlineIcon material-symbols menu"></a> <?php else: ?> <span id="leftPaneActivator"></span> <?php endif; ?> @@ -68,8 +67,7 @@ if ($loadPartialPage) { <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 notifications" - hx-boost="false"></a> + <a id="rightPaneActivator" href="/mobilepane/right" class="inlineIcon material-symbols notifications"></a> <?php endif; ?> <?php if ($user == null): @@ -83,10 +81,10 @@ if ($loadPartialPage) { </a> <?php endif; ?> </nav> - <?php if ($loadPartialPage) - goto skipToMainContent; ?> </header> - <main> + <?php if ($loadPartialPage) + goto skipToMainContent; ?> + <main id="main" hx-swap-oob="true"> <div> <section id="leftPane"> <?php |
