Skip to content

Commit

Permalink
Added {{ form.media }} to form rendering
Browse files Browse the repository at this point in the history
This should tackle issue #263
  • Loading branch information
maraujop committed Feb 2, 2014
1 parent ad4f92e commit 560171a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions crispy_forms/templates/bootstrap/display_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% if form.form_html %}
{{ form.media }}
{% if form_show_errors %}
{% include "bootstrap/errors.html" %}
{% endif %}
Expand Down
13 changes: 7 additions & 6 deletions crispy_forms/templates/bootstrap/uni_form.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% load crispy_forms_utils %}

{% specialspaceless %}
{% if form_show_errors %}
{% include "bootstrap/errors.html" %}
{% endif %}
{% for field in form %}
{% include "bootstrap/field.html" %}
{% endfor %}
{{ form.media }}
{% if form_show_errors %}
{% include "bootstrap/errors.html" %}
{% endif %}
{% for field in form %}
{% include "bootstrap/field.html" %}
{% endfor %}
{% endspecialspaceless %}
1 change: 1 addition & 0 deletions crispy_forms/templates/bootstrap3/display_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% if form.form_html %}
{{ form.media }}
{% if form_show_errors %}
{% include "bootstrap3/errors.html" %}
{% endif %}
Expand Down
13 changes: 7 additions & 6 deletions crispy_forms/templates/bootstrap3/uni_form.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% load crispy_forms_utils %}

{% specialspaceless %}
{% if form_show_errors %}
{% include "bootstrap3/errors.html" %}
{% endif %}
{% for field in form %}
{% include "bootstrap3/field.html" %}
{% endfor %}
{{ form.media }}
{% if form_show_errors %}
{% include "bootstrap3/errors.html" %}
{% endif %}
{% for field in form %}
{% include "bootstrap3/field.html" %}
{% endfor %}
{% endspecialspaceless %}
1 change: 1 addition & 0 deletions crispy_forms/templates/uni_form/display_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% if form.form_html %}
{{ form.media }}
{% if form_show_errors %}
{% include "uni_form/errors.html" %}
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions crispy_forms/templates/uni_form/uni_form.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ form.media }}
{% if form_show_errors %}
{% include "uni_form/errors.html" %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions crispy_forms/tests/test_layout_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ def test_html_with_carriage_returns(self):
html = render_crispy_form(test_form)

if self.current_template_pack == 'uni_form':
self.assertEqual(html.count('\n'), 22)
self.assertEqual(html.count('\n'), 23)
elif self.current_template_pack == 'bootstrap':
self.assertEqual(html.count('\n'), 24)
else:
self.assertEqual(html.count('\n'), 25)
else:
self.assertEqual(html.count('\n'), 26)

def test_i18n(self):
activate('es')
Expand Down

0 comments on commit 560171a

Please sign in to comment.