Verified Commit 003bfd5c authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Publicly show 'for members' menu-item

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