1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-06 03:55:36 -05:00

Improve and simplify preferences page behavior

This commit is contained in:
Zed
2022-01-03 02:12:51 +01:00
parent ab51ff06c8
commit bb981df657
5 changed files with 8 additions and 12 deletions

View File

@@ -12,8 +12,10 @@ const
lp = readFile("public/lp.svg")
proc renderNavbar(cfg: Config; req: Request; rss, canonical: string): VNode =
var path = $(parseUri(req.path) ? filterParams(req.params))
if "/status" in path: path.add "#m"
var path = req.params.getOrDefault("referer")
if path.len == 0:
path = $(parseUri(req.path) ? filterParams(req.params))
if "/status/" in path: path.add "#m"
buildHtml(nav):
tdiv(class="inner-nav"):
@@ -29,7 +31,7 @@ proc renderNavbar(cfg: Config; req: Request; rss, canonical: string): VNode =
icon "bird", title="Open in Twitter", href=canonical
a(href="https://liberapay.com/zedeus"): verbatim lp
icon "info", title="About", href="/about"
iconReferer "cog", "/settings", path, title="Preferences"
icon "cog", title="Preferences", href=("/settings?referer=" & encodeUrl(path))
proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
images: seq[string] = @[]; banner=""; ogTitle=""; theme="";