diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2013-10-16 01:47:23 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2013-10-16 01:47:23 +0200 |
commit | 66b6c57c075de0e45bfdb0d574120c409512d36f (patch) | |
tree | 9af69edba89a67e2de215911f26a018620806a19 /templates | |
parent | 3d2ba33917b5b72a5eaf57a3843ee9c8033d15c9 (diff) | |
download | kosten-66b6c57c075de0e45bfdb0d574120c409512d36f.tar.gz kosten-66b6c57c075de0e45bfdb0d574120c409512d36f.tar.bz2 kosten-66b6c57c075de0e45bfdb0d574120c409512d36f.zip |
Do not print 'logout' menu when not logged in
Diffstat (limited to 'templates')
-rw-r--r-- | templates/layout.jinja | 4 | ||||
-rw-r--r-- | templates/menu.jinja | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/templates/layout.jinja b/templates/layout.jinja index b3f821d..89ffca4 100644 --- a/templates/layout.jinja +++ b/templates/layout.jinja @@ -22,9 +22,9 @@ <div id="header"> <div id="menu"> {% block menu %} - {% import "menu.jinja" as m %} + {% from "menu.jinja" import menu with context %} <ul> - {% for uri, page in m.menu %} + {% for uri, page in menu %} <li class="menu-item"><a href="{{ url_for(uri) }}">{{page}}</a></li> {% endfor %} </ul> diff --git a/templates/menu.jinja b/templates/menu.jinja index 79b20af..aa2bdd4 100644 --- a/templates/menu.jinja +++ b/templates/menu.jinja @@ -2,7 +2,9 @@ ("index", "Kosten"), ("expenses.add", "Neu"), ("consts.list", "Konstante Kosten"), - ("categories.manage", "Kategorien"), - ("login.logout", "Logout") + ("categories.manage", "Kategorien") ] %} +{% if current_user.is_authenticated() %} + {% set menu = menu + [("login.logout", "Logout")] %} +{% endif %} |