Browse Source

Merge branch 'master' of atrey.karlin.mff.cuni.cz:/akce/MaM/MaMweb/mamweb

remotes/origin/noc
Honza "Stínovlas" Musílek 9 years ago
parent
commit
ac9dc92656
  1. 1
      mamweb/settings_common.py
  2. 6
      seminar/templates/seminar/clanky/organizatorske_clanky.html
  3. 8
      seminar/templates/seminar/clanky/resitelske_clanky.html
  4. 23
      seminar/templates/seminar/titulnistrana.html
  5. 18
      seminar/views.py

1
mamweb/settings_common.py

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

6
seminar/templates/seminar/clanky/organizatorske_clanky.html

@ -1,5 +1,11 @@
{% extends 'seminar/clanky/resitelske_clanky.html' %}
{% block submenu %}
{% with "org" as selected %}
{% include "seminar/clanky/submenu.html" %}
{% endwith %}
{% endblock submenu %}
{% block nadpis1a %}{% block nadpis1b %}
Organizátorské články
{% endblock %}{% endblock %}

8
seminar/templates/seminar/clanky/resitelske_clanky.html

@ -1,5 +1,13 @@
{% extends 'base.html' %}
{% block menu_clanky %}selected{% endblock %}
{% block submenu %}
{% with "resitel" as selected %}
{% include "seminar/clanky/submenu.html" %}
{% endwith %}
{% endblock submenu %}
{% block content %}
<h2>

23
seminar/templates/seminar/titulnistrana.html

@ -1,5 +1,7 @@
{% extends 'base.html' %}
{% load humanize %}
{% block content %}
<br />
@ -10,6 +12,27 @@
Tož vitajte!
{% endblock %}{% endblock %}
</h2>
<div class="odpocet">
Do konce odeslání řešení zbývá:
{{ted|timesince:dead}}
<!--
{{cas_do_konce_dni}} dní
{% if cas_do_konce_dni < 5 %}
{{cas_do_konce_hodin}} hodin
{% if cas_do_konce_hodin < 5 %}
{{cas_do_konce_minut}} minut
{% if cas_do_konce_minut < 5 %}
{{cas_do_konce_sekund}}
{% endif %}
{% endif %}
{% endif %}
-->
</div>
<p> <center>
My jsme M&M, mezioborový korespondenční seminář.
<li> Mezioborový: matematika, fyzika, informatika.

18
seminar/views.py

@ -11,7 +11,7 @@ from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Orga
from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva
from . import utils
from datetime import timedelta, date
from datetime import timedelta, date, datetime
from itertools import groupby
@ -44,9 +44,19 @@ class TitulniStranaView(generic.ListView):
template_name='seminar/titulnistrana.html'
queryset = Novinky.objects.filter(zverejneno=True).order_by('-datum')[:5]
#def get_context_data(self, **kwargs):
# context = super(TitulniStranaView, self).get_context_data(**kwargs)
# return context
def get_context_data(self, **kwargs):
context = super(TitulniStranaView, self).get_context_data(**kwargs)
nastaveni = get_object_or_404(Nastaveni)
cas_deadline = nastaveni.aktualni_cislo.datum_deadline
rozdil_casu = datetime.combine(cas_deadline, datetime.max.time()) \
- datetime.now()
context['cas_do_konce_dni'] = rozdil_casu.days
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):
model = Novinky

Loading…
Cancel
Save