diff --git a/src/registrar/templates/application_authorizing_official.html b/src/registrar/templates/application_authorizing_official.html index 79badd433..b7fde0fb9 100644 --- a/src/registrar/templates/application_authorizing_official.html +++ b/src/registrar/templates/application_authorizing_official.html @@ -12,29 +12,7 @@

- {% if is_federal %} - {% if federal_type == 'executive' %} - {% include "includes/ao_example__exec.html" %} - {% elif federal_type == 'judicial' %} - {% include "includes/ao_example__judicial.html" %} - {% elif federal_type == 'legislative' %} - {% include "includes/ao_example__legislative.html" %} - {% endif %} - {% elif organization_type == 'city' %} - {% include "includes/ao_example__city.html" %} - {% elif organization_type == 'county' %} - {% include "includes/ao_example__county.html" %} - {% elif organization_type == 'interstate' %} - {% include "includes/ao_example__interstate.html" %} - {% elif organization_type == 'school_district' %} - {% include "includes/ao_example__school-district.html" %} - {% elif organization_type == 'special_district' %} - {% include "includes/ao_example__special-district.html" %} - {% elif organization_type == 'state_or_territory' %} - {% include "includes/ao_example__state-territory.html" %} - {% elif organization_type == 'tribal' %} - {% include "includes/ao_example__tribal.html" %} - {% endif %} + {% include "includes/ao_example.html" %}

We’ll contact your authorizing official to let them know that you made this request and to double check that they approve it.

diff --git a/src/registrar/templates/application_dotgov_domain.html b/src/registrar/templates/application_dotgov_domain.html index 607bee459..0c80a8692 100644 --- a/src/registrar/templates/application_dotgov_domain.html +++ b/src/registrar/templates/application_dotgov_domain.html @@ -17,8 +17,8 @@

We’ll try to give you the domain you want. We first need to make sure your request meets our requirements. We’ll work with you to find the best domain for your organization.

Here are a few domain examples for your type of organization.

-
- {% include "includes/domain_example__city.html" %} +
+ {% include "includes/domain_example.html" %}
diff --git a/src/registrar/templates/includes/ao_example.html b/src/registrar/templates/includes/ao_example.html new file mode 100644 index 000000000..4d6b5a301 --- /dev/null +++ b/src/registrar/templates/includes/ao_example.html @@ -0,0 +1,49 @@ +{% if is_federal %} + {% if federal_type == 'executive' %} +

Domain requests from executive branch agencies must be authorized by Chief Information Officers or agency heads.

+

Domain requests from executive branch agencies are subject to guidance issued by the U.S. Office of Management and Budget.

+ + {% elif federal_type == 'judicial' %} +

Domain requests from the U.S. Supreme Court must be authorized by the director of information technology for the U.S. Supreme Court.

+

Domain requests from other judicial branch agencies must be authorized by the director or Chief Information Officer of the Administrative Office (AO) of the United States Courts. +

+ + {% elif federal_type == 'legislative' %} +

U.S. Senate

+

Domain requests from the U.S. Senate must come from the Senate Sergeant at Arms.

+ +

U.S. House of Representatives

+

Domain requests from the U.S. House of Representatives must come from the House Chief Administrative Officer. + +

Other legislative branch agencies

+

Domain requests from legislative branch agencies must come from the agency’s head or Chief Information Officer.

+

Domain requests from legislative commissions must come from the head of the commission, or the head or Chief Information Officer of the parent agency, if there is one. +

+ + {% endif %} + +{% elif organization_type == 'city' %} +

Domain requests from cities must be authorized by the mayor or the equivalent highest elected official.

+ +{% elif organization_type == 'county' %} +

Domain requests from counties must be authorized by the chair of the county commission or the equivalent highest elected official.

+ +{% elif organization_type == 'interstate' %} +

Domain requests from interstate organizations must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or one of the state’s governors or Chief Information Officers.

+ +{% elif organization_type == 'school_district' %} +

Domain requests from school district governments must be authorized by the highest-ranking executive (the chair of a school district’s board or a superintendent).

+ +{% elif organization_type == 'special_district' %} +

Domain requests from special districts must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or state Chief Information Officers for state-based organizations.

+ +{% elif organization_type == 'state_or_territory' %} +

States and territories: executive branch

+

Domain requests from states and territories must be authorized by the governor or the state Chief Information Officer.

+

States and territories: judicial and legislative branches

+

Domain requests from state legislatures and courts must be authorized by an agency’s Chief Information Officer or highest-ranking executive.

+ +{% elif organization_type == 'tribal' %} +

Domain requests from federally-recognized tribal governments must be authorized by the leader of the tribe, as recognized by the as noted by the Bureau of Indian Affairs.

+ +{% endif %} diff --git a/src/registrar/templates/includes/ao_example__city.html b/src/registrar/templates/includes/ao_example__city.html deleted file mode 100644 index 6da683e23..000000000 --- a/src/registrar/templates/includes/ao_example__city.html +++ /dev/null @@ -1 +0,0 @@ -

Domain requests from cities must be authorized by the mayor or the equivalent highest elected official.

diff --git a/src/registrar/templates/includes/ao_example__county.html b/src/registrar/templates/includes/ao_example__county.html deleted file mode 100644 index 8f37a3419..000000000 --- a/src/registrar/templates/includes/ao_example__county.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from counties must be authorized by the chair of the county commission or the equivalent highest elected official.

- diff --git a/src/registrar/templates/includes/ao_example__exec.html b/src/registrar/templates/includes/ao_example__exec.html deleted file mode 100644 index 8be0843c8..000000000 --- a/src/registrar/templates/includes/ao_example__exec.html +++ /dev/null @@ -1,3 +0,0 @@ -

Domain requests from executive branch agencies must be authorized by Chief Information Officers or agency heads.

-

Domain requests from executive branch agencies are subject to guidance issued by the U.S. Office of Management and Budget.

- diff --git a/src/registrar/templates/includes/ao_example__interstate.html b/src/registrar/templates/includes/ao_example__interstate.html deleted file mode 100644 index f3c05e62a..000000000 --- a/src/registrar/templates/includes/ao_example__interstate.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from interstate organizations must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or one of the state’s governors or Chief Information Officers.

- diff --git a/src/registrar/templates/includes/ao_example__judicial.html b/src/registrar/templates/includes/ao_example__judicial.html deleted file mode 100644 index 773f13cb6..000000000 --- a/src/registrar/templates/includes/ao_example__judicial.html +++ /dev/null @@ -1,4 +0,0 @@ -

Domain requests from the U.S. Supreme Court must be authorized by the director of information technology for the U.S. Supreme Court.

-

Domain requests from other judicial branch agencies must be authorized by the director or Chief Information Officer of the Administrative Office (AO) of the United States Courts. -

- diff --git a/src/registrar/templates/includes/ao_example__legislative.html b/src/registrar/templates/includes/ao_example__legislative.html deleted file mode 100644 index f0398c101..000000000 --- a/src/registrar/templates/includes/ao_example__legislative.html +++ /dev/null @@ -1,10 +0,0 @@ -

U.S. Senate

-

Domain requests from the U.S. Senate must come from the Senate Sergeant at Arms.

- -

U.S. House of Representatives

-

Domain requests from the U.S. House of Representatives must come from the House Chief Administrative Officer. - -

Other legislative branch agencies

-

Domain requests from legislative branch agencies must come from the agency’s head or Chief Information Officer.

-

Domain requests from legislative commissions must come from the head of the commission, or the head or Chief Information Officer of the parent agency, if there is one. -

diff --git a/src/registrar/templates/includes/ao_example__school-district.html b/src/registrar/templates/includes/ao_example__school-district.html deleted file mode 100644 index 142e433af..000000000 --- a/src/registrar/templates/includes/ao_example__school-district.html +++ /dev/null @@ -1,3 +0,0 @@ -

Domain requests from school district governments must be authorized by the highest-ranking executive (the chair of a school district’s board or a superintendent). -

- diff --git a/src/registrar/templates/includes/ao_example__special-district.html b/src/registrar/templates/includes/ao_example__special-district.html deleted file mode 100644 index eb4b48d9c..000000000 --- a/src/registrar/templates/includes/ao_example__special-district.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from special districts must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or state Chief Information Officers for state-based organizations.

- diff --git a/src/registrar/templates/includes/ao_example__state-territory.html b/src/registrar/templates/includes/ao_example__state-territory.html deleted file mode 100644 index f08a59f5f..000000000 --- a/src/registrar/templates/includes/ao_example__state-territory.html +++ /dev/null @@ -1,4 +0,0 @@ -

