8000 [Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless by arkste · Pull Request #24728 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless #24728

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

Closed
wants to merge 11 commits into from
Closed
Next Next commit
[TwigBridge] fix bootstrap 3 & 4 checkbow row rendering
  • Loading branch information
arkste committed Oct 30, 2017
commit 60105bcb72f132bb66dce5587f3553547b424027
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% use "bootstrap_3_layout.html.twig" %}

{% block form_label_class -%}
col-sm-2
{%- endblock form_label_class %}
Copy link
Member

Choose a reason for hiding this comment

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

Can you move back this snippet to where it was before? That would ease merging older branches. Thanks.


{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}
Copy link
Member

Choose a reason for hiding this comment

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

Same for this one. We try to not move snippets of code around as it makes merging branches more difficult.


{% block form_start -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-horizontal')|trim}) %}
{{- parent() -}}
Expand All @@ -8,20 +16,14 @@
{# Labels #}

{% block form_label -%}
{% spaceless %}
{% if label is same as(false) %}
<div class="{{ block('form_label_class') }}"></div>
{% else %}
Copy link
Member

Choose a reason for hiding this comment

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

these tags are missing the whitespace control to remove indentation spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed. please review the recent commit, thanks!

{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ block('form_label_class'))|trim}) %}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ block('form_label_class'))|trim}) -%}
{{- parent() -}}
{% endif %}
{% endspaceless %}
{%- endblock form_label %}

{% block form_label_class -%}
col-sm-2
{%- endblock form_label_class %}

{# Rows #}

{% block form_row -%}
Expand All @@ -35,27 +37,29 @@ col-sm-2
{%- endblock form_row %}

{% block submit_row -%}
{% spaceless %}
<div class="form-group">
<div class="{{ block('form_label_class') }}"></div>
<div class="form-group">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{ form_widget(form) }}
</div>
</div>{#--#}
</div>
{% endspaceless %}
{% endblock submit_row %}

{% block reset_row -%}
{% spaceless %}
<div class="form-group">
<div class="{{ block('form_label_class') }}"></div>
<div class="form-group">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{ form_widget(form) }}
</div>
</div>{#--#}
</div>
{% endspaceless %}
{% endblock reset_row %}

{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}
{% block checkbox_row -%}
<div class="form-group{% if not valid %} has-error{% endif %}">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form) -}}
{{- form_errors(form) -}}
</div>{#--#}
</div>
{%- endblock checkbox_row %}
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,10 @@
{%- endblock datetime_row %}

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

{% block radio_row -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% use "bootstrap_4_layout.html.twig" %}

{% block form_label_class -%}
col-sm-2
{%- endblock form_label_class %}

{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}

{# Labels #}

{% block form_label -%}
Expand All @@ -14,10 +22,6 @@
{%- endif -%}
{%- endblock form_label %}

{% block form_label_class -%}
col-sm-2
{%- endblock form_label_class %}

{# Rows #}

{% block form_row -%}
Expand Down Expand Up @@ -47,23 +51,29 @@ col-sm-2
{%- endblock fieldset_form_row %}

{% block submit_row -%}
<div class="form-group row">
<div class="{{ block('form_label_class') }}"></div>
<div class="form-group row">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form) -}}
</div>
</div>{#--#}
</div>
{%- endblock submit_row %}

{% block reset_row -%}
<div class="form-group row">
<div class="{{ block('form_label_class') }}"></div>
<div class="form-group row">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form) -}}
</div>
</div>{#--#}
</div>
{%- endblock reset_row %}

{% block form_group_class -%}
col-sm-10
{%- endblock form_group_class %}
{% block checkbox_row -%}
<div class="form-group row">{#--#}
<div class="{{ block('form_label_class') }}"></div>{#--#}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form) -}}
{{- form_errors(form) -}}
</div>{#--#}
</div>
{%- endblock checkbox_row %}
Copy link
Member

Choose a reason for hiding this comment

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

missing end of line

0