mirror of
https://github.com/moepman/bk-dss
synced 2024-12-22 06:54:26 +01:00
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():
|
||||
nav = []
|
||||
if isLoggedin():
|
||||
nav.append('edit')
|
||||
nav.append(('Edit own Account', 'edit'))
|
||||
if isAdmin():
|
||||
nav.append('list')
|
||||
nav.append('create')
|
||||
nav.append('logout')
|
||||
nav.append(('List Accounts', 'list_users'))
|
||||
nav.append(('Create Account', 'create'))
|
||||
nav.append(('Logout', 'logout'))
|
||||
else:
|
||||
nav.append('login')
|
||||
nav.append(('Login', 'login'))
|
||||
return nav
|
||||
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
</a>
|
||||
<hr/>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
{% for ni in nav %}
|
||||
<li{%- if request.path == url_for(ni) %} class="active"{% endif %}>
|
||||
<a href="{{ url_for(ni) }}">{{ ni|capitalize }}</a>
|
||||
{% for ni, func in nav %}
|
||||
<li{%- if request.path == url_for(func) %} class="active"{% endif %}>
|
||||
<a href="{{ url_for(func) }}">{{ ni }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user