authsquare/app/modules/public/home.py

31 lines
1.3 KiB
Python
Raw Normal View History

2024-06-17 17:33:29 +07:00
import mysql.connector as mariadb
from mako.template import Template
from config import globalvar, database
2024-06-17 17:33:29 +07:00
class home:
def __init__(self):
2024-06-17 17:33:29 +07:00
self.db_main = mariadb.connect(**database.db_main)
self.cursor = self.db_main.cursor(dictionary=True)
self.user_roles = [0] # Cari user roles disini
def html(self, params):
2024-06-17 17:33:29 +07:00
active_page = "Home"
return Template(params["mako"]["website"]['index']).render(
title = globalvar.title,
2024-06-17 17:33:29 +07:00
header = globalvar.header,
navbar = Template(params["mako"]["website"]['navbar']).render(
menu = globalvar.menu['public']['navbar'],
2024-06-17 17:33:29 +07:00
user_roles = self.user_roles,
active_page = active_page
),
footer = Template(params["mako"]["website"]['footer']).render(
copyright = globalvar.copyright,
),
container = Template(params["mako"]["website"]['container']).render(
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."
)
)