Rozdeleni organizatoru na aktivni a neaktivni
This commit is contained in:
parent
a25c249ad3
commit
5571f1be3c
3 changed files with 26 additions and 3 deletions
|
@ -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 %}
|
||||
<div>
|
||||
<h2>{% block nadpis1 %}Organizátoři{% endblock%}</h2>
|
||||
|
||||
{% for org in object_list %}
|
||||
{% if org.user.is_active %}
|
||||
<b>Aktivní</b>
|
||||
|
@ -40,6 +46,10 @@
|
|||
<hr>
|
||||
{% endfor %}
|
||||
|
||||
{% if aktivni%}
|
||||
<a href="organizovali/">Vysloužilí organizátoři</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
|
|
|
@ -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()),
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue