Compare commits
15 Commits
2a4b42172d
...
08b93a9e6c
Author | SHA1 | Date | |
---|---|---|---|
08b93a9e6c | |||
6618710f43 | |||
e54da717df | |||
80f2a47586 | |||
f6cdd3d9bb | |||
721e811dc2 | |||
7f339cce3e | |||
1e3f18c72c | |||
2bb770c937 | |||
ce6e139e54 | |||
dd08dbfabd | |||
ab203e01ce | |||
ffc0cc13e7 | |||
ab5e997241 | |||
b1ff446c7f |
@ -10,7 +10,7 @@ A prime dashboard based on bootstrap 5
|
||||
import templates.prime.main as template_dashboard
|
||||
|
||||
params["mako"] = {
|
||||
"website" : template_dashboard.main(directory.page["dashboard"], "users")
|
||||
"website" : template_dashboard.main("pages/dashboard", "users")
|
||||
}
|
||||
```
|
||||
|
||||
@ -88,30 +88,35 @@ A prime dashboard based on bootstrap 5
|
||||
```python
|
||||
menu_sidebar = [
|
||||
{
|
||||
"icon":"fa-solid fa-gauge",
|
||||
"name":"Dashboard",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"icon":"fa-solid fa-users",
|
||||
"name":"Users",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"icon":"fa-solid fa-book",
|
||||
"name":"Items",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"icon":"fa-solid fa-book",
|
||||
"name":"Analytic",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"icon":"fa-solid fa-book",
|
||||
"name":"Reports",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
|
@ -1,3 +1,3 @@
|
||||
<footer class="footer" id="footer">
|
||||
<footer class="footer fixed-bottom" id="footer">
|
||||
<p>${copyright}</p>
|
||||
</footer>
|
||||
|
@ -6,6 +6,8 @@
|
||||
<title>${title}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/templates/prime/css/style.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<link href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap5.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="d-flex flex-column">
|
||||
${navbar}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">${title}</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
@ -1,12 +1,12 @@
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar p-3" id="sidebar">
|
||||
<div class="sidebar" id="sidebar">
|
||||
<!-- <h5>Sidebar</h5> -->
|
||||
<ul class="nav flex-column pb-5">
|
||||
<ul class="navbar-nav flex-column">
|
||||
% for item in menu:
|
||||
% if any(role in item['roles'] for role in user_roles):
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white ${'active' if item['name'] == active_page else ''}" href="${item['href']}" target="${item['target']}">
|
||||
${item['name']}
|
||||
<i class="${item['icon']} me-3"></i> ${item['name']}
|
||||
</a>
|
||||
</li>
|
||||
% endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
body {
|
||||
min-height: 100vh;
|
||||
padding-top: 56px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
@ -19,13 +20,46 @@ body {
|
||||
overflow-y: auto; /* Make sidebar scrollable */
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar-track {
|
||||
background: #bbb;
|
||||
border-radius: 3px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar-thumb {
|
||||
background: #ddd;
|
||||
border-radius: 3px;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav {
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item .active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item :hover {
|
||||
background-color: rgba(0, 0, 0, 0.2); /* Darkens on hover */
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item .nav-link {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.sidebar.minimized {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 250px;
|
||||
padding: 20px;
|
||||
padding-bottom: 20px;
|
||||
transition: margin-left 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
@ -34,24 +68,21 @@ body {
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: calc(100% - 250px);
|
||||
margin-left: 250px;
|
||||
background-color: #f8f9fa;
|
||||
padding: 10px;
|
||||
padding-top: 5px;
|
||||
text-align: center;
|
||||
margin-left: 250px;
|
||||
transition: margin-left 0.3s ease-in-out;
|
||||
z-index: 1010;
|
||||
}
|
||||
|
||||
.footer.full-width {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.profile-image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
@ -62,7 +93,7 @@ body {
|
||||
left: 20px;
|
||||
background-color: #343a40;
|
||||
color: white;
|
||||
border: none;
|
||||
border: 1px solid #fff;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
|
@ -7,12 +7,14 @@
|
||||
<title>Prime</title>
|
||||
<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="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<link href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap5.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="d-flex flex-column">
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Prime Dashboard</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@ -47,23 +49,33 @@
|
||||
</nav>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar p-3" id="sidebar">
|
||||
<div class="sidebar" id="sidebar">
|
||||
<!-- <h5>Sidebar</h5> -->
|
||||
<ul class="nav flex-column pb-5">
|
||||
<ul class="navbar-nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">Dashboard</a>
|
||||
<a class="nav-link text-white" href="#">
|
||||
<i class="fa-solid fa-gauge me-3"></i> Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">Users</a>
|
||||
<a class="nav-link text-white" href="#">
|
||||
<i class="fa-solid fa-users me-3"></i> Users
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">Items</a>
|
||||
<a class="nav-link text-white" href="#">
|
||||
<i class="fa-solid fa-book me-3"></i> Items
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">Analytics</a>
|
||||
<a class="nav-link text-white" href="#">
|
||||
<i class="fa-solid fa-book me-3"></i> Analytics
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">Reports</a>
|
||||
<a class="nav-link text-white" href="#">
|
||||
<i class="fa-solid fa-book me-3"></i> Reports
|
||||
</a>
|
||||
</li>
|
||||
<!-- Add more items to test scrolling -->
|
||||
</ul>
|
||||
@ -77,7 +89,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer" id="footer">
|
||||
<footer class="footer fixed-bottom" id="footer">
|
||||
<p>© 2024 Dita Aji Pratama. All rights reserved.</p>
|
||||
</footer>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
body {
|
||||
min-height: 100vh;
|
||||
padding-top: 56px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
@ -19,13 +20,46 @@ body {
|
||||
overflow-y: auto; /* Make sidebar scrollable */
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar-track {
|
||||
background: #bbb;
|
||||
border-radius: 3px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar-thumb {
|
||||
background: #ddd;
|
||||
border-radius: 3px;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav {
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item .active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item :hover {
|
||||
background-color: rgba(0, 0, 0, 0.2); /* Darkens on hover */
|
||||
}
|
||||
|
||||
.sidebar .navbar-nav .nav-item .nav-link {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.sidebar.minimized {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 250px;
|
||||
padding: 20px;
|
||||
padding-bottom: 20px;
|
||||
transition: margin-left 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
@ -34,24 +68,21 @@ body {
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: calc(100% - 250px);
|
||||
margin-left: 250px;
|
||||
background-color: #f8f9fa;
|
||||
padding: 10px;
|
||||
padding-top: 5px;
|
||||
text-align: center;
|
||||
margin-left: 250px;
|
||||
transition: margin-left 0.3s ease-in-out;
|
||||
z-index: 1010;
|
||||
}
|
||||
|
||||
.footer.full-width {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.profile-image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
@ -62,7 +93,7 @@ body {
|
||||
left: 20px;
|
||||
background-color: #343a40;
|
||||
color: white;
|
||||
border: none;
|
||||
border: 1px solid #fff;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
|
Loading…
Reference in New Issue
Block a user