Browse Source

humanize odpocet

remotes/origin/noc deploy-prod-2015-09-13-17-36-xlfd
Bc. Petr Pecha 9 years ago
parent
commit
f1484662ec
  1. 1
      mamweb/settings_common.py
  2. 9
      seminar/templates/seminar/titulnistrana.html
  3. 2
      seminar/views.py

1
mamweb/settings_common.py

@ -106,6 +106,7 @@ INSTALLED_APPS = (
'django_comments',
'django.contrib.flatpages',
'django.contrib.humanize',
# MaMweb
'mamweb',

9
seminar/templates/seminar/titulnistrana.html

@ -1,5 +1,7 @@
{% extends 'base.html' %}
{% load humanize %}
{% block content %}
@ -12,7 +14,10 @@
<div class="odpocet">
Do konce odeslání řešení zbývá:
{# TODO humanize #}
{{ted|timesince:dead}}
<!--
{{cas_do_konce_dni}} dní
{% if cas_do_konce_dni < 5 %}
{{cas_do_konce_hodin}} hodin
@ -23,6 +28,8 @@
{% endif %}
{% endif %}
{% endif %}
-->
</div>
<p> <center>

2
seminar/views.py

@ -54,6 +54,8 @@ class TitulniStranaView(generic.ListView):
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
context['dead'] = datetime.combine(cas_deadline, datetime.max.time())
context['ted'] = datetime.now()
return context
class StareNovinkyView(generic.ListView):

Loading…
Cancel
Save