Implementing metaprofile
This commit is contained in:
parent
25db50e6bc
commit
db036aff77
@ -1,12 +1,17 @@
|
|||||||
from mako.template import Template
|
import mysql.connector as mariadb
|
||||||
from config import globalvar, navigation
|
|
||||||
|
from config import database, globalvar, navigation
|
||||||
|
from mako.template import Template
|
||||||
|
|
||||||
class main:
|
class main:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
self.db_main = mariadb.connect(**database.db_main)
|
||||||
|
self.cursor = self.db_main.cursor(dictionary=True)
|
||||||
|
|
||||||
def html(self, params):
|
def html(self, params):
|
||||||
|
self.cursor.execute("SELECT `favicon`, `copyright` FROM `metaprofile` WHERE id = 1 ;")
|
||||||
|
metaprofile = self.cursor.fetchone()
|
||||||
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 = "Welcome to CostaPy",
|
||||||
@ -16,7 +21,7 @@ class main:
|
|||||||
active_page = "Home"
|
active_page = "Home"
|
||||||
),
|
),
|
||||||
footer = Template(params["mako"]["website"]['footer']).render(
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
copyright = globalvar.copyright,
|
copyright = metaprofile["copyright"],
|
||||||
),
|
),
|
||||||
container = Template(params["mako"]["website"]['container']).render(
|
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."
|
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."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user