diff --git a/galerie/static/galerie/prvky/dalsi.png b/galerie/static/galerie/prvky/dalsi.png deleted file mode 100644 index b5c68dcc..00000000 Binary files a/galerie/static/galerie/prvky/dalsi.png and /dev/null differ diff --git a/galerie/static/galerie/prvky/dalsi.svg b/galerie/static/galerie/prvky/dalsi.svg new file mode 100644 index 00000000..e928adb2 --- /dev/null +++ b/galerie/static/galerie/prvky/dalsi.svg @@ -0,0 +1,65 @@ + + diff --git a/galerie/static/galerie/prvky/nahoru.png b/galerie/static/galerie/prvky/nahoru.png deleted file mode 100644 index d297af60..00000000 Binary files a/galerie/static/galerie/prvky/nahoru.png and /dev/null differ diff --git a/galerie/static/galerie/prvky/predchozi.png b/galerie/static/galerie/prvky/predchozi.png deleted file mode 100644 index dc657411..00000000 Binary files a/galerie/static/galerie/prvky/predchozi.png and /dev/null differ diff --git a/galerie/static/galerie/prvky/predchozi.svg b/galerie/static/galerie/prvky/predchozi.svg new file mode 100644 index 00000000..b7a491ed --- /dev/null +++ b/galerie/static/galerie/prvky/predchozi.svg @@ -0,0 +1,65 @@ + + diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 2a719264..dc942cc2 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -712,19 +712,6 @@ div.cislo_odkazy ul { padding: 0px; } -/* 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 */ @@ -745,7 +732,8 @@ div.cislo-v-rocniku-blok { top: 0; } .predchozi_obrazek:hover{ - background-image: url("/static/galerie/prvky/predchozi.png"); + background-image: url("/static/galerie/prvky/predchozi.svg"); + filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4)); background-position: left center; background-repeat: no-repeat; } @@ -758,7 +746,8 @@ div.cislo-v-rocniku-blok { top: 0; } .dalsi_obrazek:hover{ - background-image: url("/static/galerie/prvky/dalsi.png"); + background-image: url("/static/galerie/prvky/dalsi.svg"); + filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4)); background-position: right center; background-repeat: no-repeat; } @@ -788,31 +777,25 @@ div.cislo-v-rocniku-blok { /* titulní obrázek hlavní galerie soustředění */ .titulni_obrazek { - border: 1px solid black; } .galerie_nahledy{ /*margin: 1em 0;*/ - margin: 0 auto 30px auto; + margin: auto; + padding: 10px; text-align: center; overflow: auto; } +.galerie_nahledy img { + margin: 10px; +} + .galerie_nahledy div.navigace { display: inline-block; - width: 150px; } -/*.galerie_nahledy img{*/ -/*margin: 0 10px 0 10px;*/ -/*}*/ - -/*.galerie_nahledy a{*/ -/*height: 100%;*/ -/*width: 100%;*/ -/*}*/ - -.galerie_nahled { /* frame */ +.galerie_nahled, .podgalerie_nahled { /* frame */ display: block; position: relative; float: left; @@ -820,19 +803,19 @@ div.cislo-v-rocniku-blok { height: 200px; text-align: center; border: solid; - border-width: 2px; - border-radius: 5px; - /*border-color: #ffa500;*/ - border-color: #ffd546; - /*background-color: #ffb52d;*/ - background-color: white; + border-width: 1px; + border-radius: 4px; + border-color: #f9d59e; + background-color: #fffbf6; white-space: nowrap; - margin: 10px 20px 10px 0px; + margin: 10px; + font-weight: bold; } -.galerie_nahled:hover { - background-color: #ffd546; - border-color: #ffa500; +.galerie_nahled:hover, .podgalerie_nahled:hover { + background-color: #f9d59e; + filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4)); + color: #6f2509; } .vystredeno{ /* helper */ @@ -845,12 +828,6 @@ div.cislo-v-rocniku-blok { vertical-align: middle; max-height: 180px; max-width: 180px; - /*border: 1px solid white;*/ - -} - -.galerie_nahled img, .podgalerie_nahled img { - border-radius: 2px; } .galerie_nahled div { @@ -860,30 +837,6 @@ div.cislo-v-rocniku-blok { text-align: center; } - -.podgalerie_nahled { - display: block; - position: relative; - float: left; - width: 200px; - height: 200px; - text-align: center; - border: solid; - border-width: 2px; - border-radius: 5px; - border-color: #ffa500; - /*border-color: #ffd546;*/ - background-color: #ffd546; - /*background-color: white;*/ - white-space: nowrap; - margin: 10px 20px 10px 0px; - font-weight: bold; -} - -.podgalerie_nahled:hover { - background-color: #ffa500; -} - .podgalerie_nahled img { margin-top: 20px; margin-bottom: 15px; @@ -899,10 +852,10 @@ div.cislo-v-rocniku-blok { /* plus a minus tlacitka */ .mam-org-only-galerie { - background: #fff0d7; + background: #eee4ec; padding: 10px; margin: 10px 10px 10px -20px; - border: orange 2px dashed; + border: #333 2px dashed; float: left; } @@ -910,8 +863,8 @@ div.cislo-v-rocniku-blok { padding: 3px 5px; margin: 5px; border-radius: 20px; - background-color: lightblue; - color: black; + background-color: #6f2509;; + color: #fffbf6; float: left; } diff --git a/seminar/migrations/0082_auto_20200506_1951.py b/seminar/migrations/0082_auto_20200506_1951.py new file mode 100644 index 00000000..3132c434 --- /dev/null +++ b/seminar/migrations/0082_auto_20200506_1951.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-06 17:51 + +from django.db import migrations, models +import seminar.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0081_auto_20200408_2221'), + ] + + operations = [ + migrations.AlterField( + model_name='cislo', + name='titulka_nahled', + field=models.ImageField(blank=True, help_text='Obrázek titulní strany, generuje se automaticky', null=True, upload_to=seminar.models.cislo_png_filename, verbose_name='Obrázek titulní strany'), + ), + ] diff --git a/seminar/migrations/0083_auto_20200506_1952.py b/seminar/migrations/0083_auto_20200506_1952.py new file mode 100644 index 00000000..0c7fcf38 --- /dev/null +++ b/seminar/migrations/0083_auto_20200506_1952.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-06 17:52 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0082_auto_20200506_1951'), + ] + + operations = [ + migrations.AlterField( + model_name='treenode', + name='first_child', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='father_of_first', to='seminar.TreeNode', verbose_name='první potomek'), + ), + ] diff --git a/seminar/models.py b/seminar/models.py index 57d4304a..c53c7048 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -14,6 +14,7 @@ from django.utils.text import slugify from django.urls import reverse from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist +from django.contrib.contenttypes.models import ContentType from django.utils.text import get_valid_filename from imagekit.models import ImageSpecField, ProcessedImageField from imagekit.processors import ResizeToFit, Transpose @@ -27,6 +28,7 @@ from reversion import revisions as reversion from seminar.utils import roman, FirstTagParser # Pro získání úryvku z TextNode from unidecode import unidecode # Používám pro získání ID odkazu (ještě je to někde po někom zakomentované) +from seminar.treelib import safe_pred from polymorphic.models import PolymorphicModel @@ -1246,7 +1248,7 @@ class TreeNode(PolymorphicModel): blank = False, on_delete = models.SET_NULL, # Vrcholy s null kořenem jsou sirotci bez ročníku verbose_name="kořen stromu") - first_child = models.ForeignKey('TreeNode', + first_child = models.OneToOneField('TreeNode', related_name='father_of_first', null = True, blank = True, @@ -1303,6 +1305,10 @@ class TreeNode(PolymorphicModel): def aktualizuj_nazev(self): raise NotImplementedError("Pokus o aktualizaci názvu obecného TreeNode místo konkrétní instance") + def get_admin_url(self): + content_type = ContentType.objects.get_for_model(self.__class__) + return reverse("admin:%s_%s_change" % (content_type.app_label, content_type.model), args=(self.id,)) + class RocnikNode(TreeNode): class Meta: db_table = 'seminar_nodes_rocnik' @@ -1338,7 +1344,7 @@ class MezicisloNode(TreeNode): # TODO: Využít TreeLib def aktualizuj_nazev(self): - if self.prev: + if safe_pred(self) is not None: if (self.prev.get_real_instance_class() != CisloNode and self.prev.get_real_instance_class() != MezicisloNode): raise ValueError("Předchůdce není číslo!") diff --git a/seminar/static/seminar/prihlaska.js b/seminar/static/seminar/prihlaska.js index 81f91d28..c3565450 100644 --- a/seminar/static/seminar/prihlaska.js +++ b/seminar/static/seminar/prihlaska.js @@ -3,7 +3,7 @@ function addrCountryChanged(){ var stat_text = document.getElementById('id_li_stat_text'); var stat = stat_select[stat_select.selectedIndex].value; if (stat === "other"){ - stat_text.style.display="block"; + stat_text.style.display="revert"; } else { stat_text.style.display="none"; $('#id_stat_text').val(""); @@ -12,18 +12,22 @@ function addrCountryChanged(){ function hideSchoolTextfields(){ var skola_nazev = document.getElementById('id_li_skola_nazev'); var skola_adresa = document.getElementById('id_li_skola_adresa'); + var skola_vypln = document.getElementById('id_li_skola_vypln'); skola_nazev.style.display="none"; skola_adresa.style.display="none"; + skola_vypln.style.display="none"; } function schoolNotInList(){ var skola_nazev = document.getElementById('id_li_skola_nazev'); var skola_adresa = document.getElementById('id_li_skola_adresa'); + var skola_vypln = document.getElementById('id_li_skola_vypln'); // FIXME nefunguje a nevim proc (TypeError: $(...).select2 is not a function) //var skola_select = $('#id_skola').select2(); //skola_select.val(null).trigger('change'); - skola_nazev.style.display="block"; - skola_adresa.style.display="block"; + skola_vypln.style.display="revert"; + skola_nazev.style.display="revert"; + skola_adresa.style.display="revert"; } document.addEventListener("DOMContentLoaded", function(){ diff --git a/seminar/templates/seminar/archiv/temata.html b/seminar/templates/seminar/archiv/temata.html index ba2a6206..fc7d87e8 100644 --- a/seminar/templates/seminar/archiv/temata.html +++ b/seminar/templates/seminar/archiv/temata.html @@ -7,17 +7,13 @@ {% endblock %}{% endblock%} - {% for tema in object_list %} - {% with tema.cislo_zadani.rocnik.rocnik as rocnik %} - {% ifchanged rocnik %} - {% if not forloop.first %}{% endif %} -