From 9fdcfdd88598e7f649d039df36b9cc988cf1e0c2 Mon Sep 17 00:00:00 2001 From: hyzen Date: Tue, 9 Jun 2026 12:02:55 +0530 Subject: [PATCH] Fix: services pagination. Fix: login/signup auto-redirect to homepage if already logged in --- docs/login/index.html | 2 +- docs/services/email-account/index.html | 2 +- docs/services/file-share/index.html | 3 +-- docs/services/xmpp-account/index.html | 3 ++- docs/signup/index.html | 2 +- layouts/login/single.html | 4 +-- layouts/services/single.html | 37 +++++++++----------------- layouts/signup/single.html | 14 ++++------ 8 files changed, 25 insertions(+), 42 deletions(-) diff --git a/docs/login/index.html b/docs/login/index.html index e578bfd..27b709c 100644 --- a/docs/login/index.html +++ b/docs/login/index.html @@ -12,4 +12,4 @@ \ No newline at end of file + \ No newline at end of file diff --git a/docs/services/email-account/index.html b/docs/services/email-account/index.html index 0c320b0..faf416d 100644 --- a/docs/services/email-account/index.html +++ b/docs/services/email-account/index.html @@ -9,4 +9,4 @@ Please sign up to create an email account."> Subscribe

Email

\ No newline at end of file +› Email

Email

\ No newline at end of file diff --git a/docs/services/file-share/index.html b/docs/services/file-share/index.html index 489ec52..cb92c59 100644 --- a/docs/services/file-share/index.html +++ b/docs/services/file-share/index.html @@ -7,5 +7,4 @@ Subscribe

File Share

Visit share.freedoms4.org↗ -to quickly upload files and get sharable links.

\ No newline at end of file +to quickly upload files and get sharable links.

\ No newline at end of file diff --git a/docs/services/xmpp-account/index.html b/docs/services/xmpp-account/index.html index 23b3fa0..1508293 100644 --- a/docs/services/xmpp-account/index.html +++ b/docs/services/xmpp-account/index.html @@ -9,4 +9,5 @@ Please sign up to create an XMPP account."> Subscribe

XMPP

\ No newline at end of file +› XMPP

XMPP

\ No newline at end of file diff --git a/docs/signup/index.html b/docs/signup/index.html index 94921d4..152c385 100644 --- a/docs/signup/index.html +++ b/docs/signup/index.html @@ -21,4 +21,4 @@ -

\ No newline at end of file +

\ No newline at end of file diff --git a/layouts/login/single.html b/layouts/login/single.html index 99c5b63..5402f0e 100644 --- a/layouts/login/single.html +++ b/layouts/login/single.html @@ -100,9 +100,6 @@ 'auth-message auth-message--success'; document.getElementById('auth-message').style.display = 'block'; document.getElementById('login-form').style.display = 'none'; - setTimeout(function () { - window.location.href = '/'; - }, 1500); return; } @@ -130,6 +127,7 @@ var submitBtn = document.getElementById('login-submit'); var eyeBtn = form.querySelector('.auth-form__eye'); var pwdInput = document.getElementById('login-password'); + var pwdInput = document.getElementById('login-password'); eyeBtn.addEventListener('click', function () { var isText = pwdInput.type === 'text'; diff --git a/layouts/services/single.html b/layouts/services/single.html index 282c501..00bb3c9 100644 --- a/layouts/services/single.html +++ b/layouts/services/single.html @@ -1,33 +1,22 @@ {{ define "main" }}

{{ .Title }}

-{{ .Content }} - -{{/* Prev/next among sibling services */}} -{{ $allPages := .CurrentSection.Pages.ByTitle }} -{{ $currentTitle := .Title }} -{{ $currentIdx := 0 }} -{{ range $i, $p := $allPages }} - {{ if eq $p.Title $currentTitle }}{{ $currentIdx = $i }}{{ end }} -{{ end }} - -{{ if gt (len $allPages) 1 }} +{{ .Content }} {{/* Prev/next among sibling services */}} {{ $allPages := +.CurrentSection.Pages.ByWeight }} {{ $currentTitle := .Title }} {{ $currentIdx := 0 }} {{ range $i, +$p := $allPages }} {{ if eq $p.Title $currentTitle }}{{ $currentIdx = $i }}{{ end }} {{ end }} {{ if +gt (len $allPages) 1 }} -{{ end }} - -{{ end }} +{{ end }} {{ end }} diff --git a/layouts/signup/single.html b/layouts/signup/single.html index cea860e..1fb8601 100644 --- a/layouts/signup/single.html +++ b/layouts/signup/single.html @@ -183,9 +183,6 @@ 'auth-message auth-message--success'; document.getElementById('auth-message').style.display = 'block'; document.getElementById('signup-form').style.display = 'none'; - setTimeout(function () { - window.location.href = '/'; - }, 1500); return; } @@ -195,7 +192,6 @@ sessionStorage.getItem('f4_login_next') || ''; - // Save referrer as next-page if not already set and referrer is on this site if (!_signupNext && document.referrer) { try { var _refUrl = new URL(document.referrer); @@ -394,11 +390,11 @@ if (data.success) { showMsg('Account created! Redirecting to login\u2026', 'success'); setTimeout(function () { - window.location.href = - _signupNext && _signupNext.startsWith('/') - ? '/login/?next=' + encodeURIComponent(_signupNext) - : '/login/'; - window.location.href = '/login/'; + var _loginUrl = '/login/'; + if (_signupNext && _signupNext.startsWith('/')) { + _loginUrl = '/login/?next=' + encodeURIComponent(_signupNext); + } + window.location.href = _loginUrl; }, 1800); } else { showMsg(data.message || 'Sign-up failed. Please try again.', 'error');