diff --git a/seminar/templates/seminar/archiv/cislo.html b/seminar/templates/seminar/archiv/cislo.html index d472826f..b8edce90 100644 --- a/seminar/templates/seminar/archiv/cislo.html +++ b/seminar/templates/seminar/archiv/cislo.html @@ -40,8 +40,7 @@
  • Obálky (PDF)
  • Tituly (TeX)
  • Výsledkovka (TeX)
  • -
  • Obálkování
  • -
  • Odměny
  • +
  • Odměny
  • {% endif %} diff --git a/seminar/templates/seminar/archiv/cislo_obalkovani.html b/seminar/templates/seminar/archiv/cislo_obalkovani.html deleted file mode 100644 index 48b4a324..00000000 --- a/seminar/templates/seminar/archiv/cislo_obalkovani.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -

    - {% block nadpis1a %} - Obálkování {{ cislo }} - {% endblock %} -

    - - Obálkovat se budou tyto problémy: - - - {% for r in reseni %} - {% ifchanged r.resitel %} - {% if not forloop.first %} - - {% endif %} -

    {{ r.resitel }}

    - - -{% endblock content %} diff --git a/seminar/templates/seminar/org/obalkovani.html b/seminar/templates/seminar/org/obalkovani.html deleted file mode 100644 index a4420dba..00000000 --- a/seminar/templates/seminar/org/obalkovani.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -

    - {% block nadpis1a %} - Obálkování {{ cislo }} - {% endblock %} -

    - - {% endif %} -

    {% for resitel in reseni.resitele.all %}{{resitel.osoba}},{% endfor %}

    - - - -{% endblock content %} diff --git a/seminar/urls.py b/seminar/urls.py index c6ab5695..f6f2e2fb 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -23,7 +23,6 @@ Soubor sloužící jako „router“, tj. zde se definují url adresy a na co uk - ``cislo/./obalky.pdf`` (seminar_cislo_obalky) :func:`~seminar.views.views_all.cisloObalkyView` - ``cislo/./tituly.tex`` (seminar_cislo_titul) :func:`~seminar.views.views_all.TitulyView` - ``stav`` (stav_databaze) :func:`~seminar.views.views_all.StavDatabazeView` - - ``cislo/./obalkovani`` (seminar_cislo_resitel_obalkovani) :class:`~seminar.views.views_all.ObalkovaniView` - ``cislo/./odmeny/./`` (seminar_archiv_odmeny) :class:`~seminar.views.views_all.OdmenyView` - Další - `` `` (titulni_strana) :class:`~seminar.views.views_all.TitulniStranaView` @@ -102,11 +101,6 @@ urlpatterns = [ org_required(views.StavDatabazeView), name='stav_databaze' ), - path( - 'cislo/./obalkovani', - org_required(views.ObalkovaniView.as_view()), - name='seminar_cislo_resitel_obalkovani' - ), path( 'cislo/./odmeny/./', org_required(views.OdmenyView.as_view()), diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 7cf79d9f..2c4bd4a6 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -53,23 +53,6 @@ logger = logging.getLogger(__name__) def get_problemy_k_tematu(tema): return Problem.objects.filter(nadproblem = tema) -class ObalkovaniView(generic.ListView): - template_name = 'seminar/org/obalkovani.html' - - def get_queryset(self): - rocnik = get_object_or_404(Rocnik,rocnik=self.kwargs['rocnik']) - cislo = get_object_or_404(Cislo,rocnik=rocnik,poradi=self.kwargs['cislo']) - self.cislo = cislo - self.hodnoceni = s.Hodnoceni.objects.filter(cislo_body=cislo) - self.reseni = Reseni.objects.filter(hodnoceni__in = self.hodnoceni).annotate(Sum('hodnoceni__body')).annotate(Count('hodnoceni')).order_by('resitele__osoba') - return self.reseni - - def get_context_data(self, **kwargs): - context = super(ObalkovaniView, self).get_context_data(**kwargs) - print(self.cislo) - context['cislo'] = self.cislo - return context - # FIXME: Pozor, níž je ještě jeden ProblemView! #class ProblemView(generic.DetailView): @@ -597,28 +580,6 @@ def obalkyView(request, resitele): return response -def oldObalkovaniView(request, rocnik, cislo): - rocnik = Rocnik.objects.get(rocnik=rocnik) - cislo = Cislo.objects.get(rocnik=rocnik, cislo=cislo) - - reseni = ( - Reseni.objects.filter(cislo_body=cislo) - .order_by( - 'resitel__prijmeni', - 'resitel__jmeno', - 'problem__typ', - 'problem__kod' - ) - ) - - problemy = sorted(set(r.problem for r in reseni), key=lambda p: (p.typ, p.kod)) - return render( - request, - 'seminar/archiv/cislo_obalkovani.html', - {'cislo': cislo, 'problemy': problemy, 'reseni': reseni} - ) - - ### Tituly def TitulyViewRocnik(request, rocnik): return TitulyView(request, rocnik, None)