Browse Source

Rozdeleni organizatoru na aktivni a neaktivni

remotes/origin/vysl deploy-prod-2015-09-01-20-42-xlfd
Bc. Petr Pecha 9 years ago
parent
commit
5571f1be3c
  1. 14
      seminar/templates/seminar/cojemam/organizatori.html
  2. 3
      seminar/urls.py
  3. 12
      seminar/views.py

14
seminar/templates/seminar/cojemam/organizatori.html

@ -1,9 +1,15 @@
{% extends "seminar/cojemam/base.html" %} {% extends "seminar/cojemam/base.html" %}
{% block nadpis1 %}
{% if aktivni %}
Organizátoři
{% else %}
Vysloužilí organizátoři
{% endif %}
{% endblock%}
{% block content %} {% block content %}
<div> <div>
<h2>{% block nadpis1 %}Organizátoři{% endblock%}</h2>
{% for org in object_list %} {% for org in object_list %}
{% if org.user.is_active %} {% if org.user.is_active %}
<b>Aktivní</b> <b>Aktivní</b>
@ -40,6 +46,10 @@
<hr> <hr>
{% endfor %} {% endfor %}
{% if aktivni%}
<a href="organizovali/">Vysloužilí organizátoři</a>
{% endif %}
</div> </div>
{% endblock content %} {% endblock content %}

3
seminar/urls.py

@ -3,7 +3,8 @@ from . import views, export
urlpatterns = patterns('', 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()), url(r'^archiv/cisla/$', views.CislaView.as_view()),

12
seminar/views.py

@ -18,9 +18,21 @@ def AktualniZadaniView(request):
### Co je M&M ### Co je M&M
## Organizatori
class CojemamOrganizatoriView(generic.ListView): class CojemamOrganizatoriView(generic.ListView):
model = Organizator model = Organizator
template_name='seminar/cojemam/organizatori.html' 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 ### Archiv

Loading…
Cancel
Save