Skip to content
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

[WIP] [Form] Added support for Bootstrap 4 forms #16290

Closed
wants to merge 2 commits into from
Closed

[WIP] [Form] Added support for Bootstrap 4 forms #16290

wants to merge 2 commits into from

Conversation

EmanueleMinotto
Copy link

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #16289
License MIT
Doc PR -

@jvasseur
Copy link
Contributor

You should probably create new bootstrap_4* themes instead of replacing the bootstrap_3* ones.

@@ -1,7 +1,7 @@
{% use "bootstrap_3_layout.html.twig" %}

{% block form_start -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-horizontal')|trim}) %}
{% set attr = attr|merge({class: attr.class|default('')|trim}) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't do anything.

@javiereguiluz
Copy link
Member

@EmanueleMinotto maybe you should add the [WIP] prefix in the title of this pull request, because it cannot be merged until Bootstrap 4 stable is released. Thanks.

@EmanueleMinotto EmanueleMinotto changed the title [Form] Added support for Bootstrap 4 forms [WIP] [Form] Added support for Bootstrap 4 forms Oct 19, 2015
{# Labels #}

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

Choose a reason for hiding this comment

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

We don't use spaceless anymore in form themes. this has a perf impact as it performs a regex replacement on the rendered string. You should use whitespace control to remove the unnecessary spaces during the template compilation instead

@EmanueleMinotto
Copy link
Author

@jvasseur updated, thanks for all the feedbacks

{% if form.parent %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
<ul class="list-unstyled">
{%- for error in errors -%}
<li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Glyphicon in not included anymore with bootstrap 4. Not sure what we should do here, maybe just removing it ?

Copy link
Member

Choose a reason for hiding this comment

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

Nice catch! I agree that we should remove this.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

@EmanueleMinotto what's the status of this PR?

{%- endblock datetime_row %}

{% block checkbox_row -%}
<div class="form-group{% if not valid %} has-error{% endif %}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Bootstrap4 has no has-error style. It uses has-danger instead

@FractalizeR
Copy link
Contributor

@fabpot I think it's incomplete yet. I've glanced over the code (starting to work with Bootstrap 4 also) and found some places, derived from V3, that should be changed.

@EmanueleMinotto
Copy link
Author

@fabpot I was following twbs/bootstrap#17021 waiting the v4 release (as @javiereguiluz told me above):

because it cannot be merged until Bootstrap 4 stable is released

but I can also complete it without problems in any moment, could it be merged even if v4 isn't at the release?

@FractalizeR thank you for your feedbacks, yes I started from the v3 template for the v4, but I'll fix the new templates following your feedbacks asap

@FractalizeR
Copy link
Contributor

@EmanueleMinotto Thanks a lot. I will try to have another look over the weekend. I've started to use Bootstrap 4 for my home project and is also

@FractalizeR
Copy link
Contributor

@fabpot Bootstrap 4 now removed icon set (Glyphicons) from main distribution. Should we consider ourselves completely empty of icons or should we use something like Font-Awesome? May be, by providing another alternative template, which will add icons?

@mahono
Copy link

mahono commented Feb 10, 2016

Why/where would icons be used in the form system?

@HeahDude
Copy link
Contributor

@mahono for alert signs in form errors

@fabpot
Copy link
Member

fabpot commented Jun 9, 2016

Any news on this one? I'd love to have proper support for version 4 of Bootstrap

@javiereguiluz
Copy link
Member

@fabpot we'll need to wait a bit because Bootstrap 4 is still releasing alpha versions and this could change before the final release (unlikely but possible).

@mvrhov
Copy link

mvrhov commented Jun 9, 2016

Well then then the fixes can be added later when B4 gets released. If this works with latest alpha, then IMO it should get merged

@fabpot
Copy link
Member

fabpot commented Jun 9, 2016

I agree, get this one finished, merged into master, then we have 6 months to tweak the code depending on what changes upstream.

@xabbuh
Copy link
Member

xabbuh commented Jun 11, 2016

When (roughly) can we expect the release of Bootstrap 4?

@mvrhov
Copy link

mvrhov commented Jun 12, 2016

No ETA. Their usual moto was when it's done

@nicolas-grekas nicolas-grekas added this to the 3.x milestone Dec 6, 2016
@javiereguiluz
Copy link
Member

Closing it because we have other PR for this: #19648 I know that this one is older ... but the other one seems to have gained more attention and it's fully reviewed. I'm sorry and thanks for understanding it.

@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet