mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-04 19:08:26 -04:00
Change class names for validation errors in html
Implements the class name changes detailed in: https://github.com/alphagov/govuk_elements/pull/405
This commit is contained in:
@@ -2,8 +2,6 @@ $(() => $("time.timeago").timeago());
|
|||||||
|
|
||||||
$(() => GOVUK.modules.start());
|
$(() => GOVUK.modules.start());
|
||||||
|
|
||||||
$(() => new GOVUK.SelectionButtons('.block-label input'));
|
|
||||||
|
|
||||||
$(() => $('.error-message').eq(0).parent('label').next('input').trigger('focus'));
|
$(() => $('.error-message').eq(0).parent('label').next('input').trigger('focus'));
|
||||||
|
|
||||||
$(() => $('.banner-dangerous').eq(0).trigger('focus'));
|
$(() => $('.banner-dangerous').eq(0).trigger('focus'));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ $path: '/static/images/';
|
|||||||
@import 'elements/elements-typography';
|
@import 'elements/elements-typography';
|
||||||
@import 'elements/forms';
|
@import 'elements/forms';
|
||||||
@import 'elements/forms/form-validation';
|
@import 'elements/forms/form-validation';
|
||||||
@import 'elements/forms/form-block-labels';
|
@import 'elements/forms/form-multiple-choice';
|
||||||
@import 'elements/forms/form-validation';
|
@import 'elements/forms/form-validation';
|
||||||
@import 'elements/icons';
|
@import 'elements/icons';
|
||||||
@import 'elements/layout';
|
@import 'elements/layout';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{% macro file_upload(field, button_text="Choose file", alternate_link=None, alternate_link_text=None) %}
|
{% macro file_upload(field, button_text="Choose file", alternate_link=None, alternate_link_text=None) %}
|
||||||
<form method="post" enctype="multipart/form-data" class="{% if field.errors %}error{% endif %}" data-module="file-upload">
|
<form method="post" enctype="multipart/form-data" class="{% if field.errors %}form-group-error{% endif %}" data-module="file-upload">
|
||||||
<label class="file-upload-label" for="{{ field.name }}">
|
<label class="file-upload-label" for="{{ field.name }}">
|
||||||
<span class="visually-hidden">{{ field.label.text }}</span>
|
<span class="visually-hidden">{{ field.label.text }}</span>
|
||||||
{% if hint %}
|
{% if hint %}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{% if error %}
|
{% if error %}
|
||||||
<div class="validation-wrapper">
|
<div class="validation-wrapper">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<fieldset class="form-group{% if field.errors %} error{% endif %}" id="{{ field.name }}">
|
<fieldset class="form-group{% if field.errors %} form-group-error{% endif %}" id="{{ field.name }}">
|
||||||
<legend>
|
<legend>
|
||||||
<span class="form-label">
|
<span class="form-label">
|
||||||
{{ field.label.text }}
|
{{ field.label.text }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
disable=[],
|
disable=[],
|
||||||
option_hints={}
|
option_hints={}
|
||||||
) %}
|
) %}
|
||||||
<div class="form-group {% if field.errors %} error{% endif %}">
|
<div class="form-group {% if field.errors %} form-group-error{% endif %}">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend class="form-label">
|
<legend class="form-label">
|
||||||
{{ field.label.text|safe }}
|
{{ field.label.text|safe }}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
hint=None,
|
hint=None,
|
||||||
wrapping_class='form-group'
|
wrapping_class='form-group'
|
||||||
) %}
|
) %}
|
||||||
<div class="{{ wrapping_class }} {% if field.errors %} error{% endif %}">
|
<div class="{{ wrapping_class }} {% if field.errors %} form-group-error{% endif %}">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend class="form-label">
|
<legend class="form-label">
|
||||||
{{ field.label.text }}
|
{{ field.label.text }}
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
hint=None,
|
hint=None,
|
||||||
branding_dict={}
|
branding_dict={}
|
||||||
) %}
|
) %}
|
||||||
<div class="form-group {% if field.errors %} error{% endif %}">
|
<div class="form-group {% if field.errors %} form-group-error{% endif %}">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend class="form-label">
|
<legend class="form-label">
|
||||||
{{ field.label.text }}
|
{{ field.label.text }}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
safe_error_message=False,
|
safe_error_message=False,
|
||||||
rows=8
|
rows=8
|
||||||
) %}
|
) %}
|
||||||
<div class="form-group{% if field.errors %} error{% endif %}" {% if autofocus %}data-module="autofocus"{% endif %}>
|
<div class="form-group{% if field.errors %} form-group-error{% endif %}" {% if autofocus %}data-module="autofocus"{% endif %}>
|
||||||
<label class="form-label" for="{{ field.name }}">
|
<label class="form-label" for="{{ field.name }}">
|
||||||
{% if label %}
|
{% if label %}
|
||||||
{{ label }}
|
{{ label }}
|
||||||
@@ -29,10 +29,20 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</label>
|
</label>
|
||||||
|
{%
|
||||||
|
if highlight_tags
|
||||||
|
%}
|
||||||
|
{% set field_class = 'form-control-{} textbox-highlight-textbox'.format(width) %}
|
||||||
|
{% else %}
|
||||||
|
{% set field_class = 'form-control-{} {}'.format(width, 'textbox-right-aligned' if suffix else '') %}
|
||||||
|
{% endif %}
|
||||||
|
{%
|
||||||
|
set field_class = 'form-control ' + field_class + (
|
||||||
|
' form-control-error' if field.errors else ''
|
||||||
|
)
|
||||||
|
%}
|
||||||
{{ field(**{
|
{{ field(**{
|
||||||
'class':
|
'class': field_class,
|
||||||
'form-control form-control-{} textbox-highlight-textbox'.format(width) if highlight_tags else
|
|
||||||
'form-control form-control-{} {}'.format(width, 'textbox-right-aligned' if suffix else ''),
|
|
||||||
'data-module': 'highlight-tags' if highlight_tags else '',
|
'data-module': 'highlight-tags' if highlight_tags else '',
|
||||||
'rows': rows|string
|
'rows': rows|string
|
||||||
}) }}
|
}) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user