|
@ -72,16 +72,16 @@ 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: |
|
|
# Pokud neni zverejnene cislo nezverejnuj odpocet |
|
|
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \ |
|
|
if nastaveni.aktualni_cislo.verejne(): |
|
|
- datetime.now() |
|
|
# pokus se zjistit termin odeslani a pokud neni zadany, |
|
|
context['cas_do_konce_dni'] = rozdil_casu.days |
|
|
# nezverejnuj odpocet |
|
|
context['cas_do_konce_hodin'] = rozdil_casu.seconds / 3600 |
|
|
try: |
|
|
context['cas_do_konce_minut'] = (rozdil_casu.seconds / 60) % 60 |
|
|
context['dead'] = datetime.combine(cas_deadline, datetime.max.time()) |
|
|
context['cas_do_konce_sekund'] = rozdil_casu.seconds % 60 |
|
|
context['ted'] = datetime.now() |
|
|
context['dead'] = datetime.combine(cas_deadline, datetime.max.time()) |
|
|
except: |
|
|
context['ted'] = datetime.now() |
|
|
context['dead'] = None |
|
|
except: |
|
|
else: |
|
|
context['dead'] = None |
|
|
context['dead'] = None |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|