From 7d76cfcdf131541323dbe4065c5951b22d618d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org> Date: Tue, 14 Jan 2025 12:07:36 +0100 Subject: [PATCH] add other_offers_agreement --- main/forms.py | 2 ++ main/models.py | 9 +++++++-- main/templates/main/main_career_page.html | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/main/forms.py b/main/forms.py index cdd5604a..fca1d522 100644 --- a/main/forms.py +++ b/main/forms.py @@ -169,6 +169,8 @@ class CareerSubmissionForm(forms.Form): personal_data_agreement = forms.BooleanField(required=True) + other_offers_agreement = forms.BooleanField(required=False) + class JekyllImportForm(SharedJekyllImportForm): def handle_import(self): diff --git a/main/models.py b/main/models.py index 574d0115..eece3ce8 100644 --- a/main/models.py +++ b/main/models.py @@ -122,7 +122,7 @@ class MainHomePage(MainHomePageMixin): menu_panels = MainHomePageMixin.menu_panels + [ FieldPanel("popout_button_name"), - FieldPanel("popout_button_content") + FieldPanel("popout_button_content"), ] edit_handler = TabbedInterface( @@ -604,7 +604,11 @@ class MainCareerPage( current_time = datetime.now() current_date = current_time.date() - if request.method == "POST" and self.closing_date > current_date and self.submission_end_date > current_date: + if ( + request.method == "POST" + and self.closing_date > current_date + and self.submission_end_date > current_date + ): form = CareerSubmissionForm(request.POST, request.FILES) if form.is_valid(): @@ -627,6 +631,7 @@ Vyplněné údaje: Příjmení: {form.cleaned_data['surname']} E-mail: {form.cleaned_data['email']} Telefon: {form.cleaned_data['phone']} + Chce posílat další nabídky: {'Ano' if form.cleaned_data['other_offers_agreement'] else 'Ne'} Vlastní text: {form.cleaned_data['own_text'] if form.cleaned_data['own_text'] else '(nevyplněn)'} CV, motivační dopis a ostatní soubory jsou v přílohách. Názvy souborů: diff --git a/main/templates/main/main_career_page.html b/main/templates/main/main_career_page.html index ec22f71c..c77620a3 100644 --- a/main/templates/main/main_career_page.html +++ b/main/templates/main/main_career_page.html @@ -157,6 +157,14 @@ for="id_personal_data_agreement" >Souhlasím se zpracováním osobním údajů (povinné)</label> </section> + + <section class="flex flex-row gap-3 items-start leading-6"> + <div class="shrink-0">{{ form.other_offers_agreement }}</div> + + <label + for="id_other_offers_agreement" + >Souhlasím, aby mi z České pirátské strany, IČO 71339698, Na Moráni 360/3, Praha, Nové Město, dali vědět, pokud pro mě budou mít jinou vhodnou pozici. (nepovinné)</label> + </section> </div> </main> <footer -- GitLab