Skip to content

Commit

Permalink
Merge branch 'release/5.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Apr 8, 2015
2 parents afa9d65 + 8174636 commit 47e5492
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
6 changes: 4 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ History
-------


5.2.0 (2015-03-20)
5.3.0 (2015-04-08)
++++++++++++++++++

* Various bug fixes and improvements
* Fix Django 1.8 importlib warnings
* Set defaults for horizontal-form to col-md-3 for label, col-md-9 for field
* Various bug fixes


5.2.0 (2015-03-25)
Expand Down
2 changes: 1 addition & 1 deletion bootstrap3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = '5.2.0'
__version__ = '5.3s.0'
8 changes: 4 additions & 4 deletions bootstrap3/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from django.conf import settings
try:
from django.utils.importlib import import_module
except ImportError:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module


# Default settings
Expand All @@ -17,8 +17,8 @@
'javascript_url': None,
'javascript_in_head': False,
'include_jquery': False,
'horizontal_label_class': 'col-md-2',
'horizontal_field_class': 'col-md-4',
'horizontal_label_class': 'col-md-3',
'horizontal_field_class': 'col-md-9',
'set_required': True,
'set_placeholder': True,
'required_css_class': '',
Expand Down
8 changes: 4 additions & 4 deletions bootstrap3/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ def render_formset(formset, **kwargs):
return renderer_cls(formset, **kwargs).render()


def render_formset_errors(form, **kwargs):
def render_formset_errors(formset, **kwargs):
"""
Render formset errors to a Bootstrap layout
"""
renderer_cls = get_formset_renderer(**kwargs)
return renderer_cls(form, **kwargs).render_errors()
return renderer_cls(formset, **kwargs).render_errors()


def render_form(form, **kwargs):
"""
Render a formset to a Bootstrap layout
Render a form to a Bootstrap layout
"""
renderer_cls = get_form_renderer(**kwargs)
return renderer_cls(form, **kwargs).render()
Expand All @@ -55,7 +55,7 @@ def render_form_errors(form, type='all', **kwargs):

def render_field(field, **kwargs):
"""
Render a formset to a Bootstrap layout
Render a field to a Bootstrap layout
"""
renderer_cls = get_field_renderer(**kwargs)
return renderer_cls(field, **kwargs).render()
Expand Down
8 changes: 4 additions & 4 deletions bootstrap3/templatetags/bootstrap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ def bootstrap_formset(*args, **kwargs):
@register.simple_tag
def bootstrap_formset_errors(*args, **kwargs):
"""
Render form errors
Render formset errors
**Tag name**::
bootstrap_form_errors
bootstrap_formset_errors
**Parameters**:
Expand All @@ -247,11 +247,11 @@ def bootstrap_formset_errors(*args, **kwargs):
**usage**::
{% bootstrap_form_errors form %}
{% bootstrap_formset_errors formset %}
**example**::
{% bootstrap_form_errors form layout='inline' %}
{% bootstrap_formset_errors formset layout='inline' %}
"""
return render_formset_errors(*args, **kwargs)

Expand Down
8 changes: 4 additions & 4 deletions bootstrap3/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def test_layout_horizontal(self):
form = TestForm()
res = render_template(
'{% bootstrap_form form layout="horizontal" %}', form=form)
self.assertIn('col-md-2', res)
self.assertIn('col-md-4', res)
self.assertIn('col-md-3', res)
self.assertIn('col-md-9', res)
res = render_template(
'{% bootstrap_form form layout="horizontal" ' +
'horizontal_label_class="hlabel" ' +
Expand All @@ -247,8 +247,8 @@ def test_buttons_tag(self):
form = TestForm()
res = render_template(
'{% buttons layout="horizontal" %}{% endbuttons %}', form=form)
self.assertIn('col-md-2', res)
self.assertIn('col-md-4', res)
self.assertIn('col-md-3', res)
self.assertIn('col-md-9', res)


class FieldTest(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ The ``BOOTSTRAP3`` dict variable is contains these settings and defaults:
'include_jquery': False,
# Label class to use in horizontal forms
'horizontal_label_class': 'col-md-2',
'horizontal_label_class': 'col-md-3',
# Field class to use in horizontal forms
'horizontal_field_class': 'col-md-4',
'horizontal_field_class': 'col-md-9',
# Set HTML required attribute on required fields
'set_required': True,
Expand Down

0 comments on commit 47e5492

Please sign in to comment.