-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
I've added tests to make sure the checkbox row doesn't break again in bootstrap 3 & 4. TwigBridge tests were failing because of the changes made in #24703, so i fixed them as well. Tests are still failing, but this is related due to the timezone changes. Please let me know if there's anything else i can do to get this merged. |
@@ -8,20 +16,14 @@ | |||
{# Labels #} | |||
|
|||
{% block form_label -%} | |||
{% spaceless %} | |||
{% if label is same as(false) %} | |||
<div class="{{ block('form_label_class') }}"></div> | |||
{% else %} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
Status: Needs Review |
@stof i've added more whitespace control tags to remove indentation spaces. |
deps=low tests should not fail: Form's lowest dep for the bridge should be bumped (or vice-versa, didn't look precisely) |
@nicolas-grekas not sure what to do now, the deps are already on |
should be |
correct me if i'm wrong, but even changing the deps wont make the tests running green on deps=low, since travis runs the bridge tests from the vendor-folder (like |
it will: the CI builds per PR packages for that situation |
@@ -1,5 +1,13 @@ | |||
{% use "bootstrap_3_layout.html.twig" %} | |||
|
|||
{% block form_label_class -%} | |||
col-sm-2 | |||
{%- endblock form_label_class %} |
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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.
@fabpot i reverted the change for bootstrap 3 & 4. |
{{- parent() -}} | ||
{%- endblock button_widget %} | ||
|
||
{% block checkbox_widget -%} | ||
{%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%} | ||
{% if 'checkbox-inline' in parent_label_class %} | ||
{%- if 'checkbox-inline' in parent_label_class -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure those added -
are needed? Does they make a difference as there are already -
signs at the end of the line before and at the beginning of the next line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually they're not needed, but i tried to keep it similar to the bs4 layout, will remove them in both templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the diff should be reduced to the strict minimum (there are some added "-" that are not needed)
{{- form_errors(form) -}} | ||
</div>{#--#} | ||
</div> | ||
{%- endblock checkbox_row %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing end of line
Thank you @arkste. |
…y & remove spaceless (arkste) This PR was squashed before being merged into the 3.4 branch (closes #24728). Discussion ---------- [Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24711 | License | MIT | Doc PR | - As discussed in #24711 i reverted the change i did in `bootstrap_3_layout.html.twig` (which caused an unnecessary empty div-container in the vertical-layout), added the `checkbox_row` block to the `bootstrap_3_horizontal_layout.html.twig` and removed `spaceless` (as proposed in #24727). since i added `{#--#}` in bootstrap 3, i did the same for the same horizontal blocks in bootstrap 4 as well. I moved the `form_label_class` & `form_group_class` blocks to the top of `bootstrap_3_horizontal_layout.html.twig` & `bootstrap_4_horizontal_layout.html.twig`, this should improve DX as they were spreaded across the file. #24702 affected the bootstrap 4 horizontal layout as well, so i added the `checkbox_row` block to bootstrap 4 too. ping @fabpot @nicolas-grekas Commits ------- f84749f [Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless
seems like i pushed the EOL's while this was supposed to be merged. anything i should do now @fabpot ? |
@arkste all is fine :) Thank you. |
ok :) |
As discussed in #24711 i reverted the change i did in
bootstrap_3_layout.html.twig
(which caused an unnecessary empty div-container in the vertical-layout), added thecheckbox_row
block to thebootstrap_3_horizontal_layout.html.twig
and removedspaceless
(as proposed in #24727).since i added
{#--#}
in bootstrap 3, i did the same for the same horizontal blocks in bootstrap 4 as well.I moved the
form_label_class
&form_group_class
blocks to the top ofbootstrap_3_horizontal_layout.html.twig
&bootstrap_4_horizontal_layout.html.twig
, this should improve DX as they were spreaded across the file.#24702 affected the bootstrap 4 horizontal layout as well, so i added the
checkbox_row
block to bootstrap 4 too.ping @fabpot @nicolas-grekas