diff --git a/seminar/templates/seminar/AktualZadani.html b/seminar/templates/seminar/AktualZadani.html new file mode 100644 index 00000000..e24aa5b0 --- /dev/null +++ b/seminar/templates/seminar/AktualZadani.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} +{% load staticfiles sekizai_tags %} + +{% block content %} +
+

Aktuální zadání

+ + {% for problem in nastaveni.aktualni_cislo.zadane_problemy.all %} + Problém {{problem}}
+ {% autoescape off %}{{problem.text_problemu}}{% endautoescape %} +
+ {% empty %} + Aktuálně nejsou zadané žádné úlohy k řešení. + {% endfor %} + +
+{% endblock content %} + diff --git a/seminar/urls.py b/seminar/urls.py index b8b7e486..7aca9c7a 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -4,4 +4,5 @@ from . import views urlpatterns = patterns('', url(r'^problem/(?P\d+)/$', views.ProblemView.as_view(), name='problem'), url(r'^cislo/(?P\d+)/$', views.CisloView.as_view(), name='cislo'), + url(r'^zadani/$', 'seminar.views.AktualZadaniView'), ) diff --git a/seminar/views.py b/seminar/views.py index 2bcf34fd..219413a1 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -2,9 +2,15 @@ from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views import generic -from .models import Problem, Cislo, Reseni, VysledkyKCislu +from .models import Problem, Cislo, Reseni, VysledkyKCislu, Nastaveni -# Create your views here. + +def AktualZadaniView(request): + nastaveni = get_object_or_404(Nastaveni) + return render(request, 'seminar/AktualZadani.html', + {'nastaveni' : nastaveni, + }, + ) class ProblemView(generic.DetailView): model = Problem