Add your contact view, rename org contact

This commit is contained in:
igorkorenfeld 2022-11-07 19:00:54 -05:00
parent b42340d7e9
commit 1974ac6b07
No known key found for this signature in database
GPG key ID: 826947A4B867F659
4 changed files with 74 additions and 4 deletions

View file

@ -89,38 +89,52 @@ class DotGovDomainForm(forms.Form):
class PurposeForm(forms.Form):
purpose_field = forms.CharField(label="Purpose", widget=forms.Textarea())
class YourContactForm(forms.Form):
given_name = forms.CharField(label="First name/given name")
middle_name = forms.CharField(
required=False,
label="Middle name (optional)",
)
family_name = forms.CharField(label="Last name/family name")
title = forms.CharField(label="Title or role in your organization")
email = forms.EmailField(label="Email")
phone = forms.CharField(label="Phone")
# List of forms in our wizard. Each entry is a tuple of a name and a form
# subclass
FORMS = [
("organization", OrganizationForm),
("contact", ContactForm),
("org_contact", ContactForm),
("authorizing_official", AuthorizingOfficialForm),
("current_sites", CurrentSitesForm),
("dotgov_domain", DotGovDomainForm),
("purpose", PurposeForm),
("your_contact", YourContactForm),
]
# Dict to match up the right template with the right step. Keys here must
# match the first elements of the tuples in FORMS
TEMPLATES = {
"organization": "application_organization.html",
"contact": "application_contact.html",
"org_contact": "application_org_contact.html",
"authorizing_official": "application_authorizing_official.html",
"current_sites": "application_current_sites.html",
"dotgov_domain": "application_dotgov_domain.html",
"purpose": "application_purpose.html",
"your_contact": "application_your_contact.html",
}
# We need to pass our page titles as context to the templates, indexed
# by the step names
TITLES = {
"organization": "About your organization",
"contact": "Your organization's contact information",
"org_contact": "Your organization's contact information",
"authorizing_official": "Authorizing official",
"current_sites": "Website for your organization",
"current_sites": "Organization website",
"dotgov_domain": ".gov domain",
"purpose": "Purpose of your domain",
"your_contact": "Your contact information",
}

View file

@ -21,6 +21,9 @@
<span class="usa-character-count__message" id="with-hint-textarea-info with-hint-textarea-hint"> You can enter up to 500 characters </span>
</div>
</div>
{{ block.super }}
</form>
{% endblock %}

View file

@ -0,0 +1,53 @@
<!-- Test page -->
{% extends 'application_form.html' %}
{% load widget_tweaks %}
{% load static %}
{% block backnav %}
{% with form_name="step__ao" %}
{{ block.super }}
{% endwith %}
{% endblock %}
{% block form_content %}
<div id="instructions">
<p> Well use the following information to contact you about your domain request and, once your request is approved, about managing your domain.</p>
<p>If youd like us to use a different name, email, or phone number you can make those changes below. Changing your contact information here wont affect your login.gov account information.</p>
<p>The contact information you provide here wont be public and will only be used for the .gov registry.</p>
<div>
<p>All fields are required unless they are marked optional.</p>
<form class="usa-form usa-form--large" id="step__ao" method="post">
{{ wizard.management_form }}
{% csrf_token %}
<fieldset class="usa-fieldset">
{{ wizard.form.given_name|add_label_class:"usa-label" }}
{{ wizard.form.given_name|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ wizard.form.middle_name|add_label_class:"usa-label" }}
{{ wizard.form.middle_name|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ wizard.form.family_name|add_label_class:"usa-label" }}
{{ wizard.form.family_name|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ wizard.form.title|add_label_class:"usa-label" }}
{{ wizard.form.title|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ wizard.form.email|add_label_class:"usa-label" }}
{{ wizard.form.email|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ wizard.form.phone|add_label_class:"usa-label" }}
{{ wizard.form.phone|add_class:"usa-input usa-input"|attr:"aria-describedby:instructions" }}
</fieldset>
{{ block.super }}
</form>
{% endblock %}