mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
Merge branch 'cb/3212-subissues' of github.com:cisagov/manage.get.gov into cb/3212-subissues
This commit is contained in:
commit
ceeb537a07
3 changed files with 12 additions and 9 deletions
|
@ -234,9 +234,12 @@ class BaseYesNoForm(RegistrarForm):
|
|||
# For instance, this could be "has_other_contacts"
|
||||
field_name: str
|
||||
|
||||
# This field can be overriden to show a custom error
|
||||
# message.
|
||||
required_error_message = "This question is required."
|
||||
|
||||
# Default form choice mapping. Default is suitable for most cases.
|
||||
# Override for more complex scenarios.
|
||||
form_choices = ((True, "Yes"), (False, "No"))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
@ -11,14 +11,12 @@
|
|||
<fieldset class="usa-fieldset">
|
||||
{{forms.0.management_form}}
|
||||
{{forms.1.management_form}}
|
||||
<legend>
|
||||
<h2 class="margin-top-0 margin-bottom-0">Are you working with someone in the Executive Office of the President (EOP) on this request?</h2>
|
||||
</legend>
|
||||
<p class="margin-bottom-2 margin-top-2">Working with the EOP is not required to request a .gov domain.</p>
|
||||
<h2 id="working-with-eop--question" class="margin-top-0 margin-bottom-0">Are you working with someone in the Executive Office of the President (EOP) on this request?</h2>
|
||||
<p id="working-with-eop--requirement" class="margin-bottom-2 margin-top-2">Working with the EOP is not required to request a .gov domain.</p>
|
||||
<p class="margin-bottom-0 margin-top-1">
|
||||
<em>Select one. <abbr class="usa-hint usa-hint--required" title="required">*</abbr></em>
|
||||
</p>
|
||||
{% with add_class="usa-radio__input--tile" add_legend_class="usa-sr-only" %}
|
||||
{% with add_class="usa-radio__input--tile" add_legend_class="usa-sr-only" add_aria_describedby="working-with-eop--requirement" add_legend_heading="Are you working with someone in the Executive Office of the President (EOP) on this request?" %}
|
||||
{% input_with_errors forms.0.working_with_eop %}
|
||||
{% endwith %}
|
||||
|
||||
|
@ -36,13 +34,11 @@
|
|||
<fieldset class="usa-fieldset" aria-labelledby="anything-else-question">
|
||||
{{forms.2.management_form}}
|
||||
{{forms.3.management_form}}
|
||||
<legend>
|
||||
<h2 id="anything-else-question">Is there anything else you'd like us to know about your domain request?</h2>
|
||||
</legend>
|
||||
<h2 id="anything-else-question">Is there anything else you'd like us to know about your domain request?</h2>
|
||||
<p class="margin-bottom-0 margin-top-1">
|
||||
<em>Select one. <abbr class="usa-hint usa-hint--required" title="required">*</abbr></em>
|
||||
</p>
|
||||
{% with add_class="usa-radio__input--tile" add_legend_class="usa-sr-only" %}
|
||||
{% with add_class="usa-radio__input--tile" add_legend_class="usa-sr-only" add_legend_heading="Is there anything else you'd like us to know about your domain request?"%}
|
||||
{% input_with_errors forms.2.has_anything_else_text %}
|
||||
{% endwith %}
|
||||
|
||||
|
|
|
@ -23,8 +23,10 @@ def input_with_errors(context, field=None): # noqa: C901
|
|||
add_required_class: like `add_class` but only if field is required
|
||||
add_label_class: append to input element's label's `class` attribute
|
||||
add_legend_class: append to input element's legend's `class` attribute
|
||||
add_legend_heading: sets the text for the legend associated with this element
|
||||
add_group_class: append to input element's surrounding tag's `class` attribute
|
||||
add_aria_label: append to input element's `aria_label` attribute
|
||||
add_aria_describedby: appends to input element's `aria-describedby` attribute
|
||||
attr_* - adds or replaces any single html attribute for the input
|
||||
add_error_attr_* - like `attr_*` but only if field.errors is not empty
|
||||
toggleable_input: shows a simple edit button, and adds display-none to the input field.
|
||||
|
@ -106,6 +108,8 @@ def input_with_errors(context, field=None): # noqa: C901
|
|||
|
||||
elif key == "add_aria_label":
|
||||
aria_labels.append(value)
|
||||
elif key == "add_aria_describedby":
|
||||
described_by.append(value)
|
||||
|
||||
elif key == "sublabel_text":
|
||||
sublabel_text.append(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue