import mysql.connector as mariadb from mako.template import Template from config import globalvar, database class home: def __init__(self): 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): active_page = "Home" return Template(params["mako"]["website"]['index']).render( title = globalvar.title, header = globalvar.header, navbar = Template(params["mako"]["website"]['navbar']).render( menu = globalvar.menu['public']['navbar'], 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." ) )