mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-16 13:06:29 +00:00
49 lines
1.1 KiB
Text
49 lines
1.1 KiB
Text
#? stdtmpl(subsChar = '$', metaChar = '#')
|
|
#import xmltree
|
|
#
|
|
#proc renderMain*(body: string; title="Nitter"): string =
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>${xmltree.escape(title)}</title>
|
|
<link rel="stylesheet" type="text/css" href="/style.css">
|
|
</head>
|
|
|
|
<body>
|
|
<nav id="nav" class="nav-bar container">
|
|
<div class="inner-nav">
|
|
<div class="item">
|
|
<a href="/" class="site-name">nitter</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div id="content" class="container">
|
|
${body}
|
|
</div>
|
|
</body>
|
|
</html>
|
|
#end proc
|
|
#
|
|
#proc renderSearchPanel*(): string =
|
|
<div class="panel">
|
|
<div class="search-panel">
|
|
<form action="search" method="post">
|
|
<input type="text" name="query" placeholder="Enter username...">
|
|
<button type="submit" name="button">🔎</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
#end proc
|
|
#
|
|
#proc renderError*(error: string): string =
|
|
<div class="panel">
|
|
<div class="error-panel">
|
|
<span>${error}</span>
|
|
</div>
|
|
</div>
|
|
#end proc
|
|
#
|
|
#proc showError*(error: string): string =
|
|
${renderMain(renderError(error), title="Error | Nitter")}
|
|
#end proc
|