Update the guide on the sample
This commit is contained in:
parent
7ad3f98471
commit
3189bad447
@ -7,31 +7,29 @@
|
|||||||
<li>
|
<li>
|
||||||
<p>Add to handler</p>
|
<p>Add to handler</p>
|
||||||
<code>
|
<code>
|
||||||
import templates.prime.main as template_dashboard
|
<pre>import templates.prime.main as template_dashboard
|
||||||
|
|
||||||
params["mako"] = {
|
params["mako"] = {
|
||||||
"website" : template_dashboard.main("pages/dashboard", "users")
|
"website" : template_dashboard.main("pages/dashboard", "users")
|
||||||
}
|
}</pre>
|
||||||
</code>
|
</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
- Define a necessary variable on your modules
|
<p>Define a necessary variable on your modules</p>
|
||||||
|
<code>
|
||||||
```python
|
<pre>title = "CostaPy"
|
||||||
title = "CostaPy"
|
|
||||||
|
|
||||||
user_roles = [1,2] # A roles that user have
|
user_roles = [1,2] # A roles that user have
|
||||||
active_page = "Users" # Current active page name
|
active_page = "Users" # Current active page name
|
||||||
|
|
||||||
copyright = "Copyright (C) 2022 Dita Aji Pratama"
|
copyright = "Copyright (C) 2022 Dita Aji Pratama"
|
||||||
greeting = "Hello world"
|
greeting = "Hello world"</pre>
|
||||||
```
|
</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
- Define a navbar menu on your modules
|
<p>Define a navbar menu on your modules</p>
|
||||||
|
<code>
|
||||||
```python
|
<pre>menu_navbar = [
|
||||||
menu_navbar = [
|
|
||||||
{
|
{
|
||||||
"name":"Home",
|
"name":"Home",
|
||||||
"target":"_self",
|
"target":"_self",
|
||||||
@ -53,14 +51,13 @@ params["mako"] = {
|
|||||||
"notification":1,
|
"notification":1,
|
||||||
"roles":[1,2]
|
"roles":[1,2]
|
||||||
}
|
}
|
||||||
]
|
]</pre>
|
||||||
```
|
</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
- Define a profile menu on your modules
|
<p>Define a profile menu on your modules</p>
|
||||||
|
<code>
|
||||||
```python
|
<pre>menu_profile = {
|
||||||
menu_profile = {
|
|
||||||
"picture" : "https://ditaajipratama.net/img/no-profile-donut.png",
|
"picture" : "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||||
"name" : "Dita Aji Pratama",
|
"name" : "Dita Aji Pratama",
|
||||||
"menu" : [
|
"menu" : [
|
||||||
@ -83,14 +80,13 @@ params["mako"] = {
|
|||||||
"roles":[1,2,3]
|
"roles":[1,2,3]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}</pre>
|
||||||
```
|
</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
- Define a sidebar menu on your modules
|
<p>Define a sidebar menu on your modules</p>
|
||||||
|
<code>
|
||||||
```python
|
<pre>menu_sidebar = [
|
||||||
menu_sidebar = [
|
|
||||||
{
|
{
|
||||||
"icon":"fa-solid fa-gauge",
|
"icon":"fa-solid fa-gauge",
|
||||||
"name":"Dashboard",
|
"name":"Dashboard",
|
||||||
@ -126,15 +122,13 @@ params["mako"] = {
|
|||||||
"href":"#",
|
"href":"#",
|
||||||
"roles":[1,2]
|
"roles":[1,2]
|
||||||
}
|
}
|
||||||
]
|
]</pre>
|
||||||
```
|
</code>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
- Set a template on your modules
|
<p>Set a template on your modules</p>
|
||||||
|
<code>
|
||||||
```python
|
<pre>return Template(params["mako"]["website"]['index']).render(
|
||||||
return Template(params["mako"]["website"]['index']).render(
|
|
||||||
title = title,
|
title = title,
|
||||||
navbar = Template(params["mako"]["website"]['navbar']).render(
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
title = title,
|
title = title,
|
||||||
@ -154,8 +148,8 @@ params["mako"] = {
|
|||||||
container = Template(params["mako"]["website"]['container']).render(
|
container = Template(params["mako"]["website"]['container']).render(
|
||||||
greeting = greeting
|
greeting = greeting
|
||||||
)
|
)
|
||||||
)
|
)</pre>
|
||||||
```
|
</code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>License</h2>
|
<h2>License</h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user