diff --git a/main/models.py b/main/models.py index 01849262bceb5e31134b1cab3e51f9a8fab46b25..3565a1017bfc739a5c75ec4120c23e35333a4ba3 100644 --- a/main/models.py +++ b/main/models.py @@ -18,7 +18,7 @@ from wagtail.admin.edit_handlers import ( ObjectList, TabbedInterface, ) -from wagtail.contrib.routable_page.models import route +from wagtail.contrib.routable_page.models import RoutablePageMixin, route from wagtail.core.blocks import CharBlock, PageChooserBlock, RichTextBlock from wagtail.core.fields import RichTextField, StreamField from wagtail.core.models import Page @@ -48,7 +48,9 @@ class ARTICLE_TYPES(models.IntegerChoices): PRESS_RELEASE = 2, "Tisková zpráva" -class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): +class MainHomePage( + MenuMixin, RoutablePageMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page +): # header contact_newcomers = models.URLField( diff --git a/main/styleguide/source/_patterns/atoms/buttons/from-button-animated.mustache b/main/styleguide/source/_patterns/atoms/buttons/from-button-animated.mustache new file mode 100644 index 0000000000000000000000000000000000000000..99773ad98f40b550ddaf4a2eb4d92bef765db1fd --- /dev/null +++ b/main/styleguide/source/_patterns/atoms/buttons/from-button-animated.mustache @@ -0,0 +1,8 @@ +<button type="submit" class="btn btn__slide__wrap {{ classes }}"> + <span class="btn text-lg bg-black px-1 text-white lg:text-base"> + {{ btn-text }} + </span> + <span class="btn text-lg bg-white px-1 text-black lg:text-base"> + {{ btn-text }} + </span> +</button> diff --git a/main/styleguide/source/_patterns/organisms/newsletter-section.mustache b/main/styleguide/source/_patterns/organisms/newsletter-section.mustache index afad100b8dcb9b53f1b57f88147a3e32a49e9695..0a4ddaf75afda3b1bd536ab219baf408748f4cda 100644 --- a/main/styleguide/source/_patterns/organisms/newsletter-section.mustache +++ b/main/styleguide/source/_patterns/organisms/newsletter-section.mustache @@ -8,9 +8,11 @@ </span> <h5 class="newsletter-grid__main-text font-alt text-6xl xl:text-7xl uppercase">Odebírej náš newsletter</h5> <div class="newsletter-grid__input flex flex-col items-start"> - {{> atoms-form-input(placeholder: "Tvůj email", classes: "mb-3 w-full") }} - {{> atoms-form-checkbox(label: "Souhlasím se zpracováním osobních údajů", classes: "mb-3") }} - {{> atoms-button-animated(btn-text: "Odebírat") }} + <form method="post" action="."> + {{> atoms-form-input(placeholder: "Tvůj email", classes: "mb-3 w-full") }} + {{> atoms-form-checkbox(label: "Souhlasím se zpracováním osobních údajů", classes: "mb-3") }} + {{> atoms-form-button-animated(btn-text: "Odebírat") }} + </form> </div> </div> </div> diff --git a/main/templates/main/includes/form_button_animated.html b/main/templates/main/includes/form_button_animated.html new file mode 100644 index 0000000000000000000000000000000000000000..b71a80dbcacd13df5bcfc766b7142d8fa05e8b18 --- /dev/null +++ b/main/templates/main/includes/form_button_animated.html @@ -0,0 +1,8 @@ +<button type="submit" class="btn btn__slide__wrap {{ extra_classes }}"> + <span class="btn text-lg bg-black text-white px-1 lg:text-base"> + {{ btn_text | default_if_none:"Číst dále" }} + </span> + <span class="btn text-lg bg-white text-black px-1 lg:text-base"> + {{ btn_text | default_if_none:"Číst dále" }} + </span> +</button> diff --git a/main/templates/main/includes/newsletter_section.html b/main/templates/main/includes/newsletter_section.html index 5dd71146d63595e0a4bfaf6fc7cc48618225f31a..2ab5357795d7416bd35e479cdb0c68ef3852e0b3 100644 --- a/main/templates/main/includes/newsletter_section.html +++ b/main/templates/main/includes/newsletter_section.html @@ -1,7 +1,8 @@ {% load static %} <div class="section-clip bg-cover bg-no-repeat flex pb-32 xl:pb-0 xl:min-h-screen relative z-10"> - <img src="{% static 'main/images/background-images/bg-bartos-newsletter.jpg' %}" alt="" class="absolute h-full w-full object-cover"> + <img src="{% static 'main/images/background-images/bg-bartos-newsletter.jpg' %}" alt="" + class="absolute h-full w-full object-cover"> <div class="grid-container mt-20 xl:mt-0 xl:items-center z-10"> <div class="grid-full newsletter-grid"> <i class="newsletter-grid__icon ico--anchor text-7xl xl:text-9xl xl:w-full"></i> @@ -10,13 +11,18 @@ </span> <h5 class="newsletter-grid__main-text font-alt text-6xl xl:text-7xl uppercase">Odebírej náš newsletter</h5> <div class="newsletter-grid__input flex flex-col items-start"> - <input type="text" class="text-input bg-white form-field__control mb-3 w-full" value="" - placeholder="Tvůj email"/> - <div class="checkbox form-field__control flex items-center mb-3"> - <input type="checkbox" id="checkbox_1"> - <label class="text-xs font-alt font-light" for="checkbox_1">"Souhlasím se zpracováním osobních údajů"</label> - </div> - {% include 'main/includes/button_animated.html' with btn_text="Odebírat" %} + <form method="post" action="{{ page.root_page.newsletter_subscribe_url }}"> + {% csrf_token %} + <input type="hidden" name="return_page_id" value="{{ page.id }}"> + <input type="email" name="email" class="text-input bg-white form-field__control mb-3 w-full" value="" required="" + placeholder="Tvůj email"/> + <div class="checkbox form-field__control flex items-center mb-3"> + <input type="checkbox" id="checkbox_1" name="confirmed" required=""> + <label class="text-xs font-alt font-light" for="checkbox_1">"Souhlasím se zpracováním osobních + údajů"</label> + </div> + {% include 'main/includes/form_button_animated.html' with btn_text="Odebírat" %} + </form> </div> </div> </div>