From 014c38791092e95e008798c64f4a8898e67fb5c4 Mon Sep 17 00:00:00 2001
From: Erin Song <121973038+erinysong@users.noreply.github.com>
Date: Thu, 21 Nov 2024 11:05:51 -0800
Subject: [PATCH 1/5] Add aria label to purpose form
---
src/registrar/forms/domain_request_wizard.py | 4 +++-
src/registrar/templates/domain_request_purpose.html | 2 +-
src/registrar/templates/includes/input_with_errors.html | 2 ++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py
index bfbc22124..5e156cc73 100644
--- a/src/registrar/forms/domain_request_wizard.py
+++ b/src/registrar/forms/domain_request_wizard.py
@@ -524,7 +524,9 @@ def clean_requested_domain(self):
class PurposeForm(RegistrarForm):
purpose = forms.CharField(
label="Purpose",
- widget=forms.Textarea(),
+ 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? You can enter up to 2000 characters.'
+ }),
validators=[
MaxLengthValidator(
2000,
diff --git a/src/registrar/templates/domain_request_purpose.html b/src/registrar/templates/domain_request_purpose.html
index bfd9beb15..8c6d417cd 100644
--- a/src/registrar/templates/domain_request_purpose.html
+++ b/src/registrar/templates/domain_request_purpose.html
@@ -13,7 +13,7 @@
What is the purpose of your requested domain?
{% endblock %}
{% block form_fields %}
- {% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
+ {% with add_aria_label="test" attr_maxlength=2000 add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.purpose %}
{% endwith %}
{% endblock %}
diff --git a/src/registrar/templates/includes/input_with_errors.html b/src/registrar/templates/includes/input_with_errors.html
index d1e53968e..b3f5e520e 100644
--- a/src/registrar/templates/includes/input_with_errors.html
+++ b/src/registrar/templates/includes/input_with_errors.html
@@ -69,6 +69,8 @@
{# this is the input field, itself #}
{% include widget.template_name %}
+
+
{% if append_gov %}
.gov
From bb2215bd75c91b773b6a69b3b3e309ce4f850790 Mon Sep 17 00:00:00 2001
From: Erin Song <121973038+erinysong@users.noreply.github.com>
Date: Thu, 21 Nov 2024 11:11:28 -0800
Subject: [PATCH 2/5] Revert unwanted changes
---
src/registrar/templates/domain_request_purpose.html | 2 +-
src/registrar/templates/includes/input_with_errors.html | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/registrar/templates/domain_request_purpose.html b/src/registrar/templates/domain_request_purpose.html
index 8c6d417cd..bfd9beb15 100644
--- a/src/registrar/templates/domain_request_purpose.html
+++ b/src/registrar/templates/domain_request_purpose.html
@@ -13,7 +13,7 @@ What is the purpose of your requested domain?
{% endblock %}
{% block form_fields %}
- {% with add_aria_label="test" attr_maxlength=2000 add_label_class="usa-sr-only" %}
+ {% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.purpose %}
{% endwith %}
{% endblock %}
diff --git a/src/registrar/templates/includes/input_with_errors.html b/src/registrar/templates/includes/input_with_errors.html
index b3f5e520e..d1e53968e 100644
--- a/src/registrar/templates/includes/input_with_errors.html
+++ b/src/registrar/templates/includes/input_with_errors.html
@@ -69,8 +69,6 @@
{# this is the input field, itself #}
{% include widget.template_name %}
-
-
{% if append_gov %}
.gov
From 1b034ba04b8a67598dc994822c7f82e7852552c3 Mon Sep 17 00:00:00 2001
From: Erin Song <121973038+erinysong@users.noreply.github.com>
Date: Thu, 21 Nov 2024 11:27:43 -0800
Subject: [PATCH 3/5] Run linter
---
src/registrar/forms/domain_request_wizard.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py
index 5e156cc73..28044b0ec 100644
--- a/src/registrar/forms/domain_request_wizard.py
+++ b/src/registrar/forms/domain_request_wizard.py
@@ -524,9 +524,11 @@ def clean_requested_domain(self):
class PurposeForm(RegistrarForm):
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? You can enter up to 2000 characters.'
- }),
+ 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? You can enter up to 2000 characters."
+ }
+ ),
validators=[
MaxLengthValidator(
2000,
From f79b4e58c7e3be12957c28bf5cee392939b03f7c Mon Sep 17 00:00:00 2001
From: Erin Song <121973038+erinysong@users.noreply.github.com>
Date: Thu, 21 Nov 2024 11:34:27 -0800
Subject: [PATCH 4/5] Split line length of long strong
---
src/registrar/forms/domain_request_wizard.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py
index 28044b0ec..080694f28 100644
--- a/src/registrar/forms/domain_request_wizard.py
+++ b/src/registrar/forms/domain_request_wizard.py
@@ -526,7 +526,8 @@ class PurposeForm(RegistrarForm):
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? You can enter up to 2000 characters."
+ "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? You can enter up to 2000 characters."
}
),
validators=[
From d6789ba2caa76a612dc3cc339bd3f72d37e061e9 Mon Sep 17 00:00:00 2001
From: Erin Song <121973038+erinysong@users.noreply.github.com>
Date: Thu, 21 Nov 2024 11:39:13 -0800
Subject: [PATCH 5/5] Fix linter errors
---
src/registrar/forms/domain_request_wizard.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py
index 080694f28..c7f5571af 100644
--- a/src/registrar/forms/domain_request_wizard.py
+++ b/src/registrar/forms/domain_request_wizard.py
@@ -526,8 +526,8 @@ class PurposeForm(RegistrarForm):
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? You can enter up to 2000 characters."
+ "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? You can enter up to 2000 characters."
}
),
validators=[