Update handler.py, home.py, home.html, and 1 more file
This commit is contained in:
parent
c5c6b97b21
commit
69f9941755
26
app/handler.py
Normal file
26
app/handler.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# CostaPy
|
||||||
|
# Copyright (C) 2022 Dita Aji Pratama
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
# You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
from bottle import Bottle, route, request
|
||||||
|
|
||||||
|
from config import directory
|
||||||
|
|
||||||
|
import templates.plain.main as template_public
|
||||||
|
|
||||||
|
import modules.public.home as public_home
|
||||||
|
|
||||||
|
app = Bottle()
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def index():
|
||||||
|
|
||||||
|
params = {
|
||||||
|
"mako":{
|
||||||
|
"website" : template_public.main(directory.page["public"], "home")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return public_home.main().html(params)
|
24
app/modules/public/home.py
Normal file
24
app/modules/public/home.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from mako.template import Template
|
||||||
|
from config import globalvar
|
||||||
|
|
||||||
|
class main:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def html(self, params):
|
||||||
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
header = "Welcome to CostaPy",
|
||||||
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
|
menu = globalvar.menu['public']['navbar'],
|
||||||
|
user_roles = ["guest"],
|
||||||
|
active_page = "Home"
|
||||||
|
),
|
||||||
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
|
copyright = globalvar.copyright,
|
||||||
|
),
|
||||||
|
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."
|
||||||
|
)
|
||||||
|
)
|
1
app/pages/public/home.html
Normal file
1
app/pages/public/home.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<p>${greeting}</p>
|
1
app/static/css/style.css
Normal file
1
app/static/css/style.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* your style here */
|
Loading…
Reference in New Issue
Block a user