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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bs3 styles from crispy_forms_field #1003

Merged
merged 1 commit into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion crispy_forms/templates/bootstrap3/field.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
{% else %}
<div class="controls {{ field_class }}">
{% crispy_field field %}
{% if field|is_multivalue %}
{% crispy_field field %}
{% else %}
{% crispy_field field 'class' 'form-control' %}
{% endif %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="controls {{ field_class }}">
<div class="input-group">
{% if crispy_prepended_text %}<span class="input-group-addon{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_prepended_text|safe }}</span>{% endif %}
{% crispy_field field %}
{% crispy_field field 'class' 'form-control' %}
{% if crispy_appended_text %}<span class="input-group-addon{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_appended_text|safe }}</span>{% endif %}
</div>

Expand Down
10 changes: 0 additions & 10 deletions crispy_forms/templatetags/crispy_forms_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ def render(self, context): # noqa: C901
else:
css_class = class_name

if (
template_pack == "bootstrap3"
and not is_checkbox(field)
and not is_file(field)
and not is_multivalue(field)
):
css_class += " form-control"
if field.errors:
css_class += " form-control-danger"

if template_pack == "bootstrap4" and not is_multivalue(field):
if not is_checkbox(field):
css_class += " form-control"
Expand Down