diff --git a/elections/blocks.py b/elections/blocks.py index 02cb757714daf3960e6ead0d64c3aec7f950eeca..77e7976effd84f5016be4ef014745c8654086047 100644 --- a/elections/blocks.py +++ b/elections/blocks.py @@ -17,12 +17,6 @@ class ElectionsCarouselBlock(StructBlock): help_text="Pokud není vybráno video, ukáže se na mobilu i desktopu.", ) - preview_image = ImageChooserBlock( - label="Preview obrázek", - help_text="Obrázek, který se bude ukazovat při načítání nebo nedostupnosti videa.", - required=False, - ) - video_url = URLBlock( label="URL videa", help_text="Pokud je vybráno, ukáže se na desktopech s povoleným autoplayem místo obrázku.", diff --git a/elections/migrations/0018_alter_electionshomepage_content.py b/elections/migrations/0018_alter_electionshomepage_content.py new file mode 100644 index 0000000000000000000000000000000000000000..d81c7b2288a2e6b0049d7ea33554b874badb5d2e --- /dev/null +++ b/elections/migrations/0018_alter_electionshomepage_content.py @@ -0,0 +1,216 @@ +# Generated by Django 4.1.10 on 2024-01-19 16:39 + +from django.db import migrations +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("elections", "0017_alter_electionshomepage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="electionshomepage", + name="content", + field=wagtail.fields.StreamField( + [ + ( + "carousel", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Pokud není vybráno video, ukáže se na mobilu i desktopu.", + label="Obrázek na pozadí", + ), + ), + ( + "video_url", + wagtail.blocks.URLBlock( + help_text="Pokud je vybráno, ukáže se na desktopech s povoleným autoplayem místo obrázku.", + label="URL videa", + required=False, + ), + ), + ] + ), + ), + ( + "candidates", + wagtail.blocks.StructBlock( + [ + ( + "candidates", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + label="Stránka", + page_type=[ + "elections.ElectionsCandidatePage" + ], + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Pokud není vybrán, použije se obrázek ze stránky kandidáta", + label="Obrázek", + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + label="Popis" + ), + ), + ] + ), + label="Kandidáti", + ), + ) + ] + ), + ), + ( + "secondary_candidates", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(label="Nadpis")), + ( + "candidates", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "number", + wagtail.blocks.CharBlock( + label="Číslo" + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + label="Stránka", + page_type=[ + "elections.ElectionsCandidatePage" + ], + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Pokud není vybrán, použije se obrázek ze stránky kandidáta", + label="Obrázek", + required=False, + ), + ), + ] + ), + label="Kandidáti", + ), + ), + ] + ), + ), + ( + "program", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + default="Program", + help_text="Např. 'Program'", + label="Nadpis", + ), + ), + ( + "categories", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "number", + wagtail.blocks.IntegerBlock( + label="Číslo" + ), + ), + ( + "name", + wagtail.blocks.CharBlock( + label="Název" + ), + ), + ( + "points", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.TextBlock( + label="Obsah" + ), + ) + ] + ), + label="Body", + ), + ), + ] + ), + label="Kategorie", + ), + ), + ( + "long_version_url", + wagtail.blocks.URLBlock( + help_text="Pro zobrazení odkazu na celou verzi programu musí být obě následující pole vyplněná.", + label="Odkaz na celou verzi programu", + required=False, + ), + ), + ( + "long_version_text", + wagtail.blocks.CharBlock( + label="Nadpis odkazu na celou verzi programu", + required=False, + ), + ), + ] + ), + ), + ( + "news", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Nejnovější články se načtou automaticky", + label="Titulek", + ), + ), + ( + "description", + wagtail.blocks.TextBlock(label="Popis"), + ), + ], + template="styleguide2/includes/organisms/articles/elections/articles_section.html", + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Hlavní obsah", + ), + ), + ] diff --git a/requirements/base.in b/requirements/base.in index 0c9a5aba3957704142543be5d1087a557406b484..b9ccf0ee7b9bb0c17a4fc765280f77c4e5fedf83 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -29,4 +29,3 @@ fastjsonschema tweepy requests-cache wand -tatsu<=5.8.3 diff --git a/requirements/base.txt b/requirements/base.txt index ac6ccd272b27e749a2199f88340e1a3fccf375e2..51e2c158af73cffb430c8d3a2728a301c34bcb85 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,53 +1,57 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile base.in # -amqp==5.2.0 +amqp==5.1.1 # via kombu anyascii==0.3.2 # via wagtail -arrow==1.3.0 +appnope==0.1.3 + # via ipython +arrow==1.2.3 # via # -r base.in # ics asgiref==3.7.2 # via django -asttokens==2.4.1 +asttokens==2.2.1 # via stack-data -async-timeout==4.0.3 +async-timeout==4.0.2 # via redis -attrs==23.2.0 +attrs==23.1.0 # via # cattrs # ics # requests-cache +backcall==0.2.0 + # via ipython beautifulsoup4==4.11.2 # via # -r base.in # wagtail -billiard==4.2.0 +billiard==4.1.0 # via celery -bleach==6.1.0 +bleach==6.0.0 # via -r base.in -brotli==1.1.0 +brotli==1.0.9 # via fonttools -cattrs==23.2.3 +cattrs==23.1.2 # via requests-cache -celery==5.3.6 +celery==5.3.1 # via -r base.in -certifi==2023.11.17 +certifi==2023.5.7 # via # requests # sentry-sdk -cffi==1.16.0 +cffi==1.15.1 # via # cryptography # weasyprint -charset-normalizer==3.3.2 +charset-normalizer==3.2.0 # via requests -click==8.1.7 +click==8.1.4 # via # celery # click-didyoumean @@ -59,7 +63,7 @@ click-plugins==1.1.1 # via celery click-repl==0.3.0 # via celery -cryptography==41.0.7 +cryptography==41.0.2 # via # josepy # mozilla-django-oidc @@ -70,7 +74,7 @@ datetime==4.9 # via icalevents decorator==5.1.1 # via ipython -django==4.1.13 +django==4.1.10 # via # -r base.in # django-extensions @@ -98,17 +102,17 @@ django-permissionedforms==0.1 # via wagtail django-ranged-response==0.2.0 # via django-simple-captcha -django-redis==5.4.0 +django-redis==5.3.0 # via -r base.in django-settings-export==1.2.1 # via -r base.in -django-simple-captcha==0.5.20 +django-simple-captcha==0.5.18 # via -r base.in django-taggit==3.1.0 # via wagtail django-treebeard==4.7 # via wagtail -django-widget-tweaks==1.5.0 +django-widget-tweaks==1.4.12 # via -r base.in djangorestframework==3.14.0 # via wagtail @@ -116,11 +120,13 @@ draftjs-exporter==2.1.7 # via wagtail et-xmlfile==1.1.0 # via openpyxl -executing==2.0.1 +exceptiongroup==1.1.2 + # via cattrs +executing==1.2.0 # via stack-data -fastjsonschema==2.19.1 +fastjsonschema==2.17.1 # via -r base.in -fonttools[woff]==4.47.2 +fonttools[woff]==4.40.0 # via weasyprint html5lib==1.1 # via @@ -134,52 +140,54 @@ icalevents==0.1.27 # via -r base.in ics==0.7.2 # via -r base.in -idna==3.6 +idna==3.4 # via requests -ipython==8.20.0 +ipython==8.14.0 # via -r base.in -jedi==0.19.1 +jedi==0.18.2 # via ipython -josepy==1.14.0 +josepy==1.13.0 # via mozilla-django-oidc -kombu==5.3.5 +kombu==5.3.1 # via celery l18n==2021.3 # via wagtail -markdown==3.5.2 +markdown==3.4.3 # via -r base.in matplotlib-inline==0.1.6 # via ipython -mozilla-django-oidc==3.0.0 +mozilla-django-oidc==2.0.0 # via pirates -numpy==1.26.3 +numpy==1.25.1 # via opencv-python oauthlib==3.2.2 # via # requests-oauthlib # tweepy -opencv-python==4.9.0.80 +opencv-python==4.8.0.74 # via -r base.in openpyxl==3.1.2 # via wagtail parso==0.8.3 # via jedi -pexpect==4.9.0 +pexpect==4.8.0 + # via ipython +pickleshare==0.7.5 # via ipython pillow==9.5.0 # via # django-simple-captcha # wagtail # weasyprint -pirates==0.7.0 +pirates==0.6.0 # via -r base.in -platformdirs==4.1.0 +platformdirs==3.8.1 # via requests-cache -prompt-toolkit==3.0.43 +prompt-toolkit==3.0.39 # via # click-repl # ipython -psycopg2-binary==2.9.9 +psycopg2-binary==2.9.6 # via -r base.in ptyprocess==0.7.0 # via pexpect @@ -187,13 +195,13 @@ pure-eval==0.2.2 # via stack-data pycparser==2.21 # via cffi -pydyf==0.8.0 +pydyf==0.7.0 # via weasyprint -pygments==2.17.2 +pygments==2.15.1 # via ipython -pyopenssl==23.3.0 +pyopenssl==23.2.0 # via josepy -pyparsing==3.1.1 +pyparsing==3.1.0 # via httplib2 pypdf2==3.0.1 # via -r base.in @@ -214,23 +222,24 @@ pytz==2021.3 # icalendar # icalevents # l18n -pyyaml==6.0.1 +pyyaml==6.0 # via -r base.in -redis==5.0.1 +redis==4.6.0 # via django-redis requests==2.31.0 # via # -r base.in + # instaloader # mozilla-django-oidc # requests-cache # requests-oauthlib # tweepy # wagtail -requests-cache==1.1.1 +requests-cache==1.1.0 # via -r base.in requests-oauthlib==1.3.1 # via tweepy -sentry-sdk==1.39.2 +sentry-sdk==1.28.0 # via -r base.in six==1.16.0 # via @@ -241,40 +250,40 @@ six==1.16.0 # l18n # python-dateutil # url-normalize -soupsieve==2.5 +soupsieve==2.4.1 # via beautifulsoup4 sqlparse==0.4.4 # via django -stack-data==0.6.3 +stack-data==0.6.2 # via ipython tatsu==5.8.3 - # via - # -r base.in - # ics + # via ics telepath==0.3.1 # via wagtail tinycss2==1.2.1 # via # cssselect2 # weasyprint -traitlets==5.14.1 +traitlets==5.9.0 # via # ipython # matplotlib-inline tweepy==4.14.0 # via -r base.in -types-python-dateutil==2.8.19.20240106 - # via arrow -tzdata==2023.4 +typing-extensions==4.7.1 + # via + # asgiref + # cattrs +tzdata==2023.3 # via celery url-normalize==1.4.3 # via requests-cache -urllib3==2.1.0 +urllib3==2.0.3 # via # requests # requests-cache # sentry-sdk -vine==5.1.0 +vine==5.0.0 # via # amqp # celery @@ -284,15 +293,15 @@ wagtail==4.2.4 # -r base.in # wagtail-metadata # wagtail-trash +wand==0.6.13 + # manual for now wagtail-metadata==4.0.3 # via -r base.in -wagtail-trash==2.0.0 - # via -r base.in -wand==0.6.13 +wagtail-trash==1.0.1 # via -r base.in -wcwidth==0.2.13 +wcwidth==0.2.6 # via prompt-toolkit -weasyprint==60.2 +weasyprint==59.0 # via -r base.in webencodings==0.5.1 # via @@ -300,13 +309,13 @@ webencodings==0.5.1 # cssselect2 # html5lib # tinycss2 -whitenoise==6.6.0 +whitenoise==6.5.0 # via -r base.in willow==1.4.1 # via wagtail -zope-interface==6.1 +zope-interface==6.0 # via datetime -zopfli==0.2.3 +zopfli==0.2.2 # via fonttools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/dev.txt b/requirements/dev.txt index 5678bf979b964ee07e8802c27e659ce862b09101..bc904efd9d351aecc3d3fd8a1f0503b53af4aa7b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,38 +1,40 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile dev.in # asgiref==3.7.2 # via django -coverage[toml]==7.4.0 +coverage[toml]==7.2.7 # via pytest-cov -django==4.1.13 +django==4.1.10 # via # -r dev.in # django-debug-toolbar -django-debug-toolbar==4.2.0 +django-debug-toolbar==4.1.0 # via -r dev.in -factory-boy==3.3.0 +exceptiongroup==1.1.2 + # via pytest +factory-boy==3.2.1 # via pytest-factoryboy -faker==22.2.0 +faker==18.13.0 # via factory-boy fastdiff==0.3.0 # via snapshottest -freezegun==1.4.0 +freezegun==1.2.2 # via pytest-freezegun inflection==0.5.1 # via pytest-factoryboy iniconfig==2.0.0 # via pytest -packaging==23.2 +packaging==23.1 # via # pytest # pytest-sugar -pluggy==1.3.0 +pluggy==1.2.0 # via pytest -pytest==7.4.4 +pytest==7.4.0 # via # -r dev.in # pytest-cov @@ -43,13 +45,13 @@ pytest==7.4.4 # pytest-sugar pytest-cov==4.1.0 # via -r dev.in -pytest-django==4.7.0 +pytest-django==4.5.2 # via -r dev.in -pytest-factoryboy==2.6.0 +pytest-factoryboy==2.5.1 # via -r dev.in pytest-freezegun==0.4.2 # via -r dev.in -pytest-mock==3.12.0 +pytest-mock==3.11.1 # via -r dev.in pytest-sugar==0.9.7 # via -r dev.in @@ -67,12 +69,18 @@ sqlparse==0.4.4 # via # django # django-debug-toolbar -termcolor==2.4.0 +termcolor==2.3.0 # via # pytest-sugar # snapshottest -typing-extensions==4.9.0 - # via pytest-factoryboy +tomli==2.0.1 + # via + # coverage + # pytest +typing-extensions==4.7.1 + # via + # asgiref + # pytest-factoryboy wasmer==1.1.0 # via fastdiff wasmer-compiler-cranelift==1.1.0 diff --git a/requirements/production.txt b/requirements/production.txt index 74278924de31427cd843cb614e39cdeb8a461afd..4f1ff713e8bdd33fadf6ca9bece8acbfc4575046 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,10 +1,11 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile production.in # -gunicorn==21.2.0 +gunicorn==20.1.0 # via -r production.in -packaging==23.2 - # via gunicorn + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/shared/static/styleguide2/images/background-images/loading.gif b/shared/static/styleguide2/images/background-images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..e4a88ce04919120c37580ee43196c0aadd5601e6 Binary files /dev/null and b/shared/static/styleguide2/images/background-images/loading.gif differ diff --git a/shared/templates/styleguide2/includes/molecules/menus/elections/carousel.html b/shared/templates/styleguide2/includes/molecules/menus/elections/carousel.html index 7058b266e2f3457f899a2a423c0c216f9c4b104a..51db68639722207644ea1ba6ca5f68e149c3114b 100644 --- a/shared/templates/styleguide2/includes/molecules/menus/elections/carousel.html +++ b/shared/templates/styleguide2/includes/molecules/menus/elections/carousel.html @@ -12,12 +12,7 @@ <video class="header-carousel--image opacity-60 hidden xl:block" - - {% if self.preview_image %} - {% image self.preview_image original as preview_image %} - poster="{{ preview_image.url }}" - {% endif %} - + poster="{% static 'styleguide2/images/background-images/loading.gif' %}" autoplay muted loop