Compare commits

...

5 Commits

5 changed files with 27 additions and 6 deletions

View File

@ -1,3 +1 @@
title = "CostaPy" title = "CostaPy"
copyright = "Copyright (C) 2022 Dita Aji Pratama"

View File

@ -1,12 +1,17 @@
import mysql.connector as mariadb
from config import database, globalvar, navigation
from mako.template import Template from mako.template import Template
from config import globalvar, navigation
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."

13
scripts/loggorilla.py Normal file
View File

@ -0,0 +1,13 @@
import datetime
def prcss(loc, msg):
print(f"[loggorilla][{datetime.datetime.now()}][\033[32mprcss\033[39m][\033[95m{loc}\033[39m] {msg}", flush=True)
def accss(loc, msg):
print(f"[loggorilla][{datetime.datetime.now()}][\033[36maccss\033[39m][\033[95m{loc}\033[39m] {msg}", flush=True)
def fyinf(loc, msg):
print(f"[loggorilla][{datetime.datetime.now()}][\033[93mfyinf\033[39m][\033[95m{loc}\033[39m] {msg}", flush=True)
def error(loc, msg):
print(f"[loggorilla][{datetime.datetime.now()}][\033[31merror\033[39m][\033[95m{loc}\033[39m] {msg}", flush=True)

View File

@ -53,3 +53,8 @@ create table if not exists `metaprofile_brand_logo` (
on delete cascade on delete cascade
) engine=InnoDB default charset=utf8mb4; ) engine=InnoDB default charset=utf8mb4;
-- Default Data
INSERT INTO metaprofile VALUES (1, 'img/favicon.png', 'Copyright (C) 2022 Dita Aji Pratama');
INSERT INTO metaprofile_baseurl VALUES (1, 1, 'local', 'http://localhost:11000');

BIN
static/img/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB