CostaCoffe/modules/public/product.py
2024-11-17 16:59:10 +07:00

37 lines
1.4 KiB
Python

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"),
]
)
)