States and territories: executive branch

-

Domain requests from states and territories must be authorized by the governor or the state Chief Information Officer.

-

States and territories: judicial and legislative branches

-

Domain requests from state legislatures and courts must be authorized by an agency’s Chief Information Officer or highest-ranking executive.

diff --git a/src/registrar/templates/includes/ao_example__tribal.html b/src/registrar/templates/includes/ao_example__tribal.html deleted file mode 100644 index 8184d4822..000000000 --- a/src/registrar/templates/includes/ao_example__tribal.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from federally-recognized tribal governments must be authorized by tribal chiefs as noted by the Bureau of Indian Affairs.

- diff --git a/src/registrar/templates/includes/domain_example.html b/src/registrar/templates/includes/domain_example.html new file mode 100644 index 000000000..ed9ee7504 --- /dev/null +++ b/src/registrar/templates/includes/domain_example.html @@ -0,0 +1,94 @@ +{% if is_federal %} + {% if federal_type == 'executive' %} +

Examples:

+ + + {% elif federal_type == 'judicial' %} +

Examples:

+

+

+

+ + {% elif federal_type == 'legislative' %} +

Examples:

+ +{% endif %} + +{% elif organization_type == 'interstate' %} +

Examples:

+ + +{% elif organization_type == 'state_or_territory' %} +

State .gov domains must include the two-letter state abbreviation or clearly spell out the state name.

+

Examples:

+ + +{% elif organization_type == 'tribal' %} +

Tribal domains may include the suffix -nsn, for native sovereign nation.

+

Examples:

+ + +{% elif organization_type == 'county' %} +

Most county .gov domains must include the two-letter state abbreviation or the full state name. County names that aren’t shared by any other city, county, parish, town, borough, village or equivalent in the U.S., at the time a domain is granted, can be requested without referring to the state. Counties can include “county” in their domain to distinguish it from other places with similar names. We use the Census Bureau’s National Places Gazetteer Files to determine if county names are unique.

+

Examples:

+ + +{% elif organization_type == 'city' %} +

Most city domains must include the two-letter state abbreviation or clearly spell out the state name. Using phrases like “City of” or “Town of” is optional.

+

Examples:

+ +

Some cities don’t have to refer to their state. +

+

+ +{% elif organization_type == 'special_district' %} +

Domain names must represent your organization or institutional name, not solely the services you provide. It also needs to include your two-letter state abbreviation or clearly spell out the state name.

+

Examples:

+ + +{% elif organization_type == 'school_district' %} +

Domain names must represent your organization or institutional name.

+

Example: mckinneyISDTX.gov

+ + +{%endif %} + diff --git a/src/registrar/templates/includes/domain_example__city.html b/src/registrar/templates/includes/domain_example__city.html deleted file mode 100644 index 438ea005d..000000000 --- a/src/registrar/templates/includes/domain_example__city.html +++ /dev/null @@ -1,15 +0,0 @@ -

Most city domains must include the two-letter state abbreviation or clearly spell out the state name. Using phrases like “City of” or “Town of” is optional.

-

Examples: -

-

-

Some cities don’t have to refer to their state. -

-

diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index d305f55fa..2ee79f654 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -872,15 +872,104 @@ class DomainApplicationTests(TestWithUser, WebTest): ao_page = election_page.click(str(self.TITLES["authorizing_official"]), index=0) self.assertContains(ao_page, "Domain requests from cities") - def test_application_formsets(self): - """Users are able to add more than one of some fields.""" - current_sites_page = self.app.get(reverse("application:current_sites")) + def test_application_dotgov_domain_dynamic_text(self): + type_page = self.app.get(reverse("application:")).follow() # django-webtest does not handle cookie-based sessions well because it keeps # resetting the session key on each new request, thus destroying the concept # of a "session". We are going to do it manually, saving the session ID here # and then setting the cookie on each request. session_id = self.app.cookies[settings.SESSION_COOKIE_NAME] + # ---- TYPE PAGE ---- + type_form = type_page.form + type_form["organization_type-organization_type"] = "federal" + # test next button + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + type_result = type_page.form.submit() + + # ---- FEDERAL BRANCH PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + federal_page = type_result.follow() + federal_form = federal_page.form + federal_form["organization_federal-federal_type"] = "executive" + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + federal_result = federal_form.submit() + + # ---- ORG CONTACT PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + org_contact_page = federal_result.follow() + org_contact_form = org_contact_page.form + # federal agency so we have to fill in federal_agency + org_contact_form[ + "organization_contact-federal_agency" + ] = "General Services Administration" + org_contact_form["organization_contact-organization_name"] = "Testorg" + org_contact_form["organization_contact-address_line1"] = "address 1" + org_contact_form["organization_contact-address_line2"] = "address 2" + org_contact_form["organization_contact-city"] = "NYC" + org_contact_form["organization_contact-state_territory"] = "NY" + org_contact_form["organization_contact-zipcode"] = "10002" + org_contact_form["organization_contact-urbanization"] = "URB Royal Oaks" + + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + org_contact_result = org_contact_form.submit() + + # ---- AO CONTACT PAGE ---- + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_page = org_contact_result.follow() + + # ---- AUTHORIZING OFFICIAL PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_page = org_contact_result.follow() + ao_form = ao_page.form + ao_form["authorizing_official-first_name"] = "Testy ATO" + ao_form["authorizing_official-last_name"] = "Tester ATO" + ao_form["authorizing_official-title"] = "Chief Tester" + ao_form["authorizing_official-email"] = "testy@town.com" + ao_form["authorizing_official-phone"] = "(201) 555 5555" + + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_result = ao_form.submit() + + # ---- CURRENT SITES PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + current_sites_page = ao_result.follow() + current_sites_form = current_sites_page.form + current_sites_form["current_sites-0-website"] = "www.city.com" + + # test saving the page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + current_sites_result = current_sites_form.submit() + + # ---- DOTGOV DOMAIN PAGE ---- + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page = current_sites_result.follow() + + self.assertContains(dotgov_page, "medicare.gov") + + # Go back to organization type page and change type + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page.click(str(self.TITLES["organization_type"]), index=0) + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + type_form["organization_type-organization_type"] = "city" + type_result = type_form.submit() + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + election_page = type_result.follow() + + # Go back to dotgov domain page to test the dynamic text changed + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page = election_page.click(str(self.TITLES["dotgov_domain"]), index=0) + self.assertContains(dotgov_page, "BlufftonIndiana.gov") + self.assertNotContains(dotgov_page, "medicare.gov") + + def test_application_formsets(self): + """Users are able to add more than one of some fields.""" + current_sites_page = self.app.get(reverse("application:current_sites")) + session_id = self.app.cookies[settings.SESSION_COOKIE_NAME] # fill in the form field current_sites_form = current_sites_page.form self.assertIn("current_sites-0-website", current_sites_form.fields) diff --git a/src/registrar/views/application.py b/src/registrar/views/application.py index a0d8d05e1..3345d091b 100644 --- a/src/registrar/views/application.py +++ b/src/registrar/views/application.py @@ -275,6 +275,7 @@ class ApplicationWizard(LoginRequiredMixin, TemplateView): "steps": self.steps, # Add information about which steps should be unlocked "visited": self.storage.get("step_history", []), + "is_federal": self.application.is_federal(), } def get_step_list(self) -> list: @@ -387,11 +388,6 @@ class OrganizationContact(ApplicationWizard): template_name = "application_org_contact.html" forms = [forms.OrganizationContactForm] - def get_context_data(self): - context = super().get_context_data() - context["is_federal"] = self.application.is_federal() - return context - class TypeOfWork(ApplicationWizard): template_name = "application_type_of_work.html" @@ -404,7 +400,6 @@ class AuthorizingOfficial(ApplicationWizard): def get_context_data(self): context = super().get_context_data() - context["is_federal"] = self.application.is_federal() context["organization_type"] = self.application.organization_type context["federal_type"] = self.application.federal_type return context @@ -419,6 +414,12 @@ class DotgovDomain(ApplicationWizard): template_name = "application_dotgov_domain.html" forms = [forms.DotGovDomainForm, forms.AlternativeDomainFormSet] + def get_context_data(self): + context = super().get_context_data() + context["organization_type"] = self.application.organization_type + context["federal_type"] = self.application.federal_type + return context + class Purpose(ApplicationWizard): template_name = "application_purpose.html"