Browse Source

Merge branch 'Petr'

remotes/origin/noc deploy-prod-2015-09-13-18-23-xlfd
Bc. Petr Pecha 9 years ago
parent
commit
b313183ffb
  1. 3
      seminar/templates/seminar/titulnistrana.html
  2. 3
      seminar/views.py

3
seminar/templates/seminar/titulnistrana.html

@ -13,9 +13,9 @@
{% endblock %}{% endblock %}
</h2>
{% if dead %}
<div class="odpocet">
Do konce odeslání řešení zbývá:
{{ted|timesince:dead}}
<!--
@ -32,6 +32,7 @@
-->
</div>
{% endif %}
<p> <center>
My jsme M&M, mezioborový korespondenční seminář.

3
seminar/views.py

@ -48,6 +48,7 @@ class TitulniStranaView(generic.ListView):
context = super(TitulniStranaView, self).get_context_data(**kwargs)
nastaveni = get_object_or_404(Nastaveni)
cas_deadline = nastaveni.aktualni_cislo.datum_deadline
try:
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \
- datetime.now()
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['dead'] = datetime.combine(cas_deadline, datetime.max.time())
context['ted'] = datetime.now()
except:
context['dead'] = None
return context
class StareNovinkyView(generic.ListView):

Loading…
Cancel
Save