mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-10 22:44:47 +02:00
Select box for Top-level Federal Agency on organization contact form
This commit is contained in:
parent
c5e406c400
commit
05d00ff55c
5 changed files with 172 additions and 91 deletions
|
@ -29,7 +29,10 @@ class OrganizationTypeForm(RegistrarForm):
|
||||||
required=True,
|
required=True,
|
||||||
choices=[
|
choices=[
|
||||||
(DomainApplication.FEDERAL, "Federal: a federal agency"),
|
(DomainApplication.FEDERAL, "Federal: a federal agency"),
|
||||||
(DomainApplication.INTERSTATE, "Interstate: an organization of two or more states"),
|
(
|
||||||
|
DomainApplication.INTERSTATE,
|
||||||
|
"Interstate: an organization of two or more states",
|
||||||
|
),
|
||||||
(
|
(
|
||||||
DomainApplication.STATE_OR_TERRITORY,
|
DomainApplication.STATE_OR_TERRITORY,
|
||||||
(
|
(
|
||||||
|
@ -77,6 +80,151 @@ class OrganizationElectionForm(RegistrarForm):
|
||||||
|
|
||||||
|
|
||||||
class OrganizationContactForm(RegistrarForm):
|
class OrganizationContactForm(RegistrarForm):
|
||||||
|
# for federal agencies we also want to know the top-level agency.
|
||||||
|
federal_agency = forms.ChoiceField(
|
||||||
|
label="Top level federal agency",
|
||||||
|
# not required because this field won't be filled out unless
|
||||||
|
# it is a federal agency.
|
||||||
|
required=False,
|
||||||
|
choices=[
|
||||||
|
(v, v)
|
||||||
|
for v in [
|
||||||
|
"",
|
||||||
|
"Administrative Conference of the United States",
|
||||||
|
"Advisory Council on Historic Preservation",
|
||||||
|
"American Battle Monuments Commission",
|
||||||
|
"Appalachian Regional Commission",
|
||||||
|
"Appraisal Subcommittee of the Federal Financial Institutions Examination Council",
|
||||||
|
"Armed Forces Retirement Home",
|
||||||
|
"Barry Goldwater Scholarship and Excellence in Education Program",
|
||||||
|
"Central Intelligence Agency",
|
||||||
|
"Christopher Columbus Fellowship Foundation",
|
||||||
|
"Commission for the Preservation of America's Heritage Abroad",
|
||||||
|
"Commission of Fine Arts",
|
||||||
|
"Committee for Purchase From People Who Are Blind or Severely Disabled",
|
||||||
|
"Commodity Futures Trading Commission",
|
||||||
|
"Consumer Financial Protection Bureau",
|
||||||
|
"Consumer Product Safety Commission",
|
||||||
|
"Corporation for National and Community Service",
|
||||||
|
"Council of Inspectors General on Integrity and Efficiency",
|
||||||
|
"DC Court Services and Offender Supervision Agency",
|
||||||
|
"DC Pre-trial Services",
|
||||||
|
"Defense Nuclear Facilities Safety Board",
|
||||||
|
"Delta Regional Authority",
|
||||||
|
"Denali Commission",
|
||||||
|
"Department of Agriculture",
|
||||||
|
"Department of Commerce",
|
||||||
|
"Department of Defense",
|
||||||
|
"Department of Education",
|
||||||
|
"Department of Energy",
|
||||||
|
"Department of Health and Human Services",
|
||||||
|
"Department of Homeland Security",
|
||||||
|
"Department of Housing and Urban Development",
|
||||||
|
"Department of Justice",
|
||||||
|
"Department of Labor",
|
||||||
|
"Department of State",
|
||||||
|
"Department of the Interior",
|
||||||
|
"Department of the Treasury",
|
||||||
|
"Department of Transportation",
|
||||||
|
"Department of Veterans Affairs",
|
||||||
|
"Director of National Intelligence",
|
||||||
|
"Dwight D. Eisenhower Memorial Commission",
|
||||||
|
"Election Assistance Commission",
|
||||||
|
"Environmental Protection Agency",
|
||||||
|
"Equal Employment Opportunity Commission",
|
||||||
|
"Export-Import Bank of the United States",
|
||||||
|
"Farm Credit Administration",
|
||||||
|
"Farm Credit System Insurance Corporation",
|
||||||
|
"Federal Communications Commission",
|
||||||
|
"Federal Deposit Insurance Corporation",
|
||||||
|
"Federal Election Commission",
|
||||||
|
"Federal Financial Institutions Examination Council",
|
||||||
|
"Federal Housing Finance Agency",
|
||||||
|
"Federal Judiciary",
|
||||||
|
"Federal Labor Relations Authority",
|
||||||
|
"Federal Maritime Commission",
|
||||||
|
"Federal Mediation and Conciliation Service",
|
||||||
|
"Federal Mine Safety and Health Review Commission",
|
||||||
|
"Federal Reserve System",
|
||||||
|
"Federal Trade Commission",
|
||||||
|
"General Services Administration",
|
||||||
|
"Gulf Coast Ecosystem Restoration Council",
|
||||||
|
"Harry S Truman Scholarship Foundation",
|
||||||
|
"Institute of Peace",
|
||||||
|
"Inter-American Foundation",
|
||||||
|
"International Boundary and Water Commission: United States and Mexico",
|
||||||
|
"International Boundary Commission: United States and Canada",
|
||||||
|
"International Joint Commission: United States and Canada",
|
||||||
|
"James Madison Memorial Fellowship Foundation",
|
||||||
|
"Japan-United States Friendship Commission",
|
||||||
|
"John F. Kennedy Center for the Performing Arts",
|
||||||
|
"Legal Services Corporation",
|
||||||
|
"Legislative Branch",
|
||||||
|
"Marine Mammal Commission",
|
||||||
|
"Medicare Payment Advisory Commission",
|
||||||
|
"Merit Systems Protection Board",
|
||||||
|
"Millennium Challenge Corporation",
|
||||||
|
"National Aeronautics and Space Administration",
|
||||||
|
"National Archives and Records Administration",
|
||||||
|
"National Capital Planning Commission",
|
||||||
|
"National Council on Disability",
|
||||||
|
"National Credit Union Administration",
|
||||||
|
"National Foundation on the Arts and the Humanities",
|
||||||
|
"National Gallery of Art",
|
||||||
|
"National Labor Relations Board",
|
||||||
|
"National Mediation Board",
|
||||||
|
"National Science Foundation",
|
||||||
|
"National Transportation Safety Board",
|
||||||
|
"Northern Border Regional Commission",
|
||||||
|
"Nuclear Regulatory Commission",
|
||||||
|
"Nuclear Safety Oversight Committee",
|
||||||
|
"Nuclear Waste Technical Review Board",
|
||||||
|
"Occupational Safety and Health Review Commission",
|
||||||
|
"Office of Compliance",
|
||||||
|
"Office of Government Ethics",
|
||||||
|
"Office of Navajo and Hopi Indian Relocation",
|
||||||
|
"Office of Personnel Management",
|
||||||
|
"Overseas Private Investment Corporation",
|
||||||
|
"Peace Corps",
|
||||||
|
"Pension Benefit Guaranty Corporation",
|
||||||
|
"Postal Regulatory Commission",
|
||||||
|
"Privacy and Civil Liberties Oversight Board",
|
||||||
|
"Public Defender Service for the District of Columbia",
|
||||||
|
"Railroad Retirement Board",
|
||||||
|
"Securities and Exchange Commission",
|
||||||
|
"Selective Service System",
|
||||||
|
"Small Business Administration",
|
||||||
|
"Smithsonian Institution",
|
||||||
|
"Social Security Administration",
|
||||||
|
"State Justice Institute",
|
||||||
|
"State, Local, and Tribal Government",
|
||||||
|
"Stennis Center for Public Service",
|
||||||
|
"Surface Transportation Board",
|
||||||
|
"Tennessee Valley Authority",
|
||||||
|
"The Executive Office of the President",
|
||||||
|
"U.S. Access Board",
|
||||||
|
"U.S. Agency for Global Media",
|
||||||
|
"U.S. Agency for International Development",
|
||||||
|
"U.S. Chemical Safety Board",
|
||||||
|
"U.S. China Economic and Security Review Commission",
|
||||||
|
"U.S. Commission on Civil Rights",
|
||||||
|
"U.S. Commission on International Religious Freedom",
|
||||||
|
"U.S. Interagency Council on Homelessness",
|
||||||
|
"U.S. International Trade Commission",
|
||||||
|
"U.S. Office of Special Counsel",
|
||||||
|
"U.S. Postal Service",
|
||||||
|
"U.S. Trade and Development Agency",
|
||||||
|
"Udall Foundation",
|
||||||
|
"United States African Development Foundation",
|
||||||
|
"United States Arctic Research Commission",
|
||||||
|
"United States Holocaust Memorial Museum",
|
||||||
|
"Utah Reclamation Mitigation and Conservation Commission",
|
||||||
|
"Vietnam Education Foundation",
|
||||||
|
"Woodrow Wilson International Center for Scholars",
|
||||||
|
"World War I Centennial Commission",
|
||||||
|
]
|
||||||
|
],
|
||||||
|
)
|
||||||
organization_name = forms.CharField(label="Organization Name")
|
organization_name = forms.CharField(label="Organization Name")
|
||||||
address_line1 = forms.CharField(label="Address line 1")
|
address_line1 = forms.CharField(label="Address line 1")
|
||||||
address_line2 = forms.CharField(
|
address_line2 = forms.CharField(
|
||||||
|
@ -314,7 +462,7 @@ class ApplicationWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
|
||||||
"""
|
"""
|
||||||
return [TEMPLATES[self.steps.current]]
|
return [TEMPLATES[self.steps.current]]
|
||||||
|
|
||||||
def _is_federal(self) -> bool:
|
def _is_federal(self) -> Union[bool, None]:
|
||||||
"""Return whether this application is from a federal agency.
|
"""Return whether this application is from a federal agency.
|
||||||
|
|
||||||
Returns True if we know that this application is from a federal
|
Returns True if we know that this application is from a federal
|
||||||
|
@ -325,17 +473,13 @@ class ApplicationWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
|
||||||
if organization_type_data is None:
|
if organization_type_data is None:
|
||||||
return None # no answers here yet
|
return None # no answers here yet
|
||||||
organization_type = organization_type_data.get("organization_type")
|
organization_type = organization_type_data.get("organization_type")
|
||||||
print(organization_type)
|
|
||||||
if organization_type is None:
|
if organization_type is None:
|
||||||
# they haven't answered this question
|
# they haven't answered this question
|
||||||
print("No organization type: returning None")
|
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
# they have answered this question
|
# they have answered this question
|
||||||
if organization_type == DomainApplication.FEDERAL:
|
if organization_type == DomainApplication.FEDERAL:
|
||||||
print("organization type is federal: returning true")
|
|
||||||
return True
|
return True
|
||||||
print("organization type is not federal: returning false")
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_context_data(self, form, **kwargs):
|
def get_context_data(self, form, **kwargs):
|
||||||
|
|
|
@ -24,18 +24,18 @@
|
||||||
<legend class="usa-sr-only">What is the name and mailing address of your organization?</legend>
|
<legend class="usa-sr-only">What is the name and mailing address of your organization?</legend>
|
||||||
|
|
||||||
{% if is_federal %}
|
{% if is_federal %}
|
||||||
{% include 'includes/organization_federal.html' %}
|
{{ wizard.form.federal_agency|add_label_class:"usa-label" }}
|
||||||
{% else %}
|
{{ wizard.form.federal_agency|add_class:"usa-select" }}
|
||||||
{% include 'includes/organization_nonfederal.html' %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{{ wizard.form.organization_name|add_label_class:"usa-label" }}
|
||||||
|
{{ wizard.form.organization_name|add_class:"usa-input" }}
|
||||||
{{ wizard.form.address_line1|add_label_class:"usa-label" }}
|
{{ wizard.form.address_line1|add_label_class:"usa-label" }}
|
||||||
{{ wizard.form.address_line1|add_class:"usa-input" }}
|
{{ wizard.form.address_line1|add_class:"usa-input" }}
|
||||||
{{ wizard.form.address_line2|add_label_class:"usa-label" }}
|
{{ wizard.form.address_line2|add_label_class:"usa-label" }}
|
||||||
{{ wizard.form.address_line2|add_class:"usa-input" }}
|
{{ wizard.form.address_line2|add_class:"usa-input" }}
|
||||||
{{ wizard.form.us_state|add_label_class:"usa-label" }}
|
{{ wizard.form.us_state|add_label_class:"usa-label" }}
|
||||||
<div class="usa-combo-box">
|
{{ wizard.form.us_state|add_class:"usa-select" }}
|
||||||
{{ wizard.form.us_state|add_class:"usa-select" }}
|
|
||||||
</div>
|
|
||||||
{{ wizard.form.zipcode|add_label_class:"usa-label" }}
|
{{ wizard.form.zipcode|add_label_class:"usa-label" }}
|
||||||
{{ wizard.form.zipcode|add_class:"usa-input usa-input--small" }}
|
{{ wizard.form.zipcode|add_class:"usa-input usa-input--small" }}
|
||||||
|
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
{% load widget_tweaks %}
|
|
||||||
|
|
||||||
{{ wizard.form.organization_name|add_label_class:"usa-label" }}
|
|
||||||
<div class="usa-combo-box">
|
|
||||||
<select class="usa-select" name="fruit" id="id_organization_contact-organization_name">
|
|
||||||
<option value>Select a fruit</option>
|
|
||||||
<option value="apple">Apple</option>
|
|
||||||
<option value="apricot">Apricot</option>
|
|
||||||
<option value="avocado">Avocado</option>
|
|
||||||
<option value="banana">Banana</option>
|
|
||||||
<option value="blackberry">Blackberry</option>
|
|
||||||
<option value="blood orange">Blood orange</option>
|
|
||||||
<option value="blueberry">Blueberry</option>
|
|
||||||
<option value="boysenberry">Boysenberry</option>
|
|
||||||
<option value="breadfruit">Breadfruit</option>
|
|
||||||
<option value="buddhas hand citron">Buddha's hand citron</option>
|
|
||||||
<option value="cantaloupe">Cantaloupe</option>
|
|
||||||
<option value="clementine">Clementine</option>
|
|
||||||
<option value="crab apple">Crab apple</option>
|
|
||||||
<option value="currant">Currant</option>
|
|
||||||
<option value="cherry">Cherry</option>
|
|
||||||
<option value="custard apple">Custard apple</option>
|
|
||||||
<option value="coconut">Coconut</option>
|
|
||||||
<option value="cranberry">Cranberry</option>
|
|
||||||
<option value="date">Date</option>
|
|
||||||
<option value="dragonfruit">Dragonfruit</option>
|
|
||||||
<option value="durian">Durian</option>
|
|
||||||
<option value="elderberry">Elderberry</option>
|
|
||||||
<option value="fig">Fig</option>
|
|
||||||
<option value="gooseberry">Gooseberry</option>
|
|
||||||
<option value="grape">Grape</option>
|
|
||||||
<option value="grapefruit">Grapefruit</option>
|
|
||||||
<option value="guava">Guava</option>
|
|
||||||
<option value="honeydew melon">Honeydew melon</option>
|
|
||||||
<option value="jackfruit">Jackfruit</option>
|
|
||||||
<option value="kiwifruit">Kiwifruit</option>
|
|
||||||
<option value="kumquat">Kumquat</option>
|
|
||||||
<option value="lemon">Lemon</option>
|
|
||||||
<option value="lime">Lime</option>
|
|
||||||
<option value="lychee">Lychee</option>
|
|
||||||
<option value="mandarine">Mandarine</option>
|
|
||||||
<option value="mango">Mango</option>
|
|
||||||
<option value="mangosteen">Mangosteen</option>
|
|
||||||
<option value="marionberry">Marionberry</option>
|
|
||||||
<option value="nectarine">Nectarine</option>
|
|
||||||
<option value="orange">Orange</option>
|
|
||||||
<option value="papaya">Papaya</option>
|
|
||||||
<option value="passionfruit">Passionfruit</option>
|
|
||||||
<option value="peach">Peach</option>
|
|
||||||
<option value="pear">Pear</option>
|
|
||||||
<option value="persimmon">Persimmon</option>
|
|
||||||
<option value="plantain">Plantain</option>
|
|
||||||
<option value="plum">Plum</option>
|
|
||||||
<option value="pineapple">Pineapple</option>
|
|
||||||
<option value="pluot">Pluot</option>
|
|
||||||
<option value="pomegranate">Pomegranate</option>
|
|
||||||
<option value="pomelo">Pomelo</option>
|
|
||||||
<option value="quince">Quince</option>
|
|
||||||
<option value="raspberry">Raspberry</option>
|
|
||||||
<option value="rambutan">Rambutan</option>
|
|
||||||
<option value="soursop">Soursop</option>
|
|
||||||
<option value="starfruit">Starfruit</option>
|
|
||||||
<option value="strawberry">Strawberry</option>
|
|
||||||
<option value="tamarind">Tamarind</option>
|
|
||||||
<option value="tangelo">Tangelo</option>
|
|
||||||
<option value="tangerine">Tangerine</option>
|
|
||||||
<option value="ugli fruit">Ugli fruit</option>
|
|
||||||
<option value="watermelon">Watermelon</option>
|
|
||||||
<option value="white currant">White currant</option>
|
|
||||||
<option value="yuzu">Yuzu</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
|
@ -1,4 +0,0 @@
|
||||||
{% load widget_tweaks %}
|
|
||||||
|
|
||||||
{{ wizard.form.organization_name|add_label_class:"usa-label" }}
|
|
||||||
{{ wizard.form.organization_name|add_class:"usa-input" }}
|
|
|
@ -123,7 +123,7 @@ class FormTests(TestWithUser, WebTest):
|
||||||
|
|
||||||
# ---- TYPE PAGE ----
|
# ---- TYPE PAGE ----
|
||||||
type_form = type_page.form
|
type_form = type_page.form
|
||||||
type_form["organization_type-organization_type"] = "Federal"
|
type_form["organization_type-organization_type"] = "federal"
|
||||||
|
|
||||||
# set the session ID before .submit()
|
# set the session ID before .submit()
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
@ -325,7 +325,7 @@ class FormTests(TestWithUser, WebTest):
|
||||||
self.assertNotContains(type_page, TITLES["organization_federal"])
|
self.assertNotContains(type_page, TITLES["organization_federal"])
|
||||||
self.assertNotContains(type_page, TITLES["organization_election"])
|
self.assertNotContains(type_page, TITLES["organization_election"])
|
||||||
type_form = type_page.form
|
type_form = type_page.form
|
||||||
type_form["organization_type-organization_type"] = "Federal"
|
type_form["organization_type-organization_type"] = "federal"
|
||||||
|
|
||||||
# set the session ID before .submit()
|
# set the session ID before .submit()
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
@ -343,6 +343,19 @@ class FormTests(TestWithUser, WebTest):
|
||||||
self.assertContains(federal_page, TITLES["organization_federal"])
|
self.assertContains(federal_page, TITLES["organization_federal"])
|
||||||
self.assertNotContains(federal_page, TITLES["organization_election"])
|
self.assertNotContains(federal_page, TITLES["organization_election"])
|
||||||
|
|
||||||
|
# continuing on in the flow we need to see top-level agency on the
|
||||||
|
# contact page
|
||||||
|
federal_page.form["organization_federal-federal_type"] = "Executive"
|
||||||
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
federal_result = federal_page.form.submit()
|
||||||
|
# the post request should return a redirect to the contact
|
||||||
|
# question
|
||||||
|
self.assertEquals(federal_result.status_code, 302)
|
||||||
|
self.assertEquals(federal_result["Location"], "/register/organization_contact/")
|
||||||
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
contact_page = federal_result.follow()
|
||||||
|
self.assertContains(contact_page, "Top level federal agency")
|
||||||
|
|
||||||
def test_application_form_conditional_elections(self):
|
def test_application_form_conditional_elections(self):
|
||||||
"""Election question is shown for other organizations."""
|
"""Election question is shown for other organizations."""
|
||||||
type_page = self.app.get(reverse("application")).follow()
|
type_page = self.app.get(reverse("application")).follow()
|
||||||
|
@ -358,7 +371,7 @@ class FormTests(TestWithUser, WebTest):
|
||||||
self.assertNotContains(type_page, TITLES["organization_federal"])
|
self.assertNotContains(type_page, TITLES["organization_federal"])
|
||||||
self.assertNotContains(type_page, TITLES["organization_election"])
|
self.assertNotContains(type_page, TITLES["organization_election"])
|
||||||
type_form = type_page.form
|
type_form = type_page.form
|
||||||
type_form["organization_type-organization_type"] = "County"
|
type_form["organization_type-organization_type"] = "county"
|
||||||
|
|
||||||
# set the session ID before .submit()
|
# set the session ID before .submit()
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue