home.html is rendering

- Converted Icon and SidenavItem into macros
- Setting a mock user on g.current_user
This commit is contained in:
richard-dds
2018-08-01 11:40:07 -04:00
parent 29c68151de
commit 0976aed778
4 changed files with 56 additions and 16 deletions

View File

@@ -1,24 +1,25 @@
{% from "components.html" import SidenavItem %}
<div class="global-navigation sidenav global-navigation__context--{{context}}">
<ul>
{% if dev() %}
{% module SidenavItem("Styleguide",
{% if g.dev %}
{{ SidenavItem("Styleguide",
href="/styleguide",
icon="visible",
active=matchesPath('/styleguide'),
active=g.matchesPath('/styleguide'),
subnav=[
{"label":"Subnav 1", "href":"/styleguide?subnav1", "icon": "plus", "active": matchesPath('/styleguide?subnav1')},
{"label":"Subnav 2", "href":"/styleguide?subnav2", "active": matchesPath('/styleguide?subnav2')},
]) %}
{% end %}
{"label":"Subnav 1", "href":"/styleguide?subnav1", "icon": "plus", "active": g.matchesPath('/styleguide?subnav1')},
{"label":"Subnav 2", "href":"/styleguide?subnav2", "active": g.matchesPath('/styleguide?subnav2')},
]) }}
{% endif %}
{% module SidenavItem("Requests",
{{ SidenavItem("Requests",
href="/requests",
icon="document",
active=matchesPath('/requests'),
active=g.matchesPath('/requests'),
subnav=[
{"label":"New Request", "href":"/requests/new", "icon": "plus", "active": matchesPath('/requests/new')},
{"label":"New Request", "href":"/requests/new", "icon": "plus", "active": g.matchesPath('/requests/new')},
]
) %}
{% module SidenavItem("Workspaces", href="/workspaces", icon="cloud", active=matchesPath('/workspaces')) %}
) }}
{{ SidenavItem("Workspaces", href="/workspaces", icon="cloud", active=g.matchesPath('/workspaces')) }}
</ul>
</div>