Update home module
This commit is contained in:
parent
43b46d9bad
commit
a329f6b71b
@ -1,5 +1,8 @@
|
|||||||
from mako.template import Template
|
from mako.template import Template
|
||||||
from config import globalvar
|
from config import globalvar
|
||||||
|
from scripts import loggorilla
|
||||||
|
|
||||||
|
import procedure.validation as procedure_validation
|
||||||
|
|
||||||
class main:
|
class main:
|
||||||
|
|
||||||
@ -7,13 +10,23 @@ class main:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def html(self, params):
|
def html(self, params):
|
||||||
|
APIADDR = "/"
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Define page parameters")
|
||||||
|
active_page = "Home"
|
||||||
|
allowed_roles = [0,1,2,3]
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Account validation")
|
||||||
|
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
|
||||||
|
user = user_validation['data']
|
||||||
|
|
||||||
return Template(params["mako"]["website"]['index']).render(
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
title = globalvar.title,
|
title = globalvar.title,
|
||||||
header = "Welcome to CostaPy",
|
header = globalvar.header,
|
||||||
navbar = Template(params["mako"]["website"]['navbar']).render(
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
menu = globalvar.menu['public']['navbar'],
|
menu = globalvar.menu['public']['navbar'],
|
||||||
user_roles = ["guest"],
|
user_roles = user['profile']['roles'],
|
||||||
active_page = "Home"
|
active_page = active_page
|
||||||
),
|
),
|
||||||
footer = Template(params["mako"]["website"]['footer']).render(
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
copyright = globalvar.copyright,
|
copyright = globalvar.copyright,
|
||||||
|
Loading…
Reference in New Issue
Block a user