forked from moepman/bk-dss
Change navigation handling.
Use a tuple instead of a single string so that the name can differ significantly from the function that is called.
This commit is contained in:
parent
9420e9913d
commit
a01d33d989
10
index.py
10
index.py
@ -53,13 +53,13 @@ def isLoggedin():
|
|||||||
def buildNav():
|
def buildNav():
|
||||||
nav = []
|
nav = []
|
||||||
if isLoggedin():
|
if isLoggedin():
|
||||||
nav.append('edit')
|
nav.append(('Edit own Account', 'edit'))
|
||||||
if isAdmin():
|
if isAdmin():
|
||||||
nav.append('list')
|
nav.append(('List Accounts', 'list_users'))
|
||||||
nav.append('create')
|
nav.append(('Create Account', 'create'))
|
||||||
nav.append('logout')
|
nav.append(('Logout', 'logout'))
|
||||||
else:
|
else:
|
||||||
nav.append('login')
|
nav.append(('Login', 'login'))
|
||||||
return nav
|
return nav
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
</a>
|
</a>
|
||||||
<hr/>
|
<hr/>
|
||||||
<ul class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-stacked">
|
||||||
{% for ni in nav %}
|
{% for ni, func in nav %}
|
||||||
<li{%- if request.path == url_for(ni) %} class="active"{% endif %}>
|
<li{%- if request.path == url_for(func) %} class="active"{% endif %}>
|
||||||
<a href="{{ url_for(ni) }}">{{ ni|capitalize }}</a>
|
<a href="{{ url_for(func) }}">{{ ni }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user