|
|
@ -11,7 +11,7 @@ from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Orga |
|
|
|
from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva |
|
|
|
from . import utils |
|
|
|
|
|
|
|
from datetime import timedelta, date |
|
|
|
from datetime import timedelta, date, datetime |
|
|
|
from itertools import groupby |
|
|
|
|
|
|
|
|
|
|
@ -44,9 +44,17 @@ class TitulniStranaView(generic.ListView): |
|
|
|
template_name='seminar/titulnistrana.html' |
|
|
|
queryset = Novinky.objects.filter(zverejneno=True).order_by('-datum')[:5] |
|
|
|
|
|
|
|
#def get_context_data(self, **kwargs): |
|
|
|
# context = super(TitulniStranaView, self).get_context_data(**kwargs) |
|
|
|
# return context |
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(TitulniStranaView, self).get_context_data(**kwargs) |
|
|
|
nastaveni = get_object_or_404(Nastaveni) |
|
|
|
cas_deadline = nastaveni.aktualni_cislo.datum_deadline |
|
|
|
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \ |
|
|
|
- datetime.now() |
|
|
|
context['cas_do_konce_dni'] = rozdil_casu.days |
|
|
|
context['cas_do_konce_hodin'] = rozdil_casu.seconds / 3600 |
|
|
|
context['cas_do_konce_minut'] = (rozdil_casu.seconds / 60) % 60 |
|
|
|
context['cas_do_konce_sekund'] = rozdil_casu.seconds % 60 |
|
|
|
return context |
|
|
|
|
|
|
|
class StareNovinkyView(generic.ListView): |
|
|
|
model = Novinky |
|
|
|