Set a static dir and create main.py
This commit is contained in:
parent
f9634f92aa
commit
d86b582fad
@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="/templates/prime/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="d-flex flex-column">
|
<body class="d-flex flex-column">
|
||||||
${navbar}
|
${navbar}
|
||||||
|
33
costapy-templates/prime/main.py
Normal file
33
costapy-templates/prime/main.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# MIT License
|
||||||
|
#
|
||||||
|
# Copyright (c) 2024 Dita Aji Pratama
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
from core import html
|
||||||
|
|
||||||
|
static = [
|
||||||
|
{
|
||||||
|
"route" : "/templates/prime/css/<filepath:re:.*\.(css|sass|css.map)>",
|
||||||
|
"root" : "./templates/prime/static/css"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route" : "/templates/prime/img/<filepath:re:.*\.(jpg|jpeg|svg|png)>",
|
||||||
|
"root" : "./templates/prime/static/img"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
def main(dir, page):
|
||||||
|
html_template = html.main.get_html("templates/prime/html")
|
||||||
|
html_page = html.main.get_html(dir)
|
||||||
|
return {
|
||||||
|
"index" : html_template [ "index.html" ],
|
||||||
|
"navbar" : html_template [ "navbar.html" ],
|
||||||
|
"sidebar" : html_template [ "sidebar.html" ],
|
||||||
|
"footer" : html_template [ "footer.html" ],
|
||||||
|
"container" : html_page [f"{page}.html" ]
|
||||||
|
}
|
98
costapy-templates/prime/static/css/style.css
Normal file
98
costapy-templates/prime/static/css/style.css
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
z-index: 1030; /* Ensure the navbar is above other elements */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
height: calc(100vh - 56px); /* 56px is the height of the navbar */
|
||||||
|
position: fixed;
|
||||||
|
top: 56px; /* Offset by the navbar height */
|
||||||
|
left: 0;
|
||||||
|
width: 250px;
|
||||||
|
background-color: #343a40;
|
||||||
|
color: white;
|
||||||
|
z-index: 1020; /* Lower than navbar to stay behind it */
|
||||||
|
transition: transform 0.3s ease-in-out;
|
||||||
|
overflow-y: auto; /* Make sidebar scrollable */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.minimized {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin-left: 250px;
|
||||||
|
padding: 20px;
|
||||||
|
transition: margin-left 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content.full-width {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: calc(100% - 250px);
|
||||||
|
margin-left: 250px;
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
transition: margin-left 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer.full-width {
|
||||||
|
width: 100%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-image {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-toggle {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
left: 20px;
|
||||||
|
background-color: #343a40;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
width: 100px;
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1040; /* Above the sidebar and navbar */
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 8px; /* Rounded corners */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-toggle span {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.sidebar {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.show {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
width: 100%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
BIN
costapy-templates/prime/static/img/no-profile-donut.png
Normal file
BIN
costapy-templates/prime/static/img/no-profile-donut.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
Loading…
Reference in New Issue
Block a user