Commit f3e363eb authored by WKuipers's avatar WKuipers
Browse files

Fix #41 by adding an authenticated attribute to menus.py

In the future perhaps a permission based solution would be
better/fancier but this is enough for feature equivalence.
parent 0422f974
......@@ -13,7 +13,8 @@ main = [
{'title': _('Become a Member'), 'name': 'become-a-member'},
{'title': _('Thabloid'), 'name': '#'},
]},
{'title': _('For Members'), 'name': '#', 'submenu': [
{'title': _('For Members'), 'name': '#', 'authenticated': 'yes',
'submenu': [
{'title': _('Photos'), 'name': 'photos:index'},
{'title': _('Statistics'), 'name': '#'},
{'title': _('Become Active'), 'name': 'become-active'},
......
......@@ -6,6 +6,7 @@
<!-- menu -->
<ul class="nav">
{% for item in menu %}
{% if not item.authenticated or request.user.is_authenticated %}
{% url item.name as path %}
<li {% if request.path == path %}class="nav-path-selected"{% endif %}>
<a href="{{ path }}" target="_self" {% if request.path == path %}class="nav-path-selected"{% endif %}>
......@@ -15,6 +16,7 @@
{% include 'menu/submenu.html' with submenu=item.submenu %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
<!-- /menu -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment