From 5571f1be3c6c1b4265886d149c777b11fff88606 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Sun, 23 Aug 2015 15:06:47 +0200 Subject: [PATCH] Rozdeleni organizatoru na aktivni a neaktivni --- .../templates/seminar/cojemam/organizatori.html | 14 ++++++++++++-- seminar/urls.py | 3 ++- seminar/views.py | 12 ++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/seminar/templates/seminar/cojemam/organizatori.html b/seminar/templates/seminar/cojemam/organizatori.html index e827457a..a9b8b774 100644 --- a/seminar/templates/seminar/cojemam/organizatori.html +++ b/seminar/templates/seminar/cojemam/organizatori.html @@ -1,9 +1,15 @@ {% extends "seminar/cojemam/base.html" %} +{% block nadpis1 %} + {% if aktivni %} + Organizátoři + {% else %} + Vysloužilí organizátoři + {% endif %} +{% endblock%} + {% block content %}
-

{% block nadpis1 %}Organizátoři{% endblock%}

- {% for org in object_list %} {% if org.user.is_active %} Aktivní @@ -40,6 +46,10 @@
{% endfor %} + {% if aktivni%} + Vysloužilí organizátoři + {% endif %} +
{% endblock content %} diff --git a/seminar/urls.py b/seminar/urls.py index d6021be5..b392fe2c 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -3,7 +3,8 @@ from . import views, export urlpatterns = patterns('', - url(r'^co-je-MaM/organizatori/$', views.CojemamOrganizatoriView.as_view()), + url(r'^co-je-MaM/organizatori/$', views.CojemamOrganizatoriView.as_view(), name='organizatori'), + url(r'^co-je-MaM/organizatori/organizovali/$', views.CojemamOrganizatoriStariView.as_view(), name='stari_organizatori'), url(r'^archiv/cisla/$', views.CislaView.as_view()), diff --git a/seminar/views.py b/seminar/views.py index 2650ddf3..37499eb4 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -18,9 +18,21 @@ def AktualniZadaniView(request): ### Co je M&M +## Organizatori + class CojemamOrganizatoriView(generic.ListView): model = Organizator template_name='seminar/cojemam/organizatori.html' + queryset = Organizator.objects.filter(user__is_active=True) + def get_context_data(self, **kwargs): + context = super(CojemamOrganizatoriView, self).get_context_data(**kwargs) + context['aktivni'] = True + return context + +class CojemamOrganizatoriStariView(generic.ListView): + model = Organizator + template_name='seminar/cojemam/organizatori.html' + queryset = Organizator.objects.filter(user__is_active=False) ### Archiv