|
@ -48,6 +48,7 @@ class TitulniStranaView(generic.ListView): |
|
|
context = super(TitulniStranaView, self).get_context_data(**kwargs) |
|
|
context = super(TitulniStranaView, self).get_context_data(**kwargs) |
|
|
nastaveni = get_object_or_404(Nastaveni) |
|
|
nastaveni = get_object_or_404(Nastaveni) |
|
|
cas_deadline = nastaveni.aktualni_cislo.datum_deadline |
|
|
cas_deadline = nastaveni.aktualni_cislo.datum_deadline |
|
|
|
|
|
try: |
|
|
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \ |
|
|
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \ |
|
|
- datetime.now() |
|
|
- datetime.now() |
|
|
context['cas_do_konce_dni'] = rozdil_casu.days |
|
|
context['cas_do_konce_dni'] = rozdil_casu.days |
|
@ -56,6 +57,8 @@ class TitulniStranaView(generic.ListView): |
|
|
context['cas_do_konce_sekund'] = rozdil_casu.seconds % 60 |
|
|
context['cas_do_konce_sekund'] = rozdil_casu.seconds % 60 |
|
|
context['dead'] = datetime.combine(cas_deadline, datetime.max.time()) |
|
|
context['dead'] = datetime.combine(cas_deadline, datetime.max.time()) |
|
|
context['ted'] = datetime.now() |
|
|
context['ted'] = datetime.now() |
|
|
|
|
|
except: |
|
|
|
|
|
context['dead'] = None |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
class StareNovinkyView(generic.ListView): |
|
|
class StareNovinkyView(generic.ListView): |
|
|