From f53764827d8cd07e5de280067668a59886dd8c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Wed, 26 Oct 2016 22:43:32 +0200 Subject: [PATCH] =?UTF-8?q?Ro=C4=8Dn=C3=ADk:=20v=C3=BDsledkovka=20ro=C4=8D?= =?UTF-8?q?n=C3=ADku=20v=20LaTeXu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/archiv/rocnik.html | 6 ++++++ .../templates/seminar/archiv/rocnik_vysledkovka.tex | 13 +++++++++++++ seminar/urls.py | 7 ++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 seminar/templates/seminar/archiv/rocnik_vysledkovka.tex diff --git a/seminar/templates/seminar/archiv/rocnik.html b/seminar/templates/seminar/archiv/rocnik.html index 53a13762..e5289277 100644 --- a/seminar/templates/seminar/archiv/rocnik.html +++ b/seminar/templates/seminar/archiv/rocnik.html @@ -29,6 +29,12 @@ {% endif %} {% if vysledkovka %} + {% if user.is_staff %} +
+ Výsledkovka ročníku (LaTeX) +
+ {% endif %} +

Výsledková listina

{% include "seminar/vysledkovka_rocnik.html" %} {% endif %} diff --git a/seminar/templates/seminar/archiv/rocnik_vysledkovka.tex b/seminar/templates/seminar/archiv/rocnik_vysledkovka.tex new file mode 100644 index 00000000..75d8eb79 --- /dev/null +++ b/seminar/templates/seminar/archiv/rocnik_vysledkovka.tex @@ -0,0 +1,13 @@ +{% with lb="{" %} +{% with rb="}" %} +\setlength{\tabcolsep}{3pt} +\begin{longtable}{|r|l|c|r|{% for cislo in vysledkovka.cisla %}c{% if not forloop.last %}@{\hskip.5em}{% endif %}{% endfor %}|r|} +\hline +& & & & \multicolumn{{ lb }}{{ vysledkovka.cisla|length }}}{c|}{\textbf{Číslo}} & \\\textbf{Poř.} & \textbf{Jméno} & \textbf{R.} & \raisebox{0.7mm}{$\sum_{-1}$} & {% for cislo in vysledkovka.cisla %}\textbf{{ lb }}{{ cislo.cislo }}{{ rb }} & {% endfor %}\raisebox{0.7mm}{$\sum_1$} \\\hline +\endhead +\hline +\endfoot +{% for rv in vysledkovka.radky %}{{ rv.poradi }} & {% if rv.titul %}\titul{{ lb }}{{ rv.titul }}}~{% endif %}{{ rv.resitel.jmeno|slice:":1" }}.~{{ rv.resitel.prijmeni }} & {% if rv.resitel.rocnik %}{{ rv.resitel.rocnik }}.{% endif %} & {{ rv.body_odjakziva }} {% for b in rv.body_cisla %} & {{ b }}{% endfor %} & {{ rv.body_rocnik }} \\ +{% endfor %}\end{longtable} +{% endwith %} +{% endwith %} diff --git a/seminar/urls.py b/seminar/urls.py index f7228b47..686a7a5c 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -49,7 +49,12 @@ urlpatterns = [ url(r'^aesop-export/mam-sous-(?P[\d-]+)\.csv$', export.ExportSousView.as_view(), name='seminar_export_sous'), url(r'^aesop-export/index.csv$', export.ExportIndexView.as_view(), name='seminar_export_index'), - #### Stranky viditelne pouze pro orgy: + # Stranky viditelne pouze pro orgy: + url( + r'^rocnik/(?P\d+)/vysledkovka.tex$', + staff_member_required(views.RocnikVysledkovkaView.as_view()), + name='seminar_cislo_vysledkovka' + ), url(r'^cislo/(?P\d+).(?P[0-9-]+)/vysledkovka.tex$', staff_member_required(views.CisloVysledkovkaView.as_view()), name='seminar_cislo_vysledkovka'), url(r'^cislo/(?P\d+).(?P[0-9-]+)/obalky.pdf$',