Hezčí verze
This commit is contained in:
parent
2e9ff73eac
commit
8d22ab3c91
2 changed files with 15 additions and 14 deletions
|
@ -2,15 +2,7 @@
|
|||
{% load staticfiles %}
|
||||
|
||||
{% block submenu %}
|
||||
{% if aktualni %}
|
||||
{% with "aktualni" as selected %}
|
||||
{% include "korektury/submenu.html" %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{% with "zastarale" as selected %}
|
||||
{% include "korektury/submenu.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% include "korektury/submenu.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block script%}
|
||||
|
|
|
@ -22,17 +22,26 @@ class KorekturyListView(generic.ListView):
|
|||
template_name = 'korektury/seznam.html'
|
||||
|
||||
class KorekturyAktualniListView(KorekturyListView):
|
||||
def __init__ (self):
|
||||
self.queryset=self.get_queryset().exclude(status="zastarale")
|
||||
def get_queryset(self, *args, **kwargs):
|
||||
queryset=super(KorekturyAktualniListView,self).get_queryset()
|
||||
queryset=queryset.exclude(status="zastarale")
|
||||
return queryset
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(KorekturyAktualniListView,self).get_context_data(**kwargs)
|
||||
context['aktualni'] = True
|
||||
context['selected'] = 'aktualni'
|
||||
return context
|
||||
|
||||
class KorekturyZastaraleListView(KorekturyListView):
|
||||
def __init__ (self):
|
||||
self.queryset=self.get_queryset().filter(status="zastarale")
|
||||
def get_queryset(self, *args, **kwargs):
|
||||
queryset=super(KorekturyZastaraleListView,self).get_queryset()
|
||||
queryset=queryset.filter(status="zastarale")
|
||||
return queryset
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(KorekturyZastaraleListView,self).get_context_data(**kwargs)
|
||||
context['selected'] = 'zastarale'
|
||||
return context
|
||||
|
||||
### Korektury
|
||||
class KorekturyView(generic.TemplateView):
|
||||
|
|
Loading…
Reference in a new issue