Publicly show 'for members' menu-item

parent 867f9dfc
......@@ -188,6 +188,7 @@ def iban_export(request):
return response
@login_required
def statistics(request):
member_types = ("member", "supporter", "honorary")
......
......@@ -11,14 +11,14 @@ main = [
{'title': _('Become a Member'), 'name': 'registrations:index'},
{'title': _('Thabloid'), 'name': 'thabloid:index'},
]},
{'title': _('For Members'), 'name': 'for-members', 'authenticated': True,
{'title': _('For Members'), 'name': 'for-members',
'submenu': [
{'title': _('Member list'), 'name': 'members:index'},
{'title': _('Photos'), 'name': 'photos:index'},
{'title': _('Statistics'), 'name': 'statistics'},
{'title': _('Styleguide'), 'name': 'styleguide'},
{'title': _('Become Active'), 'name': 'become-active'},
{'title': _('Wiki'), 'url': '/wiki/'},
{'title': _('Wiki'), 'url': '/wiki/', 'authenticated': True},
]},
{'title': _('Calendar'), 'name': 'events:index',
'submenu': [
......
<ul>
{% for item in submenu %}
{% if not item.authenticated or request.user.is_authenticated %}
{% url item.name as path %}
<li {% if request.path == path %}class="nav-selected nav-path-selected"{% endif %}>
<a href="{% if path %}{{ path }}{% else %}{{ item.url }}{% endif %}"
......@@ -11,5 +12,6 @@
{% include 'menu/submenu.html' with submenu=item.submenu %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
......@@ -33,6 +33,7 @@ from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login
from django.contrib.sitemaps.views import sitemap
from django.views.generic import TemplateView
......@@ -85,7 +86,7 @@ urlpatterns = [
url(r'^for-members$', TemplateView.as_view(
template_name='singlepages/for_members.html'), name='for-members'),
url(r'^', include([ # 'for members' menu
url(r'^become-active/', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'),
url(r'^become-active/', login_required(TemplateView.as_view(template_name='singlepages/become_active.html')), name='become-active'),
url(r'^photos/', include('photos.urls')),
url(r'^statistics/$', members.views.statistics, name='statistics'),
url(r'^styleguide/$', views.styleguide, name='styleguide'),
......
Markdown is supported
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