Move the menu into navigation configuration
This commit is contained in:
parent
714f73738b
commit
9f38141492
@ -21,4 +21,91 @@ menu = {
|
||||
}
|
||||
]
|
||||
}
|
||||
"sample": {
|
||||
"navbar": [
|
||||
{
|
||||
"name":"Home",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"notification":0,
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"name":"Customize",
|
||||
"href":"#",
|
||||
"target":"_self",
|
||||
"notification":0,
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"name":"Notification",
|
||||
"href":"#",
|
||||
"target":"_self",
|
||||
"notification":1,
|
||||
"roles":[1,2]
|
||||
}
|
||||
],
|
||||
"profile": {
|
||||
"picture": "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||
"name" : "User Name",
|
||||
"menu" : [
|
||||
{
|
||||
"name" :"Profile",
|
||||
"href" :"/profile",
|
||||
"target":"_self",
|
||||
"roles" :[1,2]
|
||||
},
|
||||
{
|
||||
"name" :"Settings",
|
||||
"href" :"/settings",
|
||||
"target":"_self",
|
||||
"roles" :[1,2]
|
||||
},
|
||||
{
|
||||
"name" :"Logout",
|
||||
"href" :"/logout",
|
||||
"target":"_self",
|
||||
"roles" :[1,2,3]
|
||||
}
|
||||
]
|
||||
},
|
||||
"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":"#",
|
||||
"roles":[1,2]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
from mako.template import Template
|
||||
from config import globalvar, placeholder
|
||||
from config import navigation, placeholder
|
||||
|
||||
class main:
|
||||
|
||||
@ -16,106 +16,19 @@ class main:
|
||||
copyright = "Copyright (C) 2022 Dita Aji Pratama"
|
||||
greeting = "A prime dashboard based on bootstrap 5"
|
||||
|
||||
menu_navbar = [
|
||||
{
|
||||
"name":"Home",
|
||||
"target":"_self",
|
||||
"href":"#",
|
||||
"notification":0,
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"name":"Customize",
|
||||
"href":"#",
|
||||
"target":"_self",
|
||||
"notification":0,
|
||||
"roles":[1,2]
|
||||
},
|
||||
{
|
||||
"name":"Notification",
|
||||
"href":"#",
|
||||
"target":"_self",
|
||||
"notification":1,
|
||||
"roles":[1,2]
|
||||
}
|
||||
]
|
||||
|
||||
menu_profile = {
|
||||
"picture": "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||
"name" : "Dita Aji Pratama",
|
||||
"menu" : [
|
||||
{
|
||||
"name" :"Profile",
|
||||
"href" :"/profile",
|
||||
"target":"_self",
|
||||
"roles" :[1,2]
|
||||
},
|
||||
{
|
||||
"name" :"Settings",
|
||||
"href" :"/settings",
|
||||
"target":"_self",
|
||||
"roles" :[1,2]
|
||||
},
|
||||
{
|
||||
"name" :"Logout",
|
||||
"href" :"/logout",
|
||||
"target":"_self",
|
||||
"roles" :[1,2,3]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
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":"#",
|
||||
"roles":[1,2]
|
||||
}
|
||||
]
|
||||
|
||||
return Template(params["mako"]["website"]['index']).render(
|
||||
favicon = placeholder.image["favicon"],
|
||||
title = title,
|
||||
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||
title = title,
|
||||
home = home,
|
||||
menu = menu_navbar,
|
||||
profile = menu_profile,
|
||||
menu = navigation["sample"]["navbar"],
|
||||
profile = navigation["sample"]["profile"],
|
||||
user_roles = user_roles,
|
||||
active_page = active_page
|
||||
),
|
||||
sidebar = Template(params["mako"]["website"]['sidebar']).render(
|
||||
menu = menu_sidebar,
|
||||
menu = navigation["sample"]["sidebar"],
|
||||
user_roles = user_roles,
|
||||
active_page = active_page
|
||||
),
|
||||
@ -126,3 +39,4 @@ class main:
|
||||
greeting = greeting
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user