diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py index 4e7182843..91fe7ba05 100644 --- a/src/registrar/forms/domain_request_wizard.py +++ b/src/registrar/forms/domain_request_wizard.py @@ -607,38 +607,25 @@ class DotGovDomainForm(RegistrarForm): }, ) +class PurposeDetailsForm(BaseDeletableRegistrarForm): -class ExecutiveNamingRequirementsYesNoForm(BaseYesNoForm, BaseDeletableRegistrarForm): - """ - Form for verifying if the domain request meets the Federal Executive Branch domain naming requirements. - If the "no" option is selected, details must be provided via the separate details form. - """ + field_name = "purpose" - field_name = "feb_naming_requirements" - - @property - def form_is_checked(self): - """ - Determines the initial checked state of the form based on the domain_request's attributes. - """ - return self.domain_request.feb_naming_requirements - - -class ExecutiveNamingRequirementsDetailsForm(BaseDeletableRegistrarForm): - # Text area for additional details; rendered conditionally when "no" is selected. - feb_naming_requirements_details = forms.CharField( - widget=forms.Textarea(attrs={"maxlength": "2000"}), - max_length=2000, - required=True, - error_messages={"required": ("This field is required.")}, + purpose = forms.CharField( + label="Purpose", + widget=forms.Textarea( + attrs={ + "aria-label": "What is the purpose of your requested domain? Describe how you’ll use your .gov domain. \ + Will it be used for a website, email, or something else?" + } + ), validators=[ MaxLengthValidator( 2000, message="Response must be less than 2000 characters.", ) ], - label="", - help_text="Maximum 2000 characters allowed.", + error_messages={"required": "Describe how you’ll use the .gov domain you’re requesting."}, ) diff --git a/src/registrar/forms/domainrequestwizard/purpose.py b/src/registrar/forms/feb.py similarity index 75% rename from src/registrar/forms/domainrequestwizard/purpose.py rename to src/registrar/forms/feb.py index 43dd62290..44fd417c2 100644 --- a/src/registrar/forms/domainrequestwizard/purpose.py +++ b/src/registrar/forms/feb.py @@ -3,6 +3,40 @@ from django.core.validators import MaxLengthValidator from registrar.forms.utility.wizard_form_helper import BaseDeletableRegistrarForm, BaseYesNoForm +class ExecutiveNamingRequirementsYesNoForm(BaseYesNoForm, BaseDeletableRegistrarForm): + """ + Form for verifying if the domain request meets the Federal Executive Branch domain naming requirements. + If the "no" option is selected, details must be provided via the separate details form. + """ + + field_name = "feb_naming_requirements" + + @property + def form_is_checked(self): + """ + Determines the initial checked state of the form based on the domain_request's attributes. + """ + return self.domain_request.feb_naming_requirements + + +class ExecutiveNamingRequirementsDetailsForm(BaseDeletableRegistrarForm): + # Text area for additional details; rendered conditionally when "no" is selected. + feb_naming_requirements_details = forms.CharField( + widget=forms.Textarea(attrs={"maxlength": "2000"}), + max_length=2000, + required=True, + error_messages={"required": ("This field is required.")}, + validators=[ + MaxLengthValidator( + 2000, + message="Response must be less than 2000 characters.", + ) + ], + label="", + help_text="Maximum 2000 characters allowed.", + ) + + class FEBPurposeOptionsForm(BaseDeletableRegistrarForm): field_name = "feb_purpose_choice" @@ -24,28 +58,6 @@ class FEBPurposeOptionsForm(BaseDeletableRegistrarForm): ) -class PurposeDetailsForm(BaseDeletableRegistrarForm): - - field_name = "purpose" - - purpose = forms.CharField( - label="Purpose", - widget=forms.Textarea( - attrs={ - "aria-label": "What is the purpose of your requested domain? Describe how you’ll use your .gov domain. \ - Will it be used for a website, email, or something else?" - } - ), - validators=[ - MaxLengthValidator( - 2000, - message="Response must be less than 2000 characters.", - ) - ], - error_messages={"required": "Describe how you’ll use the .gov domain you’re requesting."}, - ) - - class FEBTimeFrameYesNoForm(BaseDeletableRegistrarForm, BaseYesNoForm): """ Form for determining whether the domain request comes with a target timeframe for launch. diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 33de99c39..b659b0812 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -15,7 +15,7 @@ from registrar.decorators import ( grant_access, ) from registrar.forms import domain_request_wizard as forms -from registrar.forms.domainrequestwizard import purpose +from registrar.forms import feb from registrar.forms.utility.wizard_form_helper import request_step_list from registrar.models import DomainRequest from registrar.models.contact import Contact @@ -707,12 +707,12 @@ class Purpose(DomainRequestWizard): template_name = "domain_request_purpose.html" forms = [ - purpose.FEBPurposeOptionsForm, - purpose.PurposeDetailsForm, - purpose.FEBTimeFrameYesNoForm, - purpose.FEBTimeFrameDetailsForm, - purpose.FEBInteragencyInitiativeYesNoForm, - purpose.FEBInteragencyInitiativeDetailsForm, + feb.FEBPurposeOptionsForm, + forms.PurposeDetailsForm, + feb.FEBTimeFrameYesNoForm, + feb.FEBTimeFrameDetailsForm, + feb.FEBInteragencyInitiativeYesNoForm, + feb.FEBInteragencyInitiativeDetailsForm, ] def get_context_data(self):