Skip to content

Commit bbc2610

Browse files
committed
Merge branch 'release/6.2.0'
2 parents d61fe66 + bebfb12 commit bbc2610

File tree

14 files changed

+571
-216
lines changed

14 files changed

+571
-216
lines changed

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ python:
99

1010
# Django versions for matrix
1111
env:
12-
- DJANGO_VERSION=1.4.18
12+
- DJANGO_VERSION=1.4.21
1313
- DJANGO_VERSION=1.5.12
14-
- DJANGO_VERSION=1.6.10
15-
- DJANGO_VERSION=1.7.3
14+
- DJANGO_VERSION=1.6.11
15+
- DJANGO_VERSION=1.7.9
16+
- DJANGO_VERSION=1.8.3
1617

1718
# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
1819
install:
@@ -28,19 +29,21 @@ script:
2829
matrix:
2930
exclude:
3031
- python: "3.2"
31-
env: DJANGO_VERSION=1.4.18
32+
env: DJANGO_VERSION=1.4.21
3233
- python: "3.3"
33-
env: DJANGO_VERSION=1.4.18
34+
env: DJANGO_VERSION=1.4.21
3435
- python: "3.4"
35-
env: DJANGO_VERSION=1.4.18
36+
env: DJANGO_VERSION=1.4.21
3637
- python: "3.2"
3738
env: DJANGO_VERSION=1.5.12
3839
- python: "3.3"
3940
env: DJANGO_VERSION=1.5.12
4041
- python: "3.4"
4142
env: DJANGO_VERSION=1.5.12
4243
- python: "2.6"
43-
env: DJANGO_VERSION=1.7.3
44+
env: DJANGO_VERSION=1.7.9
45+
- python: "2.6"
46+
env: DJANGO_VERSION=1.8.3
4447

4548
# Report to coveralls
4649
after_success:

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
History
44
-------
55

6+
6.2.0 (2015-08-15)
7+
++++++++++++++++++
8+
9+
* Improved tests
10+
* Make simple_tag output safe in Django 1.9
11+
* Better support for MultiWidgets (@xrmx)
12+
* Better documentation (@Moustacha)
13+
614

715
6.1.0 (2015-06-25)
816
++++++++++++++++++

README.rst

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
============================
2-
Welcome to django-bootstrap3
3-
============================
1+
======================
2+
Bootstrap 3 for Django
3+
======================
44

5-
.. image:: https://travis-ci.org/dyve/django-bootstrap3.png?branch=master
6-
:target: https://travis-ci.org/dyve/django-bootstrap3
5+
Write Django as usual, and let ``django-bootstrap3`` make template output into Bootstrap 3 code.
76

8-
.. image:: https://coveralls.io/repos/dyve/django-bootstrap3/badge.png?branch=develop
9-
:target: https://coveralls.io/r/dyve/django-bootstrap3?branch=develop
107

11-
.. image:: https://badge.fury.io/py/django-bootstrap3.png
12-
:target: http://badge.fury.io/py/django-bootstrap3
8+
.. image:: https://img.shields.io/travis/dyve/django-bootstrap3/master.svg
9+
:target: https://travis-ci.org/dyve/django-bootstrap3
1310

14-
.. image:: https://pypip.in/d/django-bootstrap3/badge.png
15-
:target: https://crate.io/packages/django-bootstrap3?version=latest
11+
.. image:: https://img.shields.io/coveralls/dyve/django-bootstrap3/master.svg
12+
:target: https://coveralls.io/r/dyve/django-bootstrap3?branch=master
1613

14+
.. image:: https://img.shields.io/pypi/v/django-bootstrap3.svg
15+
:target: https://pypi.python.org/pypi/django-bootstrap3
16+
:alt: Latest PyPI version
1717

18-
Use Bootstrap in your Django templates, the Django way.
18+
.. image:: https://img.shields.io/pypi/dm/django-bootstrap3.svg
19+
:target: https://pypi.python.org/pypi/django-bootstrap3
20+
:alt: Number of PyPI downloads per month
1921

2022

2123
Installation

bootstrap3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '6.1.0'
3+
__version__ = '6.2.0'

bootstrap3/components.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from __future__ import unicode_literals
33

44
from django.forms.widgets import flatatt
5+
from django.utils.safestring import mark_safe
6+
from bootstrap3.utils import render_tag
57

68
from .text import text_value
79

@@ -15,7 +17,7 @@ def render_icon(icon, title=''):
1517
}
1618
if title:
1719
attrs['title'] = title
18-
return '<span{attrs}></span>'.format(attrs=flatatt(attrs))
20+
return render_tag('span', attrs=attrs)
1921

2022

2123
def render_alert(content, alert_type=None, dismissable=True):
@@ -30,8 +32,9 @@ def render_alert(content, alert_type=None, dismissable=True):
3032
css_classes.append('alert-dismissable')
3133
button = '<button type="button" class="close" ' + \
3234
'data-dismiss="alert" aria-hidden="true">&times;</button>'
33-
return '<div class="{css_classes}">{button}{content}</div>'.format(
34-
css_classes=' '.join(css_classes),
35-
button=button,
36-
content=text_value(content),
37-
)
35+
button_placeholder = '__BUTTON__'
36+
return mark_safe(render_tag(
37+
'div',
38+
attrs={'class': ' '.join(css_classes)},
39+
content=button_placeholder + text_value(content),
40+
).replace(button_placeholder, button))

bootstrap3/forms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ def render_button(
117117
if value:
118118
attrs['value'] = value
119119
return render_tag(
120-
tag, attrs=attrs, content=text_concat(
121-
icon_content, content, separator=' '))
120+
tag,
121+
attrs=attrs,
122+
content=text_concat(icon_content, content, separator=' '),
123+
)
122124

123125

124126
def render_field_and_label(

bootstrap3/legacy.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.utils.html import conditional_escape
2+
from django.utils.safestring import mark_safe
3+
4+
5+
def format_html_pre_18(format_string, *args, **kwargs):
6+
"""
7+
Fake function to support format_html in Django < 1.8
8+
"""
9+
args_safe = map(conditional_escape, args)
10+
kwargs_safe = {}
11+
for k in kwargs:
12+
kwargs_safe[k] = conditional_escape(kwargs[k])
13+
return mark_safe(format_string.format(*args_safe, **kwargs_safe))

0 commit comments

Comments
 (0)