084
This commit is contained in:
parent
5a1ec3c3ee
commit
3a62312a15
@ -34,7 +34,9 @@
|
||||
<span class="icon icon-person"></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
{% if user.accessLevel >= 2 %}
|
||||
<a class="dropdown-item" href="/admin/dashboard">Dashboard</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="/logout">Logout</a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -3,12 +3,15 @@ import
|
||||
segfaults,
|
||||
os,
|
||||
nimja/parser,
|
||||
./a3pkg/[models, mics]
|
||||
./a3pkg/[models, mics],
|
||||
./a3c/users
|
||||
|
||||
proc index*(ctx: Context): string =
|
||||
var
|
||||
products: seq[Products]
|
||||
cookies = ctx.cookies
|
||||
user: User
|
||||
db = newDatabase()
|
||||
|
||||
email = cookies.getOrDefault("email", "")
|
||||
password = cookies.getOrDefault("password", "")
|
||||
@ -17,5 +20,6 @@ proc index*(ctx: Context): string =
|
||||
echo "No cookie found."
|
||||
else:
|
||||
products = micsGetProducts(email, password)
|
||||
user = db.getUser(email, password)
|
||||
|
||||
compileTemplateFile(getScriptDir() / "a3a" / "index.nimja")
|
Loading…
Reference in New Issue
Block a user