mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-30 01:10:04 +02:00
Barely working, two steps, sidebar not right
This commit is contained in:
parent
6880684dd6
commit
c56914f2e1
9 changed files with 276 additions and 143 deletions
41
src/registrar/forms/application_wizard.py
Normal file
41
src/registrar/forms/application_wizard.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
"""Forms Wizard for creating a new domain application."""
|
||||
|
||||
import logging
|
||||
|
||||
from django import forms
|
||||
|
||||
from formtools.wizard.views import NamedUrlSessionWizardView
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class RequirementsForm(forms.Form):
|
||||
template_name = "application_requirements.html"
|
||||
agree_box = forms.BooleanField()
|
||||
|
||||
class OrganizationForm(forms.Form):
|
||||
template_name = "application_organization.html"
|
||||
organization_type = forms.ChoiceField(widget=forms.RadioSelect)
|
||||
|
||||
# List of forms in our wizard. Each entry is a tuple of a name and a form
|
||||
# subclass
|
||||
FORMS = [("requirements",RequirementsForm), ("organization",OrganizationForm)]
|
||||
|
||||
# Dict to match up the right template with the right step. Keys here must
|
||||
# match the first elements of the tuples above
|
||||
TEMPLATES = {"requirements": "application_requirements.html",
|
||||
"organization": "application_organization.html"
|
||||
}
|
||||
|
||||
class ApplicationWizard(NamedUrlSessionWizardView):
|
||||
form_list = FORMS
|
||||
|
||||
def get_template_names(self):
|
||||
"""Template for the current step.
|
||||
|
||||
The return is a singleton list.
|
||||
"""
|
||||
return [TEMPLATES[self.steps.current]]
|
||||
|
||||
def done(self, form_list, **kwargs):
|
||||
logger.info("Application form submitted.")
|
Loading…
Add table
Add a link
Reference in a new issue