mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-11 12:09:36 +02:00
Refactor legend heading
This commit is contained in:
parent
6ff3901c91
commit
4671c8967f
6 changed files with 21 additions and 14 deletions
|
@ -149,6 +149,14 @@ footer {
|
||||||
color: color('primary');
|
color: color('primary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.usa-footer {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usa-radio {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
abbr[title] {
|
abbr[title] {
|
||||||
// workaround for underlining abbr element
|
// workaround for underlining abbr element
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|
|
@ -27,9 +27,8 @@ h2 {
|
||||||
.usa-form,
|
.usa-form,
|
||||||
.usa-form fieldset {
|
.usa-form fieldset {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
legend em {
|
.usa-legend {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
class="{% if label_classes %} {{ label_classes }}{% endif %}{% if label_tag == 'legend' %} {{ legend_classes }}{% endif %}"
|
class="{% if label_classes %} {{ label_classes }}{% endif %}{% if label_tag == 'legend' %} {{ legend_classes }}{% endif %}"
|
||||||
{% if not field.use_fieldset %}for="{{ widget.attrs.id }}"{% endif %}
|
{% if not field.use_fieldset %}for="{{ widget.attrs.id }}"{% endif %}
|
||||||
>
|
>
|
||||||
{% if legend_label %}
|
{% if legend_heading %}
|
||||||
<h2 class="{{ legend_classes }}">{{ legend_label }} </h2>
|
<h2 class="{{ legend_classes }}">{{ legend_heading }} </h2>
|
||||||
{% if widget.attrs.id == 'id_additional_details-has_cisa_representative' %}
|
{% if widget.attrs.id == 'id_additional_details-has_cisa_representative' %}
|
||||||
<p>.gov is managed by the Cybersecurity and Infrastructure Security Agency. CISA has <a href="https://www.cisa.gov/about/regions" target="_blank">10 regions</a> that some organizations choose to work with. Regional representatives use titles like protective security advisors, cyber security advisors, or election security advisors.</p>
|
<p>.gov is managed by the Cybersecurity and Infrastructure Security Agency. CISA has <a href="https://www.cisa.gov/about/regions" target="_blank">10 regions</a> that some organizations choose to work with. Regional representatives use titles like protective security advisors, cyber security advisors, or election security advisors.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
|
|
||||||
{% block form_fields %}
|
{% block form_fields %}
|
||||||
|
|
||||||
<fieldset class="usa-fieldset margin-top-2">
|
<fieldset class="usa-fieldset">
|
||||||
<!-- Toggle -->
|
<!-- Toggle -->
|
||||||
{% with add_class="usa-radio__input--tile" add_legend_label="Are you working with a CISA regional representative on your domain request?" %}
|
{% with add_class="usa-radio__input--tile" add_legend_heading="Are you working with a CISA regional representative on your domain request?" %}
|
||||||
{% input_with_errors forms.0.has_cisa_representative %}
|
{% input_with_errors forms.0.has_cisa_representative %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# forms.0 is a small yes/no form that toggles the visibility of "cisa representative" formset #}
|
{# forms.0 is a small yes/no form that toggles the visibility of "cisa representative" formset #}
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<fieldset class="usa-fieldset margin-top-2">
|
<fieldset class="usa-fieldset margin-top-2">
|
||||||
<!-- Toggle -->
|
<!-- Toggle -->
|
||||||
{% with add_class="usa-radio__input--tile" add_legend_label="Is there anything else you’d like us to know about your domain request?" %}
|
{% with add_class="usa-radio__input--tile" 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 %}
|
{% input_with_errors forms.2.has_anything_else_text %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# forms.2 is a small yes/no form that toggles the visibility of "cisa representative" formset #}
|
{# forms.2 is a small yes/no form that toggles the visibility of "cisa representative" formset #}
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
<div class="margin-top-3" id="anything-else">
|
<div class="margin-top-3" id="anything-else">
|
||||||
<p>Provide details below. <abbr class="usa-hint usa-hint--required" title="required">*</abbr></p>
|
<p>Provide details below. <abbr class="usa-hint usa-hint--required" title="required">*</abbr></p>
|
||||||
{% with attr_maxlength=2000 add_label_class="usa-sr-only" add_legend_class="usa-sr-only" add_legend_label="Is there anything else you’d like us to know about your domain request?" add_aria_label="Provide details below. You can enter up to 2000 characters" %}
|
{% with attr_maxlength=2000 add_label_class="usa-sr-only" add_legend_class="usa-sr-only" add_legend_heading="Is there anything else you’d like us to know about your domain request?" add_aria_label="Provide details below. You can enter up to 2000 characters" %}
|
||||||
{% input_with_errors forms.3.anything_else %}
|
{% input_with_errors forms.3.anything_else %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# forms.3 is a form for inputting the e-mail of a cisa representative #}
|
{# forms.3 is a form for inputting the e-mail of a cisa representative #}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
{% block form_fields %}
|
{% block form_fields %}
|
||||||
<div class="margin-top-2">
|
<div class="margin-top-2">
|
||||||
{% with add_class="usa-radio__input--tile" add_legend_label="Are there other employees who can help verify your request?" %}
|
{% with add_class="usa-radio__input--tile" add_legend_heading="Are there other employees who can help verify your request?" %}
|
||||||
{% input_with_errors forms.0.has_other_contacts %}
|
{% input_with_errors forms.0.has_other_contacts %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# forms.0 is a small yes/no form that toggles the visibility of "other contact" formset #}
|
{# forms.0 is a small yes/no form that toggles the visibility of "other contact" formset #}
|
||||||
|
|
|
@ -57,7 +57,7 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
legend_classes = []
|
legend_classes = []
|
||||||
group_classes = []
|
group_classes = []
|
||||||
aria_labels = []
|
aria_labels = []
|
||||||
legend_labels = []
|
legend_headings = []
|
||||||
|
|
||||||
# this will be converted to an attribute string
|
# this will be converted to an attribute string
|
||||||
described_by = []
|
described_by = []
|
||||||
|
@ -91,8 +91,8 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
label_classes.append(value)
|
label_classes.append(value)
|
||||||
elif key == "add_legend_class":
|
elif key == "add_legend_class":
|
||||||
legend_classes.append(value)
|
legend_classes.append(value)
|
||||||
elif key == "add_legend_label":
|
elif key == "add_legend_heading":
|
||||||
legend_labels.append(value)
|
legend_headings.append(value)
|
||||||
|
|
||||||
elif key == "add_group_class":
|
elif key == "add_group_class":
|
||||||
group_classes.append(value)
|
group_classes.append(value)
|
||||||
|
@ -152,8 +152,8 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
if legend_classes:
|
if legend_classes:
|
||||||
context["legend_classes"] = " ".join(legend_classes)
|
context["legend_classes"] = " ".join(legend_classes)
|
||||||
|
|
||||||
if legend_labels:
|
if legend_headings:
|
||||||
context["legend_label"] = " ".join(legend_labels)
|
context["legend_heading"] = " ".join(legend_headings)
|
||||||
|
|
||||||
if group_classes:
|
if group_classes:
|
||||||
context["group_classes"] = " ".join(group_classes)
|
context["group_classes"] = " ".join(group_classes)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue