From 3b4daeb9a1166248a9caabe54e21995047dcbe7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20=C4=8C=C3=AD=C5=BEkov=C3=A1?= Date: Wed, 15 Apr 2020 18:49:23 +0200 Subject: [PATCH] =?UTF-8?q?pr=C3=A1ce=20na=20archivu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/archiv/rocnik.html | 3 ++ seminar/views/views_all.py | 56 -------------------- 2 files changed, 3 insertions(+), 56 deletions(-) diff --git a/seminar/templates/seminar/archiv/rocnik.html b/seminar/templates/seminar/archiv/rocnik.html index 2dd99ab4..da5187f5 100644 --- a/seminar/templates/seminar/archiv/rocnik.html +++ b/seminar/templates/seminar/archiv/rocnik.html @@ -23,6 +23,9 @@ {% if c.pdf %} (pdf) {% endif %} + {% if c.titulka_nahled %} + + {% endif %} {% endfor %} diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index e72f23aa..5822fcd4 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -319,33 +319,6 @@ class ArchivView(generic.ListView): # slovník {(ročník, url obrázku)} urls ={} - - # for j, rocnik in enumerate(Rocnik.objects.all()): - # urls_rocnik = {} - # for i,c in enumerate(rocnik.cisla.all()): - # if not c.pdf: - # urls_rocnik[c.poradi] = op.join(settings.MEDIA_URL, "cislo", "png", "default.png") - # else: - # filename = os.path.split(c.pdf.file.name)[1].split(".")[0] - # png_filename = "{}.png".format(filename) - - # # Pokud obrázek neexistuje nebo není aktuální, vytvoř jej - # png_path = op.join(png_dir, png_filename) - # if not op.exists(png_path) or \ - # op.getmtime(png_path) < op.getmtime(c.pdf.path): - - # subprocess.call([ - # "convert", - # "-density", "300x300", - # "-geometry", "{}x{}".format(vyska, sirka), - # "-background", "white", - # "-flatten", - # "{}[0]".format(c.pdf.path), # titulní strana - # png_path - # ]) - - # urls_rocnik[c.poradi] = op.join(settings.MEDIA_URL, "cislo", "png", png_filename) - # urls[rocnik] = urls_rocnik for i,c in enumerate(cisla): if not c.pdf: @@ -375,35 +348,6 @@ class ArchivView(generic.ListView): print(context) - # for i, c in enumerate(cisla): - # if not c.pdf: - # continue - # filename = os.path.split(c.pdf.file.name)[1].split(".")[0] - # png_filename = "{}-{}px.png".format(filename, vyska) - - # # Pokud obrázek neexistuje nebo není aktuální, vytvoř jej - # png_path = op.join(png_dir, png_filename) - # if not op.exists(png_path) or \ - # op.getmtime(png_path) < op.getmtime(c.pdf.path): - - # subprocess.call([ - # "convert", - # "-density", "300x300", - # "-geometry", "{}x{}".format(vyska, sirka), - # "-background", "white", - # "-flatten", - # "-rotate", str(90 * i), - # "{}[0]".format(c.pdf.path), # titulní strana - # png_path - # ]) - - # urls.append( - # (op.join(settings.MEDIA_URL, "cislo", "png", png_filename), c) - # ) - # vyska, sirka = sirka, vyska / 2 - - # tags = [] - # def spirala(urls, tags, idx): # """Rekurzivně prochází urls a generuje strom elementů do tags""" # if idx >= len(urls):