Skip to content

Commit 575004a

Browse files
Merge branch '3.4' into 4.0
* 3.4: [Form][WCAG] Errors sign for people that do not see colors [Form][WCAG] Added role=\"presentation\" on tables & removed bootstrap4 table
2 parents 6864645 + 9cb6f18 commit 575004a

File tree

3 files changed

+44
-28
lines changed

3 files changed

+44
-28
lines changed

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,48 @@
5858
{%- else -%}
5959
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%}
6060
<div {{ block('widget_container_attributes') }}>
61-
<div class="table-responsive">
62-
<table class="table {{ table_class|default('table-bordered table-condensed table-striped') }}">
63-
<thead>
64-
<tr>
65-
{%- if with_years %}<th>{{ form_label(form.years) }}</th>{% endif -%}
66-
{%- if with_months %}<th>{{ form_label(form.months) }}</th>{% endif -%}
67-
{%- if with_weeks %}<th>{{ form_label(form.weeks) }}</th>{% endif -%}
68-
{%- if with_days %}<th>{{ form_label(form.days) }}</th>{% endif -%}
69-
{%- if with_hours %}<th>{{ form_label(form.hours) }}</th>{% endif -%}
70-
{%- if with_minutes %}<th>{{ form_label(form.minutes) }}</th>{% endif -%}
71-
{%- if with_seconds %}<th>{{ form_label(form.seconds) }}</th>{% endif -%}
72-
</tr>
73-
</thead>
74-
<tbody>
75-
<tr>
76-
{%- if with_years %}<td>{{ form_widget(form.years) }}</td>{% endif -%}
77-
{%- if with_months %}<td>{{ form_widget(form.months) }}</td>{% endif -%}
78-
{%- if with_weeks %}<td>{{ form_widget(form.weeks) }}</td>{% endif -%}
79-
{%- if with_days %}<td>{{ form_widget(form.days) }}</td>{% endif -%}
80-
{%- if with_hours %}<td>{{ form_widget(form.hours) }}</td>{% endif -%}
81-
{%- if with_minutes %}<td>{{ form_widget(form.minutes) }}</td>{% endif -%}
82-
{%- if with_seconds %}<td>{{ form_widget(form.seconds) }}</td>{% endif -%}
83-
</tr>
84-
</tbody>
85-
</table>
61+
{%- if with_years -%}
62+
<div class="col-auto">
63+
{{ form_label(form.years) }}
64+
{{ form_widget(form.years) }}
8665
</div>
66+
{%- endif -%}
67+
{%- if with_months -%}
68+
<div class="col-auto">
69+
{{ form_label(form.months) }}
70+
{{ form_widget(form.months) }}
71+
</div>
72+
{%- endif -%}
73+
{%- if with_weeks -%}
74+
<div class="col-auto">
75+
{{ form_label(form.weeks) }}
76+
{{ form_widget(form.weeks) }}
77+
</div>
78+
{%- endif -%}
79+
{%- if with_days -%}
80+
<div class="col-auto">
81+
{{ form_label(form.days) }}
82+
{{ form_widget(form.days) }}
83+
</div>
84+
{%- endif -%}
85+
{%- if with_hours -%}
86+
<div class="col-auto">
87+
{{ form_label(form.hours) }}
88+
{{ form_widget(form.hours) }}
89+
</div>
90+
{%- endif -%}
91+
{%- if with_minutes -%}
92+
<div class="col-auto">
93+
{{ form_label(form.minutes) }}
94+
{{ form_widget(form.minutes) }}
95+
</div>
96+
{%- endif -%}
97+
{%- if with_seconds -%}
98+
<div class="col-auto">
99+
{{ form_label(form.seconds) }}
100+
{{ form_widget(form.seconds) }}
101+
</div>
102+
{%- endif -%}
87103
{%- if with_invert %}{{ form_widget(form.invert) }}{% endif -%}
88104
</div>
89105
{%- endif -%}
@@ -248,7 +264,7 @@
248264
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
249265
<ul class="list-unstyled mb-0">
250266
{%- for error in errors -%}
251-
<li>{{ error.message }}</li>
267+
<li><span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span></li>
252268
{%- endfor -%}
253269
</ul>
254270
</div>

Resources/views/Form/bootstrap_base_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<div {{ block('widget_container_attributes') }}>
108108
{{- form_errors(form) -}}
109109
<div class="table-responsive">
110-
<table class="table {{ table_class|default('table-bordered table-condensed table-striped') }}">
110+
<table class="table {{ table_class|default('table-bordered table-condensed table-striped') }}" role="presentation">
111111
<thead>
112112
<tr>
113113
{%- if with_years %}<th>{{ form_label(form.years) }}</th>{% endif -%}

Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
{%- else -%}
137137
<div {{ block('widget_container_attributes') }}>
138138
{{- form_errors(form) -}}
139-
<table class="{{ table_class|default('') }}">
139+
<table class="{{ table_class|default('') }}" role="presentation">
140140
<thead>
141141
<tr>
142142
{%- if with_years %}<th>{{ form_label(form.years) }}</th>{% endif -%}

0 commit comments

Comments
 (0)