Skip to content

Commit 24182ff

Browse files
author
symon.vezina
committed
Added setting/env variable DD_SHOW_A11Y_REQUIRED_FIELDS_NOTICE
1 parent 9b83b15 commit 24182ff

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

dojo/context_processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def globalize_vars(request):
2222
"SHOW_PLG_LINK": True,
2323
# V3 Feature Flags
2424
"V3_FEATURE_LOCATIONS": settings.V3_FEATURE_LOCATIONS,
25+
"SHOW_A11Y_REQUIRED_FIELDS_NOTICE": settings.SHOW_A11Y_REQUIRED_FIELDS_NOTICE,
2526
}
2627

2728
additional_banners = []

dojo/settings/settings.dist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127
# Falls back to a plain queryset on any error (logged).
128128
DD_WATSON_INDEX_PREFETCH_ENABLED=(bool, True),
129129
DD_FOOTER_VERSION=(str, ""),
130-
# models should be passed to celery by ID, default is False (for now)
130+
# Toggle for the highly accessible notice at the top of forms ("Required fields are marked with an asterisk*")
131+
DD_SHOW_A11Y_REQUIRED_FIELDS_NOTICE=(bool, True),
131132
DD_DATABASE_ENGINE=(str, "django.db.backends.postgresql"),
132133
DD_DATABASE_HOST=(str, "postgres"),
133134
DD_DATABASE_NAME=(str, "defectdojo"),
@@ -625,6 +626,9 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
625626
# Used to configure a custom version in the footer of the base.html template.
626627
FOOTER_VERSION = env("DD_FOOTER_VERSION")
627628

629+
# Toggle for the highly accessible notice at the top of forms ("Required fields are marked with an asterisk*")
630+
SHOW_A11Y_REQUIRED_FIELDS_NOTICE = env("DD_SHOW_A11Y_REQUIRED_FIELDS_NOTICE")
631+
628632
# V3 Feature Flags
629633
V3_FEATURE_LOCATIONS = env("DD_V3_FEATURE_LOCATIONS")
630634

dojo/templates/dojo/form_fields.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{ field }}
1919
{% endfor %}
2020

21-
{% if form|has_required_field %}
21+
{% if form|has_required_field and SHOW_A11Y_REQUIRED_FIELDS_NOTICE %}
2222
<div class="form-group">
2323
<div class="col-sm-offset-2 col-sm-10">
2424
<p class="help-block">

dojo/templates_classic/dojo/form_fields.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{{ field }}
1818
{% endfor %}
1919

20-
{% if form|has_required_field %}
20+
{% if form|has_required_field and SHOW_A11Y_REQUIRED_FIELDS_NOTICE %}
2121
<div class="form-group">
2222
<div class="col-sm-offset-2 col-sm-10">
2323
<p class="help-block">

0 commit comments

Comments
 (0)