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:
@@ -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="";
|
||||
|
||||
Reference in New Issue
Block a user