Skip to content

[TwigBridge] Re-add Bootstrap 3 Checkbox Layout #24711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@
{%- endblock datetime_row %}

{% block checkbox_row -%}
{% spaceless %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is spaceless here really needed? It makes the block much slower and we removed them everywhere when not needed. I can see some more usages, but we should consider removing them if not strictly needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, it's not needed, but spaceless was there when the template was added back in 2014 and got copy-pasted over the time for other row-blocks.

to make sure this gets merged asap and to avoid possible BC breaks, i only re-added the old code with spaceless.

but... after reviewing the code myself today, i noticed that i made a mistake:

the code should've been re-added to the bootstrap_3_horizontal_layout.html.twig (where it was removed) instead of replacing the checkbox_row-block in the the bootstrap_3_layout.html.twig (it causes an unnecessary empty container in the vertical layout now).

i'll prepare a new PR where i'll fix this when #24727 gets merged to avoid conflicts.

<div class="form-group{% if not valid %} has-error{% endif %}">
{{- form_widget(form) -}}
{{- form_errors(form) -}}
<div class="{{ block('form_label_class') }}"></div>
<div class="{{ block('form_group_class') }}">
{{- form_widget(form) -}}
{{- form_errors(form) -}}
</div>
</div>
{% endspaceless %}
{%- endblock checkbox_row %}

{% block radio_row -%}
Expand Down