nitter/src/views/general.nim

51 lines
1 KiB
Nim
Raw Normal View History

2019-06-20 14:16:20 +00:00
#? stdtmpl(subsChar = '$', metaChar = '#')
#import user
#import xmltree
#
#proc renderMain*(body: string): string =
<!DOCTYPE html>
<html>
<head>
<title>Nitter</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">
2019-06-20 15:58:31 +00:00
<a href="/" class="site-name">nitter</a>
2019-06-20 14:16:20 +00:00
</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))}
#end proc