From 82b137da5a52d5da29149b50f5d98b1b2aacd650 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 4 Feb 2021 12:59:23 +0100 Subject: [PATCH] confirmation step fixed --- evapp/templates/evapp/employee_form.html | 12 +++++------- evapp/views.py | 5 +++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index ba17a57..4784284 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -32,7 +32,7 @@

Schritt {{ wizard.steps.step1 }} von {{ wizard.steps.count }}

- Choice: {{choice}} + Choice: {{choice}} Datatable: {{datatable}}

{% if wizard.steps.step1 == 1 %} Angaben zur Person {% endif %} {% if choice == 'IN' %} @@ -42,20 +42,18 @@ IT-relevante Angaben {% elif wizard.steps.step1 == 4 %} Office-relevante Angaben - {% elif wizards.steps.step1 == 5 %} - Bestätigungsschritt {% endif %} {% else %} {% if wizard.steps.step1 == 2 %} Veränderungsrelevante Angaben - {% elif wizards.steps.step1 == 3 %} - Bestätigungsschritt {% endif %} - +{% endif %} +{% if datatable == True %} + Bestätigungsschritt {% endif %}

- {% if wizard.steps.step1 == 3 and choice == 'CHANGE' or wizards.steps.step1 == 6 %} + {% if datatable == True %} {% for key, value in data.items %} {{ key }}: {{ value }}

{% endfor %} diff --git a/evapp/views.py b/evapp/views.py index 55d5bc0..16bacfc 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -66,8 +66,9 @@ class EvaFormView(CookieWizardView): #print('GETCONTEXT') context = super().get_context_data(form=form, **kwargs) context.update({'choice': self.choice}) - if (self.steps.current == 5 or (self.choice == 'CHANGE' and self.steps.current ==3)): - context.update({'data': self.beautify_data(self.get_all_cleaned_data())}) + if (self.steps.step1 == 5 or (self.choice != 'IN' and self.steps.step1 == 3)): + context.update({'data': self.beautify_data(self.get_all_cleaned_data()), + 'datatable': True,}) return context def get_form_instance(self,step):