mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-12 07:24:48 +02:00
Review feedback: more required instructions
This commit is contained in:
parent
29d8f4b23d
commit
beb9a298d4
5 changed files with 39 additions and 8 deletions
|
@ -101,9 +101,10 @@ class OrganizationContactForm(RegistrarForm):
|
|||
federal_agency = forms.ChoiceField(
|
||||
label="Federal agency",
|
||||
# not required because this field won't be filled out unless
|
||||
# it is a federal agency.
|
||||
# it is a federal agency. Use clean to check programatically
|
||||
# if it has been filled in when required.
|
||||
required=False,
|
||||
choices=DomainApplication.AGENCY_CHOICES,
|
||||
choices=[("", "--Select--")] + DomainApplication.AGENCY_CHOICES,
|
||||
label_suffix=REQUIRED_SUFFIX,
|
||||
)
|
||||
organization_name = forms.CharField(
|
||||
|
@ -138,6 +139,18 @@ class OrganizationContactForm(RegistrarForm):
|
|||
label="Urbanization (Puerto Rico only)",
|
||||
)
|
||||
|
||||
def clean_federal_agency(self):
|
||||
"""Require something to be selected when this is a federal agency."""
|
||||
federal_agency = self.cleaned_data.get("federal_agency", None)
|
||||
# need the wizard object to know if this is federal
|
||||
context = self.get_context()
|
||||
print(context)
|
||||
if wizard._is_federal():
|
||||
if not federal_agency:
|
||||
# no answer was selected
|
||||
raise forms.ValidationError("Please select your federal agency.", code="required")
|
||||
return federal_agency
|
||||
|
||||
|
||||
class AuthorizingOfficialForm(RegistrarForm):
|
||||
def to_database(self, obj):
|
||||
|
|
|
@ -21,16 +21,16 @@
|
|||
{% include "includes/domain_example__city.html" %}
|
||||
</div>
|
||||
|
||||
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post">
|
||||
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post" novalidate>
|
||||
<h2> What .gov domain do you want? </h2>
|
||||
<p class="domain_instructions"> After you enter your domain, we’ll make sure it’s available and that it meets some of our naming requirements. If your domain passes these initial checks, we’ll verify that it meets all of our requirements once you complete and submit the rest of this form. </p>
|
||||
|
||||
<p> This question is required. </p>
|
||||
{{ wizard.management_form }}
|
||||
{% csrf_token %}
|
||||
|
||||
{% if wizard.form.requested_domain.errors %}
|
||||
<div class="usa-form-group usa-form-group--error">
|
||||
{{ wizard.form.requested_domain|add_label_class:"usa-label usa-label--error" }}
|
||||
{% for error in wizard.form.requested_domain.errors %}
|
||||
<span class="usa-error-message" id="input-error-message" role="alert">
|
||||
{{ error }}
|
||||
|
@ -43,7 +43,6 @@
|
|||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ wizard.form.requested_domain|add_label_class:"usa-label" }}
|
||||
<div class="display-flex flex-align-center">
|
||||
<span class="padding-top-05 padding-right-2px">www.</span>
|
||||
{{ wizard.form.requested_domain|add_class:"usa-input"|attr:"aria-describedby:domain_instructions" }}
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
{% csrf_token %}
|
||||
<fieldset id="federal_type__fieldset" class="usa-fieldset">
|
||||
<legend>
|
||||
<h2 class="margin-bottom-5">Which federal branch is your organization in?</h2>
|
||||
<h2>Which federal branch is your organization in?</h2>
|
||||
<p class="margin-bottom-5">This question is required.</p>
|
||||
</legend>
|
||||
{% radio_buttons_by_value wizard.form.federal_type as choices %}
|
||||
{% for choice in choices.values %}
|
||||
|
|
|
@ -8,14 +8,30 @@
|
|||
|
||||
<p id="instructions">Describe the reason for your domain request. Explain how you plan to use this domain. Will you use it for a website and/or email? Are you moving your website from another top-level domain (like .com or .org)? Read about <a href="#">activities that are prohibited on .gov domains.</a></p>
|
||||
|
||||
<p> This question is required. </p>
|
||||
|
||||
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post" novalidate>
|
||||
<div class="usa-form-group">
|
||||
{{ wizard.management_form }}
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="usa-character-count">
|
||||
{{ wizard.form.purpose|add_label_class:"usa-label usa-sr-only" }}
|
||||
{{ wizard.form.purpose|add_class:"usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=500" }}
|
||||
{% with field=wizard.form.purpose %}
|
||||
{% if field.errors %}
|
||||
<div class="usa-form-group usa-form-group--error">
|
||||
{{ field|add_label_class:"usa-label usa-label--error usa-sr-only" }}
|
||||
{% for error in field.errors %}
|
||||
<span class="usa-error-message" id="input-error-message" role="alert">
|
||||
{{ error }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{{ field|add_class:"usa-input--error usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=500"|attr:"aria-invalid:true" }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ field|add_label_class:"usa-label usa-sr-only" }}
|
||||
{{ field|add_class:"usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=500" }}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<span class="usa-character-count__message" id="with-hint-textarea-info with-hint-textarea-hint"> You can enter up to 500 characters </span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -127,6 +127,8 @@
|
|||
|
||||
<h2>Acknowledgement of .gov domain requirements</h2>
|
||||
|
||||
<p>This question is required.</p>
|
||||
|
||||
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post" novalidate>
|
||||
<div class="usa-form-group">
|
||||
{{ wizard.management_form }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue