diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 7e7adbfd..09b870f4 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -51,7 +51,10 @@ a:focus, a:hover, a:active { color: #e84e10; text-decoration: none; } -a:focus a:hover + +img { + filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.4)); +} h1 { /*todo: odlišit 1 a 2 */ font-size: 200%; @@ -594,6 +597,14 @@ div.org_pole, div.rocnik_pole { text-align: center; } +div.cislo_pole { + display: inline-block; + width: 15%; + min-width: 165px; + text-align: center; + padding: 10px; +} + div.seznam_orgu h3 { text-align: center; margin-top: 10px; @@ -623,6 +634,11 @@ div.org_email { height: 298px; } +#archiv-rocnik.flip-card { + width: 144px; + height: 205px; +} + /* This container is needed to position the front and back side */ .flip-card-inner { position: relative; @@ -654,16 +670,13 @@ div.org_email { div.flip-card-foto img { width: 100%; height: 100%; - filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.4)); /* FIXME: obecně k obrázkům */ + } /* Style the back side */ .flip-card-back { - /*background-color: #e84e10; - color: #fffbf6; - background-color: #fdedd5;*/ background-color: #f9d59e; - color: black;/**/ + color: black; transform: rotateY(180deg); padding: 10px; padding-top: 20px; @@ -678,26 +691,35 @@ div.popis_rocniku { } -div.popis_rocniku a{ +div.popis_rocniku a, div.cislo_odkazy a { + font-weight: bold; color: black; } -div.popis_rocniku a:hover{ +div.popis_rocniku a:hover, +div.cislo_odkazy a:hover { color: #6f2509; } -/* graf na úvodní stránce */ - -a span.popup { - position: absolute; - visibility: hidden; +div.cislo_odkazy ul { + margin: 0px; + padding: 0px; } -a span.popup:hover { - visibility:visible; - top:37px; left:37px; +/* archiv ročník +div.cisla-v-rocniku { + font-weight: bold; + color: #6f2509; } +div.cislo-v-rocniku-blok { + display: inline-block; + width: 150px; + height: 220px; + text-align: center; +}*/ + + /* galerie */ /* velká fotka */ diff --git a/seminar/templates/seminar/archiv/cisla.html b/seminar/templates/seminar/archiv/cisla.html index 3c4a38b4..f931ee49 100644 --- a/seminar/templates/seminar/archiv/cisla.html +++ b/seminar/templates/seminar/archiv/cisla.html @@ -40,7 +40,7 @@ {% for cislo in rocnik.cisla.all reversed %}
  • {{ cislo.poradi }}. číslo {% if cislo.pdf %}(pdf) {% endif %} {% empty %} - --- + Žádná čísla k zobrazení {% endfor %} Výsledková listina diff --git a/seminar/templates/seminar/archiv/rocnik.html b/seminar/templates/seminar/archiv/rocnik.html index da5187f5..0f48b30c 100644 --- a/seminar/templates/seminar/archiv/rocnik.html +++ b/seminar/templates/seminar/archiv/rocnik.html @@ -17,17 +17,49 @@ {% endif %} - + {% if vysledkovka %} {% if user.is_staff %} diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 5822fcd4..2e833c98 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -308,80 +308,16 @@ class ArchivView(generic.ListView): def get_context_data(self, **kwargs): context = super(ArchivView, self).get_context_data(**kwargs) - vyska = 594 # px - sirka = 420 # px - - # první číslo z každého ročníku - cisla = Cislo.objects.filter(poradi=1) - - # op == os.path, udělá z argumentů cestu - png_dir = op.join(settings.MEDIA_ROOT, "cislo", "png") - - # slovník {(ročník, url obrázku)} + cisla = Cislo.objects.filter(poradi=1) urls ={} - - for i,c in enumerate(cisla): - if not c.pdf: - urls[c.rocnik] = 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[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", png_filename) - context["object_list"] = urls + for i, c in enumerate(cisla): + if c.titulka_nahled: + urls[c.rocnik] = c.titulka_nahled.url + else: + urls[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", "default.png") - print(context) - - # def spirala(urls, tags, idx): - # """Rekurzivně prochází urls a generuje strom elementů do tags""" - # if idx >= len(urls): - # return - - # img_url, cislo = urls[idx] - # tags.append( - # "
    " - # .format( - # 50 if idx % 4 == 2 else 0, - # 50 if idx % 4 == 1 else 0, - # 50 if idx % 2 == 1 else 100, - # 50 if idx > 0 and idx % 2 == 0 else 100 - # ) - # ) - # tags.append("".format( - # cislo.verejne_url(), cislo.kod() - # )) - # tags.append( - # "" - # .format( - # img_url, - # 50 if idx % 4 == 3 else 0, - # 50 if idx % 4 == 2 else 0, - # 50 if idx % 2 == 0 else 100, - # 50 if idx % 2 == 1 else 100 - # ) - # ) - # tags.append("") - # spirala(urls, tags, idx + 1) - # tags.append("
    ") - # spirala(urls, tags, 0) - - # context["nahledy"] = "\n".join(tags) + context["object_list"] = urls return context