Compare commits
	
		
			1 Commits
		
	
	
		
			master
			...
			template/k
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3367abd5fb | 
@ -1,3 +1,28 @@
 | 
				
			|||||||
title	= "CostaPy"
 | 
					title	= "CostaPy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					menu	= {
 | 
				
			||||||
 | 
					    "public": {
 | 
				
			||||||
 | 
					        "navbar": [
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "name":"Home",
 | 
				
			||||||
 | 
					                "target":"_self",
 | 
				
			||||||
 | 
					                "href":"/",
 | 
				
			||||||
 | 
					                "roles":["guest"]
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "name":"About",
 | 
				
			||||||
 | 
					                "target":"_self",
 | 
				
			||||||
 | 
					                "href":"/about",
 | 
				
			||||||
 | 
					                "roles":["guest"]
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "name":"Docs",
 | 
				
			||||||
 | 
					                "target":"_blank",
 | 
				
			||||||
 | 
					                "href":"https://costapy.ditaajipratama.net",
 | 
				
			||||||
 | 
					                "roles":["guest"]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
copyright	= "Copyright (C) 2022  Dita Aji Pratama"
 | 
					copyright	= "Copyright (C) 2022  Dita Aji Pratama"
 | 
				
			||||||
 | 
				
			|||||||
@ -1,24 +0,0 @@
 | 
				
			|||||||
menu	= {
 | 
					 | 
				
			||||||
    "public": {
 | 
					 | 
				
			||||||
        "navbar": [
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name":"Home",
 | 
					 | 
				
			||||||
                "target":"_self",
 | 
					 | 
				
			||||||
                "href":"/",
 | 
					 | 
				
			||||||
                "roles":["guest"]
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name":"About",
 | 
					 | 
				
			||||||
                "target":"_self",
 | 
					 | 
				
			||||||
                "href":"/about",
 | 
					 | 
				
			||||||
                "roles":["guest"]
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name":"Docs",
 | 
					 | 
				
			||||||
                "target":"_blank",
 | 
					 | 
				
			||||||
                "href":"https://costapy.ditaajipratama.net",
 | 
					 | 
				
			||||||
                "roles":["guest"]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,3 +0,0 @@
 | 
				
			|||||||
image = {
 | 
					 | 
				
			||||||
    "profile":"https://ditaajipratama.net/img/no-profile-donut.png"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -2,16 +2,16 @@ from bottle import response
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
host        = "localhost"
 | 
					host        = "localhost"
 | 
				
			||||||
port        = 11000
 | 
					port        = 11000
 | 
				
			||||||
reloader    = True
 | 
					reloader    = False
 | 
				
			||||||
debug       = False
 | 
					debug       = False
 | 
				
			||||||
server      = 'wsgiref' # try 'gunicorn'
 | 
					server      = 'gunicorn' # default = 'wsgiref'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
session_opts = {
 | 
					session_opts = {
 | 
				
			||||||
    'session.type': 'file',
 | 
					    'session.type': 'file',
 | 
				
			||||||
    'session.cookie_expires': 5*60, # Session expiration in seconds: minutes*seconds
 | 
					    'session.cookie_expires': 5*60, # Session expiration in seconds: minutes*seconds
 | 
				
			||||||
    'session.data_dir': './.beaker/data',
 | 
					    'session.data_dir': './.beaker/data',
 | 
				
			||||||
    'session.auto': True
 | 
					    'session.auto': True
 | 
				
			||||||
} # beaker's session options
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def enable_cors():
 | 
					def enable_cors():
 | 
				
			||||||
    response.headers['Access-Control-Allow-Origin' ] = '*'
 | 
					    response.headers['Access-Control-Allow-Origin' ] = '*'
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
from    mako.template      import Template
 | 
					from    mako.template      import Template
 | 
				
			||||||
from    config             import globalvar, navigation
 | 
					from    config             import globalvar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class main:
 | 
					class main:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -11,7 +11,7 @@ class main:
 | 
				
			|||||||
            title	= globalvar.title,
 | 
					            title	= globalvar.title,
 | 
				
			||||||
            header	= "Welcome to CostaPy",
 | 
					            header	= "Welcome to CostaPy",
 | 
				
			||||||
            navbar	= Template(params["mako"]["website"]['navbar']).render(
 | 
					            navbar	= Template(params["mako"]["website"]['navbar']).render(
 | 
				
			||||||
                menu		= navigation.menu['public']['navbar'],
 | 
					                menu		= globalvar.menu['public']['navbar'],
 | 
				
			||||||
                user_roles	= ["guest"],
 | 
					                user_roles	= ["guest"],
 | 
				
			||||||
                active_page	= "Home"
 | 
					                active_page	= "Home"
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										7
									
								
								templates/kiddy/html/footer.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								templates/kiddy/html/footer.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					<!-- Footer -->
 | 
				
			||||||
 | 
					<footer class="footer mt-auto">
 | 
				
			||||||
 | 
					  <div class="container">
 | 
				
			||||||
 | 
					    <p>${copyright}</p>
 | 
				
			||||||
 | 
					    <p><a href="${privacy_policy}">Privacy Policy</a> | <a href="${terms_of_service}">Terms of Service</a></p>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</footer>
 | 
				
			||||||
							
								
								
									
										22
									
								
								templates/kiddy/html/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								templates/kiddy/html/index.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					<!DOCTYPE html>
 | 
				
			||||||
 | 
					<html lang="en">
 | 
				
			||||||
 | 
					<head>
 | 
				
			||||||
 | 
					  <meta charset="UTF-8">
 | 
				
			||||||
 | 
					  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
				
			||||||
 | 
					  <title>${title}</title>
 | 
				
			||||||
 | 
					  <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
 | 
				
			||||||
 | 
					  <link href="/templates/kiddy/css/style.css" rel="stylesheet">
 | 
				
			||||||
 | 
					</head>
 | 
				
			||||||
 | 
					<body class="d-flex flex-column" style="min-height:100vh;">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ${navbar}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ${container}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ${footer}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
 | 
				
			||||||
 | 
					  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
 | 
				
			||||||
 | 
					  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
 | 
				
			||||||
 | 
					</body>
 | 
				
			||||||
 | 
					</html>
 | 
				
			||||||
							
								
								
									
										22
									
								
								templates/kiddy/html/navbar.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								templates/kiddy/html/navbar.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					<!-- Navbar -->
 | 
				
			||||||
 | 
					<nav class="navbar navbar-expand-lg navbar-light bg-light">
 | 
				
			||||||
 | 
					  <div class="container">
 | 
				
			||||||
 | 
					    <a class="navbar-brand" href="#">${title}</a>
 | 
				
			||||||
 | 
					    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
 | 
				
			||||||
 | 
					      <span class="navbar-toggler-icon"></span>
 | 
				
			||||||
 | 
					    </button>
 | 
				
			||||||
 | 
					    <div class="collapse navbar-collapse" id="navbarNav">
 | 
				
			||||||
 | 
					      <ul class="navbar-nav ml-auto">
 | 
				
			||||||
 | 
					        % for item in menu:
 | 
				
			||||||
 | 
					        % if any(role in item['roles'] for role in user_roles):
 | 
				
			||||||
 | 
					        <li class="nav-item ${'active' if item['name'] == active_page else ''}">
 | 
				
			||||||
 | 
					          <a class="nav-link" href="${item['href']}" target="${item['target']}">
 | 
				
			||||||
 | 
					            ${item['name']}
 | 
				
			||||||
 | 
					          </a>
 | 
				
			||||||
 | 
					        </li>
 | 
				
			||||||
 | 
					        % endif
 | 
				
			||||||
 | 
					        % endfor
 | 
				
			||||||
 | 
					      </ul>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</nav>
 | 
				
			||||||
							
								
								
									
										18
									
								
								templates/kiddy/main.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								templates/kiddy/main.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					from core import html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static = [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        "route"	: "/templates/kiddy/css/<filepath:re:.*\.(css|sass|css.map)>",
 | 
				
			||||||
 | 
					        "root"	: "./templates/kiddy/static/css"
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def main(dir, page):
 | 
				
			||||||
 | 
					    html_template	= html.main.get_html("templates/kiddy/html")
 | 
				
			||||||
 | 
					    html_page		= html.main.get_html(dir)
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        "index"		: html_template	[ "index.html"	],
 | 
				
			||||||
 | 
					        "navbar"	: html_template	[ "navbar.html"	],
 | 
				
			||||||
 | 
					        "footer"	: html_template	[ "footer.html"	],
 | 
				
			||||||
 | 
					        "container"	: html_page	[f"{page}.html"	]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
							
								
								
									
										179
									
								
								templates/kiddy/static/css/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										179
									
								
								templates/kiddy/static/css/style.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,179 @@
 | 
				
			|||||||
 | 
					body {
 | 
				
			||||||
 | 
					  font-family: 'Arial', sans-serif;
 | 
				
			||||||
 | 
					  background-color: #f8f9fa;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.navbar {
 | 
				
			||||||
 | 
					  margin-bottom: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.header {
 | 
				
			||||||
 | 
					  background: url('https://img.freepik.com/free-photo/little-cute-boy-proud-when-he-finish-drawing-with-happiness-raised-two-hands-his-head-smile_1150-15403.jpg') no-repeat center center;
 | 
				
			||||||
 | 
					  background-size: cover;
 | 
				
			||||||
 | 
					  color: white;
 | 
				
			||||||
 | 
					  padding: 100px 0;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					  position: relative;
 | 
				
			||||||
 | 
					  min-height: 400px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.header-overlay {
 | 
				
			||||||
 | 
					  position: absolute;
 | 
				
			||||||
 | 
					  top: 0;
 | 
				
			||||||
 | 
					  left: 0;
 | 
				
			||||||
 | 
					  width: 100%;
 | 
				
			||||||
 | 
					  height: 100%;
 | 
				
			||||||
 | 
					  background-color: rgba(0, 123, 255, 0.6);
 | 
				
			||||||
 | 
					  z-index: 1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.header-content {
 | 
				
			||||||
 | 
					  position: relative;
 | 
				
			||||||
 | 
					  z-index: 2;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.header h1 {
 | 
				
			||||||
 | 
					  margin: 0;
 | 
				
			||||||
 | 
					  font-size: 3em;
 | 
				
			||||||
 | 
					  font-family: 'Comic Sans MS', cursive, sans-serif;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.header p {
 | 
				
			||||||
 | 
					  font-size: 1.5em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.packages {
 | 
				
			||||||
 | 
					  padding: 50px 0;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.packages h2 {
 | 
				
			||||||
 | 
					  font-size: 2.5em;
 | 
				
			||||||
 | 
					  margin-bottom: 50px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.package {
 | 
				
			||||||
 | 
					  border-radius: 15px;
 | 
				
			||||||
 | 
					  padding: 20px;
 | 
				
			||||||
 | 
					  margin: 20px 0;
 | 
				
			||||||
 | 
					  background-color: white;
 | 
				
			||||||
 | 
					  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
 | 
				
			||||||
 | 
					  transition: transform 0.2s;
 | 
				
			||||||
 | 
					  color: white;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.package:hover {
 | 
				
			||||||
 | 
					  transform: scale(1.05);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.package:nth-child(1) { background-color: #FF6F61; }
 | 
				
			||||||
 | 
					.package:nth-child(2) { background-color: #6B5B95; }
 | 
				
			||||||
 | 
					.package:nth-child(3) { background-color: #FFA07A; }
 | 
				
			||||||
 | 
					.package:nth-child(4) { background-color: #88B04B; }
 | 
				
			||||||
 | 
					.package .btn {
 | 
				
			||||||
 | 
					  background-color: white;
 | 
				
			||||||
 | 
					  color: black;
 | 
				
			||||||
 | 
					  border: none;
 | 
				
			||||||
 | 
					  margin-top: 10px;
 | 
				
			||||||
 | 
					  padding: 10px 20px;
 | 
				
			||||||
 | 
					  border-radius: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.package .btn:hover {
 | 
				
			||||||
 | 
					  background-color: #f0f0f0;
 | 
				
			||||||
 | 
					  color: black;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.package img {
 | 
				
			||||||
 | 
					  width: 80px;
 | 
				
			||||||
 | 
					  margin-bottom: 10px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.about-us {
 | 
				
			||||||
 | 
					  padding: 50px 0;
 | 
				
			||||||
 | 
					  background-color: #FFC857;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.about-us h2 {
 | 
				
			||||||
 | 
					  font-size: 2.5em;
 | 
				
			||||||
 | 
					  margin-bottom: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.about-us p {
 | 
				
			||||||
 | 
					  font-size: 1.2em;
 | 
				
			||||||
 | 
					  max-width: 800px;
 | 
				
			||||||
 | 
					  margin: 0 auto;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-plan {
 | 
				
			||||||
 | 
					  padding: 50px 0;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-plan h2 {
 | 
				
			||||||
 | 
					  font-size: 2.5em;
 | 
				
			||||||
 | 
					  margin-bottom: 50px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card {
 | 
				
			||||||
 | 
					  border-radius: 15px;
 | 
				
			||||||
 | 
					  padding: 30px;
 | 
				
			||||||
 | 
					  margin: 20px;
 | 
				
			||||||
 | 
					  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
 | 
				
			||||||
 | 
					  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
 | 
				
			||||||
 | 
					  transition: transform 0.2s;
 | 
				
			||||||
 | 
					  color: white;
 | 
				
			||||||
 | 
					  position: relative;
 | 
				
			||||||
 | 
					  overflow: hidden;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card:hover {
 | 
				
			||||||
 | 
					  transform: scale(1.05);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card::before {
 | 
				
			||||||
 | 
					  content: '';
 | 
				
			||||||
 | 
					  position: absolute;
 | 
				
			||||||
 | 
					  top: 0;
 | 
				
			||||||
 | 
					  left: 0;
 | 
				
			||||||
 | 
					  width: 100%;
 | 
				
			||||||
 | 
					  height: 100%;
 | 
				
			||||||
 | 
					  background: rgba(0, 0, 0, 0.1);
 | 
				
			||||||
 | 
					  z-index: 1;
 | 
				
			||||||
 | 
					  pointer-events: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card h3 {
 | 
				
			||||||
 | 
					  font-size: 2em;
 | 
				
			||||||
 | 
					  margin-bottom: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card p {
 | 
				
			||||||
 | 
					  font-size: 1.2em;
 | 
				
			||||||
 | 
					  margin-bottom: 10px;
 | 
				
			||||||
 | 
					  z-index: 2;
 | 
				
			||||||
 | 
					  position: relative;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card .btn {
 | 
				
			||||||
 | 
					  margin-top: 20px;
 | 
				
			||||||
 | 
					  padding: 10px 20px;
 | 
				
			||||||
 | 
					  border-radius: 50px;
 | 
				
			||||||
 | 
					  z-index: 2;
 | 
				
			||||||
 | 
					  position: relative;
 | 
				
			||||||
 | 
					  background-color: rgba(255, 255, 255, 0.9);
 | 
				
			||||||
 | 
					  color: #333;
 | 
				
			||||||
 | 
					  border: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.price-card .btn:hover {
 | 
				
			||||||
 | 
					  background-color: rgba(255, 255, 255, 1);
 | 
				
			||||||
 | 
					  color: #333;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.get-started {
 | 
				
			||||||
 | 
					  padding: 50px 0;
 | 
				
			||||||
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  justify-content: space-between;
 | 
				
			||||||
 | 
					  align-items: center;
 | 
				
			||||||
 | 
					  background-color: #f8f9fa;
 | 
				
			||||||
 | 
					  text-align: left;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.get-started .content {
 | 
				
			||||||
 | 
					  flex: 1;
 | 
				
			||||||
 | 
					  font-size: 1.2em;
 | 
				
			||||||
 | 
					  margin-right: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.get-started .btn {
 | 
				
			||||||
 | 
					  font-size: 1.2em;
 | 
				
			||||||
 | 
					  padding: 15px 30px;
 | 
				
			||||||
 | 
					  border-radius: 50px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.footer {
 | 
				
			||||||
 | 
					  background-color: #343a40;
 | 
				
			||||||
 | 
					  color: white;
 | 
				
			||||||
 | 
					  padding: 20px 0;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.footer a {
 | 
				
			||||||
 | 
					  color: #ffc107;
 | 
				
			||||||
 | 
					  text-decoration: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.footer a:hover {
 | 
				
			||||||
 | 
					  text-decoration: underline;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user