diff --git a/elections2021/migrations/0027_auto_20210518_0147.py b/elections2021/migrations/0027_auto_20210518_0147.py new file mode 100644 index 0000000000000000000000000000000000000000..95a313f60856ad5753a62a660e12fc32fd0e6be5 --- /dev/null +++ b/elections2021/migrations/0027_auto_20210518_0147.py @@ -0,0 +1,34 @@ +# Generated by Django 3.2.2 on 2021-05-17 23:47 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("wagtailcore", "0062_comment_models_and_pagesubscription"), + ("elections2021", "0026_auto_20210517_2134"), + ] + + operations = [ + migrations.AddField( + model_name="elections2021homepage", + name="donate_page", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailcore.page", + verbose_name="stránka darovacího projektu", + ), + ), + migrations.AddField( + model_name="elections2021homepage", + name="onboarding_url", + field=models.URLField( + blank=True, null=True, verbose_name="URL registrace dobrovolníků" + ), + ), + ] diff --git a/elections2021/models.py b/elections2021/models.py index f27ccd34b14f8e34a98002e2f4100f7126e19427..b5bece09d264700b05c76b4e6bce6fe3df48c6db 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -211,6 +211,17 @@ class Elections2021HomePage(Page, MetadataPageMixin): matomo_id = models.IntegerField( "Matomo ID pro sledování návštěvnosti", blank=True, null=True ) + donate_page = models.ForeignKey( + "wagtailcore.Page", + verbose_name="stránka darovacího projektu", + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name="+", + ) + onboarding_url = models.URLField( + "URL registrace dobrovolníků", null=True, blank=True + ) ### PANELS @@ -248,6 +259,8 @@ class Elections2021HomePage(Page, MetadataPageMixin): settings_panels = [ FieldPanel("matomo_id"), + PageChooserPanel("donate_page", "donate.DonateProjectPage"), + FieldPanel("onboarding_url"), CommentPanel(), ] @@ -313,14 +326,10 @@ class Elections2021HomePage(Page, MetadataPageMixin): @cached_property def program_page_url(self): - # TODO launch - return "#" return get_subpage_url(self, Elections2021ProgramPage) @cached_property def program_app_page_url(self): - # TODO launch - return "#" return get_subpage_url(self, Elections2021ProgramAppPage) @cached_property diff --git a/elections2021/templates/elections2021/_side_panel.html b/elections2021/templates/elections2021/_side_panel.html index b00c0aa1dd5e76aad38704c08ce0d483af59890a..6d803a7298678526763ea976ca218e3e0d636ab6 100644 --- a/elections2021/templates/elections2021/_side_panel.html +++ b/elections2021/templates/elections2021/_side_panel.html @@ -1,36 +1,36 @@ +{% load wagtailcore_tags %} <div class="side-cta-panel" id="cta-side"> <div class="py-8 bg-white w-full flex flex-col items-center border-l-2 border-acidgreen overflow-y-scroll h-full"> + <div class="cta-card cta-news px-8 py-8 bg-acidgreen sidePanel"> <p class="font-alt text-4xl">CHCI VĚDĚT VÍCE</p> - <input name="" type="text" class="text-input form-field__control w-full mt-7" value="" placeholder="Zadejte email"> - - <button class="btn btn--icon my-2 text-lg w-full cta-btn"> - <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Přihlásit se</div> - <div class="btn__icon px-4 bg-grey-800 border-grey-500"> - <i class="ico--chevron-right"></i> + <form method="post"> + {% csrf_token %} + <input name="" type="email" class="text-input form-field__control w-full mt-7" value="" placeholder="Zadejte email" required=""> + <button class="btn btn--icon my-2 text-lg w-full cta-btn" disabled=""> + <div class="btn__body-wrap"> + <div class="btn__body py-4 leading-4 w-full">Přihlásit se k newsletteru</div> + <div class="btn__icon px-4 bg-grey-800 border-grey-500"> + <i class="ico--chevron-right"></i> + </div> </div> + </button> + <div class="checkbox form-field__control cta-cbox h-6"> + <input type="checkbox" id="checkbox_1" required=""> + <label for="checkbox_1" style="color: #000000"> Souhlasím se <a href="{{ page.root_page.gdpr_and_cookies_url }}" target="_blank">zásadami ochrany osobních údajů</a> a zasíláním novinek</label> </div> - </button> - - <div class="checkbox form-field__control cta-cbox h-6"> - <input type="checkbox" id="checkbox_1"> - <label for="checkbox_1"> Souhlasím lorem ipsum dolor sit amet </label> - </div> - + </form> </div> + <div class="cta-card cta-help px-8 py-8 bg-lemon sidePanel" id="cta-card"> <p class="font-alt text-4xl w-full mb-7">CHCI POMÁHAT</p> + {% comment %} <div class="cta-animated collapsed"> <form id="helpform"> <input name="tel" type="text" class="text-input form-field__control w-full mb-2" value="" placeholder="Telefon" required=""> - <input name="email" type="email" class="text-input form-field__control w-full mb-2" value="" placeholder="Email" required=""> - <input name="psc" type="text" class="text-input form-field__control w-full mb-2" value="" placeholder="PSČ" required=""> - <input name="" type="text" class="text-input form-field__control w-full mb-2" value="" placeholder="Moje dovednosti" required=""> - <div class="select "> <select class="select__control form-field__control w-full mb-2" onchange="this.dataset.chosen = this.value;" data-chosen="" required=""> <option selected="" value="">Kraj</option> @@ -47,7 +47,6 @@ </div> </div> </button> - </form> <div class="flex justify-center items-center w-full cta-help-toggler mt-2"> <i class="ico--chevron-up px-4 cursor-pointer"></i> @@ -55,13 +54,21 @@ </div> <button class="btn btn--icon text-lg w-full cta-button cta-help-toggler cta-animated-rev"> <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Chci pomáhat</div> + <div class="btn__body py-4 leading-4 w-full">Chci pomáhat jako dobrovolník</div> <div class="btn__icon px-4 bg-grey-800 border-grey-500"> <i class="ico--chevron-right"></i> </div> </div> </button> - + {% endcomment %} + <a href="{{ page.root_page.onboarding_url }}" class="btn btn--icon text-lg w-full cta-button my-2"> + <div class="btn__body-wrap"> + <div class="btn__body py-4 leading-4 w-full">Chci pomáhat v kampani</div> + <div class="btn__icon px-4 bg-grey-800 border-grey-500"> + <i class="ico--chevron-right"></i> + </div> + </div> + </a> </div> <script> if (typeof window.initializehelp === 'undefined') { @@ -195,15 +202,14 @@ </script> <div class="cta-card cta-support px-8 py-8 bg-white sidePanel"> <p class="font-alt text-4xl w-full mb-7">CHCI PODPOŘIT</p> - <button class="btn btn--icon text-lg w-full cta-btn"> + <a href="{% pageurl page.root_page.donate_page %}" class="btn btn--icon text-lg w-full cta-btn"> <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Call to action</div> + <div class="btn__body py-4 leading-4 w-full">Chci darovat na kampaň</div> <div class="btn__icon px-4 bg-grey-800 border-grey-500"> <i class="ico--chevron-right"></i> </div> </div> - </button> - + </a> </div> <!--todo: only toggle one body class--> <div class="side-cta-panel--toggler" onclick="document.body.classList.remove('ctaopen');getElementById('side-cta-filter').classList.remove('side-cta-panel--filter--ctaopen');getElementById('cta-side').classList.remove('side-cta-panel--ctaopen');"></div> diff --git a/elections2021/templates/elections2021/base.html b/elections2021/templates/elections2021/base.html index 5a27cf7a16a84ae41582d7876cb2f37c4fbddf96..b6b0828be17fb007970390a7fca151404b88f102 100644 --- a/elections2021/templates/elections2021/base.html +++ b/elections2021/templates/elections2021/base.html @@ -101,8 +101,7 @@ {% block content_header %}{% endblock %} <div class="relative"> - {# TODO #} - {# {% include "elections2021/_side_panel.html" %} #} + {% include "elections2021/_side_panel.html" %} {% block content %}{% endblock %} </div> diff --git a/elections2021/templates/elections2021/elections2021_home_page.html b/elections2021/templates/elections2021/elections2021_home_page.html index e28244d035df811c48a53353db4d1fcee1005228..10560301771fae78c9e19e047db319bff78fe2e3 100644 --- a/elections2021/templates/elections2021/elections2021_home_page.html +++ b/elections2021/templates/elections2021/elections2021_home_page.html @@ -136,28 +136,33 @@ {% endif %} <section id="jakpomoci" class="my-16 lg:my-20 lg:flex"> - {% comment %} + <div class="w-full"> - <div class="cta-card cta-news px-8 py-8 bg-acidgreen "> + <div class="cta-card cta-news px-8 py-8 bg-acidgreen text-black"> <p class="font-alt text-4xl">CHCI VĚDĚT VÍCE</p> - <input name="" type="text" class="text-input form-field__control w-full mt-7" value="" placeholder="Zadejte email"> - <button class="btn btn--icon my-2 text-lg w-full cta-btn"> - <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Přihlásit se</div> - <div class="btn__icon px-4 bg-grey-800 border-grey-500"> - <i class="ico--chevron-right"></i> + <form method="post"> + {% csrf_token %} + <input name="" type="email" class="text-input form-field__control w-full mt-7" value="" placeholder="Zadejte email" required=""> + <button class="btn btn--icon my-2 text-lg w-full cta-btn" disabled=""> + <div class="btn__body-wrap"> + <div class="btn__body py-4 leading-4 w-full">Přihlásit se k newsletteru</div> + <div class="btn__icon px-4 bg-grey-800 border-grey-500"> + <i class="ico--chevron-right"></i> + </div> </div> + </button> + <div class="checkbox form-field__control cta-cbox h-6"> + <input type="checkbox" id="checkbox_1" required=""> + <label for="checkbox_1" style="color: #000000"> Souhlasím se <a href="{{ page.root_page.gdpr_and_cookies_url }}" target="_blank">zásadami ochrany osobních údajů</a> a zasíláním novinek</label> </div> - </button> - <div class="checkbox form-field__control cta-cbox h-6"> - <input type="checkbox" id="checkbox_1"> - <label for="checkbox_1"> Souhlasím lorem ipsum dolor sit amet </label> - </div> + </form> </div> </div> + <div class="w-full"> <div class="cta-card cta-help px-8 py-8 bg-lemon " id="cta-card"> <p class="font-alt text-4xl w-1">CHCI POMÁHAT</p> + {% comment %} <div class="cta-animated collapsed"> <form id="helpform"> <input name="tel" type="text" class="text-input form-field__control w-full mb-2" value="" placeholder="Telefon" required=""> @@ -187,12 +192,21 @@ </div> <button class="btn btn--icon text-lg w-full cta-button cta-help-toggler cta-animated-rev"> <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Chci pomáhat</div> + <div class="btn__body py-4 leading-4 w-full">Chci pomáhat jako dobrovolník</div> <div class="btn__icon px-4 bg-grey-800 border-grey-500"> <i class="ico--chevron-right"></i> </div> </div> </button> + {% endcomment %} + <a href="{{ page.root_page.onboarding_url }}" class="btn btn--icon text-lg w-full cta-button my-2"> + <div class="btn__body-wrap"> + <div class="btn__body py-4 leading-4 w-full">Chci pomáhat v kampani</div> + <div class="btn__icon px-4 bg-grey-800 border-grey-500"> + <i class="ico--chevron-right"></i> + </div> + </div> + </a> </div> <script> if (typeof window.initializehelp === 'undefined') { @@ -325,20 +339,20 @@ }); </script> </div> + <div class="w-full"> - <div class="cta-card cta-support px-8 py-8 bg-white "> + <div class="cta-card cta-support px-8 py-8 bg-white"> <p class="font-alt text-4xl w-1">CHCI PODPOŘIT</p> - <button class="btn btn--icon text-lg w-full cta-btn"> + <a href="{% pageurl page.root_page.donate_page %}" class="btn btn--icon text-lg w-full cta-btn my-2"> <div class="btn__body-wrap"> - <div class="btn__body py-4 leading-4 w-full">Call to action</div> + <div class="btn__body py-4 leading-4 w-full">Chci darovat na kampaň</div> <div class="btn__icon px-4 bg-grey-800 border-grey-500"> <i class="ico--chevron-right"></i> </div> </div> - </button> + </a> </div> </div> - {% endcomment %} </section> </div>