Merge branch 'main' into rjm/3190-heading-refactor

This commit is contained in:
Rachid Mrad 2025-01-24 14:51:47 -05:00 committed by GitHub
commit e238cc29fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 6 deletions

View file

@ -462,6 +462,7 @@ class CurrentSitesForm(RegistrarForm):
error_messages={ error_messages={
"invalid": ("Enter your organization's current website in the required format, like example.com.") "invalid": ("Enter your organization's current website in the required format, like example.com.")
}, },
widget=forms.URLInput(attrs={"aria-labelledby": "id_current_sites_header id_current_sites_body"}),
) )

View file

@ -15,9 +15,11 @@ class DomainHelper:
# a domain name is alphanumeric or hyphen, up to 63 characters, doesn't # a domain name is alphanumeric or hyphen, up to 63 characters, doesn't
# begin or end with a hyphen, followed by a TLD of 2-6 alphabetic characters # begin or end with a hyphen, followed by a TLD of 2-6 alphabetic characters
DOMAIN_REGEX = re.compile(r"^(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.[A-Za-z]{2,6}$") DOMAIN_REGEX = re.compile(r"^(?!-)[A-Za-z0-9-]{1,200}(?<!-)\.[A-Za-z]{2,6}$")
# a domain can be no longer than 253 characters in total # a domain can be no longer than 253 characters in total
# NOTE: the domain name is limited by the DOMAIN_REGEX above
# to 200 characters (not including the .gov at the end)
MAX_LENGTH = 253 MAX_LENGTH = 253
@classmethod @classmethod

View file

@ -3,8 +3,8 @@
{% block form_instructions %} {% block form_instructions %}
<p>We can better evaluate your request if we know about domains youre already using.</p> <p>We can better evaluate your request if we know about domains youre already using.</p>
<h2>What are the current websites for your organization?</h2> <h2 id="id_current_sites_header">What are the current websites for your organization?</h2>
<p>Enter your organizations current public websites. If you already have a .gov domain, include that in your list. This question is optional.</p> <p id="id_current_sites_body">Enter your organizations current public websites. If you already have a .gov domain, include that in your list. This question is optional.</p>
{% endblock %} {% endblock %}
{% block form_required_fields_help_text %} {% block form_required_fields_help_text %}

View file

@ -44,7 +44,7 @@
<p id="domain_instructions" class="margin-top-05">After you enter your domain, well make sure its available and that it meets some of our naming requirements. If your domain passes these initial checks, well verify that it meets all our requirements after you complete the rest of this form.</p> <p id="domain_instructions" class="margin-top-05">After you enter your domain, well make sure its available and that it meets some of our naming requirements. If your domain passes these initial checks, well verify that it meets all our requirements after you complete the rest of this form.</p>
{% with attr_aria_describedby="domain_instructions domain_instructions2" %} {% with attr_aria_labelledby="domain_instructions domain_instructions2" attr_aria_describedby="id_dotgov_domain-requested_domain--toast" %}
{# attr_validate / validate="domain" invokes code in getgov.min.js #} {# attr_validate / validate="domain" invokes code in getgov.min.js #}
{% with append_gov=True attr_validate="domain" add_label_class="usa-sr-only" %} {% with append_gov=True attr_validate="domain" add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.requested_domain %} {% input_with_errors forms.0.requested_domain %}
@ -67,12 +67,14 @@
<p id="alt_domain_instructions" class="margin-top-05">Are there other domains youd like if we cant give <p id="alt_domain_instructions" class="margin-top-05">Are there other domains youd like if we cant give
you your first choice?</p> you your first choice?</p>
{% with attr_aria_describedby="alt_domain_instructions" %} {% with attr_aria_labelledby="alt_domain_instructions" %}
{# Will probably want to remove blank-ok and do related cleanup when we implement delete #} {# Will probably want to remove blank-ok and do related cleanup when we implement delete #}
{% with attr_validate="domain" append_gov=True add_label_class="usa-sr-only" add_class="blank-ok alternate-domain-input" %} {% with attr_validate="domain" append_gov=True add_label_class="usa-sr-only" add_class="blank-ok alternate-domain-input" %}
{% for form in forms.1 %} {% for form in forms.1 %}
<div class="repeatable-form"> <div class="repeatable-form">
{% input_with_errors form.alternative_domain %} {% with attr_aria_describedby=form.alternative_domain.auto_id|stringformat:"s"|add:"--toast" %}
{% input_with_errors form.alternative_domain %}
{% endwith %}
</div> </div>
{% endfor %} {% endfor %}
{% endwith %} {% endwith %}