authentication/modules/public/home.py

38 lines
1.5 KiB
Python
Raw Normal View History

2025-03-09 12:50:12 +07:00
from mako.template import Template
from config import globalvar
from scripts import loggorilla
import procedure.validation as procedure_validation
2022-03-16 11:06:52 +07:00
class main:
2024-01-13 12:01:14 +07:00
def __init__(self):
pass
2022-03-16 11:06:52 +07:00
2024-01-13 12:01:14 +07:00
def html(self, params):
2025-03-09 12:50:12 +07:00
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']
2024-06-05 23:27:52 +07:00
return Template(params["mako"]["website"]['index']).render(
2024-01-13 12:01:14 +07:00
title = globalvar.title,
2025-03-09 12:50:12 +07:00
header = globalvar.header,
2024-06-05 23:27:52 +07:00
navbar = Template(params["mako"]["website"]['navbar']).render(
menu = globalvar.menu['public']['navbar'],
2025-03-09 12:50:12 +07:00
user_roles = user['profile']['roles'],
active_page = active_page
2024-01-13 12:01:14 +07:00
),
footer = Template(params["mako"]["website"]['footer']).render(
2024-06-05 23:27:52 +07:00
copyright = globalvar.copyright,
2024-01-13 12:01:14 +07:00
),
container = Template(params["mako"]["website"]['container']).render(
2024-06-05 23:27:52 +07:00
greeting = f"Welcome to your new web application! This placeholder page is here to let you know that your web framework is successfully set up and ready to go. Now, it's time to start building your project. Dive into the documentation to explore the features and capabilities at your disposal."
2024-01-13 12:01:14 +07:00
)
2022-03-16 11:06:52 +07:00
)