From f7dc98b10ced9e0b109572f426df5f0fa9239391 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 13 Jan 2021 15:21:22 +0100 Subject: [PATCH] data preview step added to form (not working) --- evapp/forms.py | 7 ++++++- evapp/templates/evapp/employee_form.html | 8 ++++++++ evapp/views.py | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/evapp/forms.py b/evapp/forms.py index 01fe604..ee775b5 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -1,5 +1,5 @@ from django.db import models -from django.forms import ModelForm, DateInput +from django.forms import ModelForm, DateInput, Form from .models import Employee @@ -10,6 +10,11 @@ from .models import Employee # widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}), # 'firstdate_presence': DateInput(attrs={'type': 'date'}),} +class DummyForm(Form): + class Meta: + model = Employee + fields = '__all__' + class FdbForm(ModelForm): '''this base class provides the required css class for all forms''' required_css_class = 'required' diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index 7a7780e..6f0677a 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -40,9 +40,16 @@ IT-relevante Angaben {% elif wizard.steps.step1 == 4 %} Office-relevante Angaben + {% elif wizard.steps.step1 == 5 %} + Bestätigungsschritt {% endif %}

+{% if wizard.steps.step1 == 5 %} + +Hier könnten ihre Daten stehen. + +{% else %}
{% csrf_token %} @@ -62,6 +69,7 @@

* Pflichtfeld

+{% endif %} {% if wizard.steps.prev %} {% endif %} diff --git a/evapp/views.py b/evapp/views.py index 6ffb465..598a54d 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -9,7 +9,7 @@ from formtools.wizard.views import CookieWizardView from django.shortcuts import render from .models import Employee -from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm +from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm from .settings import MAILS, EVA_MAIL def success(request): @@ -47,7 +47,7 @@ def send_mail_to_department(department, data): class EvaFormView(CookieWizardView): # model = Employee template_name = 'evapp/employee_form.html' - form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm,] + form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm] instance = None # form_class = EmployeeForm