- {% include 'includes/modal.html' with modal_heading="You are about to submit a domain request for yourcity.gov." modal_description="Once you submit this request, you won’t be able to make further edits until it’s reviewed by our staff. You’ll only be able to withdraw your request." modal_button=modal_button|safe %}
+ {% include 'includes/modal.html' with modal_heading=modal_heading|safe modal_description="Once you submit this request, you won’t be able to make further edits until it’s reviewed by our staff. You’ll only be able to withdraw your request." modal_button=modal_button|safe %}
{% block after_form_content %}{% endblock %}
diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py
index fb875db9a..b5574c8e2 100644
--- a/src/registrar/tests/test_views.py
+++ b/src/registrar/tests/test_views.py
@@ -1088,13 +1088,14 @@ class DomainApplicationTests(TestWithUser, WebTest):
def test_submit_modal(self):
"""When user clicks on submit your domain request, a modal pops up."""
- completed_application()
+ # completed_application(name="cats.gov")
review_page = self.app.get(reverse("application:review"))
# We can't test the modal itself as it relies on JS for init and triggering,
# but we can test for the existence of its trigger:
self.assertContains(review_page, "toggle-submit-domain-request")
# And the existence of the modal's data parked and ready for the js init:
- self.assertContains(review_page, "You are about to submit a domain request")
+ print(review_page)
+ self.assertContains(review_page, "You are about to submit")
class TestWithDomainPermissions(TestWithUser):
diff --git a/src/registrar/views/application.py b/src/registrar/views/application.py
index 3bf12ec63..4e76f55fe 100644
--- a/src/registrar/views/application.py
+++ b/src/registrar/views/application.py
@@ -321,12 +321,19 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
def get_context_data(self):
"""Define context for access on all wizard pages."""
- # Create HTML for the submit button:
# The on-page submit button is just a trigger for the modal;
# the submit button we're adding to context will get passed to
# the modal and is the button that triggers the actual domain
# application submission (via post -> goto_next_step -> done).
modal_button = '"
+ # We'll concatenate the modal header here for passing along to the
+ # modal include. NOTE: We are able to 'fast-forward' a domain application
+ # by tyoing in review in the URL. The submit button still shows, hence
+ # the if/else.
+ if self.application.requested_domain:
+ modal_heading = 'You are about to submit a domain request for ' + str(self.application.requested_domain)
+ else:
+ modal_heading = 'You are about to submit an incomplete request'
return {
"form_titles": self.TITLES,
"steps": self.steps,
@@ -334,6 +341,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
"visited": self.storage.get("step_history", []),
"is_federal": self.application.is_federal(),
"modal_button": modal_button,
+ "modal_heading": modal_heading,
}
def get_step_list(self) -> list: