-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change form layout from horizontal to vertical
- Loading branch information
1 parent
b4abaaf
commit 146df0a
Showing
5 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
{% block integer_unit_widget %} | ||
{% set unit_label_id = id ~ '_unit' %} | ||
{% set attr = attr|merge({'aria-describedby': (attr['aria-describedby'] ?? '') ~ ' ' ~ unit_label_id}) %} | ||
|
||
{{ block('integer_widget') }} | ||
<span class="unit-label">{{ unit_label }}</span> | ||
{% endblock integer_unit_widget %} | ||
|
||
<span class="unit-label" id="{{ unit_label_id }}"> | ||
{{ unit_label }} | ||
</span> | ||
{% endblock %} | ||
|
||
{% block decimal_unit_widget %} | ||
{% set attr = attr|merge({ | ||
'class': attr.class|default('') ~ ' decimal', | ||
'step': step, | ||
'min': step, | ||
}) %} | ||
|
||
{{ block('integer_unit_widget') }} | ||
{% endblock decimal_unit_widget %} | ||
{% endblock %} | ||
|
||
{% block radio_table_columns_row %} | ||
{# Do not render label for radio table columns widget. #} | ||
{{ block('form_rows') }} | ||
{% endblock radio_table_columns_row %} | ||
{% endblock %} | ||
|
||
{% block text_hints_widget %} | ||
{% set hints_list_id = id ~ '_hints' %} | ||
{% set attr = attr|merge({'list': hints_list_id}) %} | ||
|
||
<datalist id="{{ hints_list_id }}"> | ||
{% for hint in hints %} | ||
<option>{{ hint }}</option> | ||
{% endfor %} | ||
</datalist> | ||
|
||
{% set attr = attr|merge({'list': hints_list_id}) %} | ||
{{ block('form_widget') }} | ||
{% endblock text_hints_widget %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,59 @@ | ||
{% block form_row %} | ||
<div class="form-item form-regular"> | ||
<div>{{ form_label(form) }}</div> | ||
<div>{{ form_widget(form) }}</div> | ||
{%- set aria_describedby = (attr['aria-describedby'] ?? '') ~ (errors|length > 0 ? ' ' ~ id ~ '_error') ~ (help ? ' ' ~ id ~ '_help') -%} | ||
|
||
<div class="form-item"> | ||
{{ form_label(form) }} | ||
{{ form_widget(form, {attr: {'aria-describedby': aria_describedby|trim}}) }} | ||
{{ form_errors(form) }} | ||
{{ form_help(form) }} | ||
</div> | ||
{% endblock form_row %} | ||
{% endblock %} | ||
|
||
{% block checkbox_row %} | ||
<div class="form-item form-checkbox"> | ||
{{ form_widget(form) }} | ||
{{ form_label(form) }} | ||
{%- set aria_describedby = (attr['aria-describedby'] ?? '') ~ (errors|length > 0 ? ' ' ~ id ~ '_error') ~ (help ? ' ' ~ id ~ '_help') -%} | ||
|
||
<div class="form-item form-item-checkbox"> | ||
<div> | ||
{{ form_widget(form, {attr: {'aria-describedby': aria_describedby|trim}}) }} | ||
{{ form_label(form) }} | ||
</div> | ||
|
||
{{ form_errors(form) }} | ||
{{ form_help(form) }} | ||
</div> | ||
{% endblock checkbox_row %} | ||
{% endblock %} | ||
|
||
{% block radio_row %} | ||
{{ block('checkbox_row') }} | ||
{% endblock radio_row %} | ||
{% block form_errors %} | ||
{%- if errors|length > 0 -%} | ||
<p class="form-error-message" id="{{ id }}_error"> | ||
{{ (errors|first).message }} | ||
</p> | ||
{%- endif -%} | ||
{% endblock %} | ||
|
||
{% block form_help %} | ||
{%- if help -%} | ||
<p class="form-help-message" id="{{ id }}_help"> | ||
{{ help_html ? field_help(form)|raw : field_help(form) }} | ||
</p> | ||
{%- endif -%} | ||
{% endblock %} | ||
|
||
{% block choice_row %} | ||
{% if expanded %} | ||
<fieldset> | ||
{%- set aria_describedby = (attr['aria-describedby'] ?? '') ~ (errors|length > 0 ? ' ' ~ id ~ '_error') ~ (help ? ' ' ~ id ~ '_help') -%} | ||
|
||
<fieldset class="form-group"> | ||
<legend class="sr-only">{{ form_label(form)|striptags }}</legend> | ||
|
||
{% for child in form %} | ||
{{ form_row(child) }} | ||
{{ form_row(child, {attr: {'aria-describedby': aria_describedby|trim}}) }} | ||
{% endfor %} | ||
|
||
{{ form_errors(form) }} | ||
{{ form_help(form) }} | ||
</fieldset> | ||
{% else %} | ||
{{ form_row(form) }} | ||
{% endif %} | ||
{% endblock choice_row %} | ||
{% endblock %} |