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