diff --git a/handler.py b/handler.py index 64ae435..5704fe5 100644 --- a/handler.py +++ b/handler.py @@ -10,6 +10,7 @@ from config import directory import templates.plain.main as template_public import modules.public.home as public_home +import modules.public.product as public_product app = Bottle() @@ -21,3 +22,12 @@ def index(): } } return public_home.main().html(params) + +@app.route('/product') +def product(): + params = { + "mako":{ + "website" : template_public.main(directory.page["public"], "product") + } + } + return public_product.main().html(params) diff --git a/modules/public/home.py b/modules/public/home.py index cfa61f7..25e386d 100644 --- a/modules/public/home.py +++ b/modules/public/home.py @@ -21,6 +21,6 @@ class main: container = Template(params["mako"]["website"]['container']).render( header = "Welcome to CostaCoffe", sub_header = "Best Place To Buy Coffe", - header_desc = f"Experience the rich flavors and aromas of our premium coffee" + header_desc = "Experience the rich flavors and aromas of our premium coffee" ) ) diff --git a/modules/public/product.py b/modules/public/product.py new file mode 100644 index 0000000..3566b59 --- /dev/null +++ b/modules/public/product.py @@ -0,0 +1,36 @@ +from mako.template import Template +from config import globalvar + +class Coffe: + def __init__(self, image, name, price) -> None: + self.image = image + self.name = name + self.price = price + +class main: + def __init__(self): + pass + + def html(self, params): + return Template(params["mako"]["website"]['index']).render( + title = globalvar.title, + navbar = Template(params["mako"]["website"]['navbar']).render( + title = globalvar.title, + menu = globalvar.menu['public']['navbar'], + user_roles = ["guest"], + active_page = "Our Product" + ), + footer = Template(params["mako"]["website"]['footer']).render( + copyright = globalvar.copyright, + ), + container = Template(params["mako"]["website"]['container']).render( + products = [ + Coffe("coffe1.png", "Classic Coffe", "8.000"), + Coffe("coffe2.png", "Cappucino", "12.000"), + Coffe("coffe3.png", "Mochaccino", "15.000"), + Coffe("coffe4.png", "Latte Machiato", "16.000"), + Coffe("coffe5.png", "Ice Coffe Latte", "14.000"), + Coffe("coffe6.png", "Glass Cafe", "18.000"), + ] + ) + ) diff --git a/pages/public/product.html b/pages/public/product.html new file mode 100644 index 0000000..bbda3df --- /dev/null +++ b/pages/public/product.html @@ -0,0 +1,65 @@ +