create a sample page
This commit is contained in:
parent
cb2675cf92
commit
d93e1aa544
@ -1,7 +1,8 @@
|
|||||||
from core import template
|
from core import template
|
||||||
|
|
||||||
page = {
|
page = {
|
||||||
'public' :'pages/public'
|
'public' :'pages/public',
|
||||||
|
'sample' :'pages/sample'
|
||||||
}
|
}
|
||||||
|
|
||||||
static = [
|
static = [
|
||||||
|
11
handler.py
11
handler.py
@ -9,7 +9,9 @@ from bottle import Bottle, route
|
|||||||
from config import directory
|
from config import directory
|
||||||
|
|
||||||
import templates.plain.main as template_public
|
import templates.plain.main as template_public
|
||||||
|
import templates.SBModernBiz.main as template_sample
|
||||||
import modules.public.home as public_home
|
import modules.public.home as public_home
|
||||||
|
import modules.sample.sbmb as sample_sbmb
|
||||||
|
|
||||||
app = Bottle()
|
app = Bottle()
|
||||||
|
|
||||||
@ -21,3 +23,12 @@ def index():
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return public_home.main().html(params)
|
return public_home.main().html(params)
|
||||||
|
|
||||||
|
@app.route('/sample/sbmb')
|
||||||
|
def index():
|
||||||
|
params = {
|
||||||
|
"mako":{
|
||||||
|
"website" : template_sample.main(directory.page["sample"], "sbmb")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sample_sbmb.main().html(params)
|
||||||
|
37
modules/sample/sbmb.py
Normal file
37
modules/sample/sbmb.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
from mako.template import Template
|
||||||
|
from config import globalvar
|
||||||
|
|
||||||
|
class main:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def html(self, params):
|
||||||
|
title = "CostaPy"
|
||||||
|
|
||||||
|
user_roles = ["guest"] # A roles that user have
|
||||||
|
active_page = "Sample" # Current active page name
|
||||||
|
|
||||||
|
copyright = "Copyright (C) 2022 Dita Aji Pratama"
|
||||||
|
greeting = "A prime dashboard based on bootstrap 5"
|
||||||
|
|
||||||
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
|
title = title,
|
||||||
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
|
title = title,
|
||||||
|
home = "/",
|
||||||
|
menu = globalvar.menu['public']['navbar'],
|
||||||
|
user_roles = user_roles,
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
components = {
|
||||||
|
"before" : [],
|
||||||
|
"after" : []
|
||||||
|
},
|
||||||
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
|
copyright = copyright,
|
||||||
|
),
|
||||||
|
container = Template(params["mako"]["website"]['container']).render(
|
||||||
|
greeting = greeting
|
||||||
|
)
|
||||||
|
)
|
0
pages/sample/sbmb.html
Normal file
0
pages/sample/sbmb.html
Normal file
Loading…
Reference in New Issue
Block a user