|
|
@ -8,7 +8,7 @@ from django.views import generic |
|
|
|
from django.utils.translation import ugettext as _ |
|
|
|
from django.http import Http404 |
|
|
|
|
|
|
|
from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Organizator, Resitel, Novinky |
|
|
|
from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Organizator, Resitel, Novinky, Soustredeni_Ucastnici |
|
|
|
from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva |
|
|
|
from . import utils |
|
|
|
|
|
|
@ -369,14 +369,15 @@ def obalkyView(request,resitele): |
|
|
|
|
|
|
|
tempdir = tempfile.mkdtemp() |
|
|
|
with open(tempdir+"/obalky.tex","w") as texfile: |
|
|
|
# Pokud TeX chce ISO Latin, tak se da encode nastavit |
|
|
|
texfile.write(tex.decode("utf-8").encode("utf-8")) |
|
|
|
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.eps'),tempdir) |
|
|
|
subprocess.call(["csplain","obalky.tex"],cwd = tempdir) |
|
|
|
subprocess.call(["dvipdf","obalky.dvi"],cwd = tempdir) |
|
|
|
|
|
|
|
|
|
|
|
with open(tempdir+"/obalky.pdf","rb") as pdffile: |
|
|
|
response = HttpResponse(pdffile.read(),content_type='application/pdf') |
|
|
|
shutil.rmtree(tempdir) |
|
|
|
return response |
|
|
|
|
|
|
|
|
|
|
@ -390,6 +391,11 @@ class SoustredeniView(generic.DetailView): |
|
|
|
model = Soustredeni |
|
|
|
template_name = 'seminar/archiv/soustredeni.html' |
|
|
|
|
|
|
|
def soustredeniObalkyView(request,soustredeni): |
|
|
|
soustredeni = Soustredeni.objects.filter(id = soustredeni)[0] |
|
|
|
return obalkyView(request,soustredeni.ucastnici.all()) |
|
|
|
|
|
|
|
|
|
|
|
### Články |
|
|
|
|
|
|
|
class ClankyResitelView(generic.ListView): |
|
|
|