|
@ -48,13 +48,12 @@ 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 |
|
|
cas_do_konce = datetime.combine(cas_deadline, datetime.min.time()) \ |
|
|
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \ |
|
|
- datetime.now() |
|
|
- datetime.now() |
|
|
context['cas_do_konce'] = \ |
|
|
context['cas_do_konce_dni'] = rozdil_casu.days |
|
|
str(cas_do_konce.days) + " dní " + \ |
|
|
context['cas_do_konce_hodin'] = rozdil_casu.seconds / 3600 |
|
|
str(cas_do_konce.seconds / 3600) + " hodin " + \ |
|
|
context['cas_do_konce_minut'] = (rozdil_casu.seconds / 60) % 60 |
|
|
str((cas_do_konce.seconds / 60) % 60)+" min " + \ |
|
|
context['cas_do_konce_sekund'] = rozdil_casu.seconds % 60 |
|
|
str(cas_do_konce.seconds % 60) + " sekund" |
|
|
|
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
class StareNovinkyView(generic.ListView): |
|
|
class StareNovinkyView(generic.ListView): |
|
|