File tree Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 4
4
-------
5
5
6
6
7
+ 6.0.0 (2015-04-21)
8
+ ++++++++++++++++++
9
+
10
+ * No more media="screen" in CSS tags, complying to Bootstraps examples
11
+
12
+
7
13
5.4.0 (2015-04-21)
8
14
++++++++++++++++++
9
15
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
- __version__ = '5.4 .0'
3
+ __version__ = '6.0 .0'
Original file line number Diff line number Diff line change @@ -141,16 +141,18 @@ def test_settings(self):
141
141
from .bootstrap import BOOTSTRAP3
142
142
self .assertTrue (BOOTSTRAP3 )
143
143
144
+ def test_bootstrap_javascript_tag (self ):
145
+ res = render_template ('{% bootstrap_javascript %}' )
146
+ self .assertEqual (res .strip (), '<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>' )
147
+
148
+ def test_bootstrap_css_tag (self ):
149
+ res = render_template ('{% bootstrap_css %}' )
150
+ self .assertEqual (res .strip (), '<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">' )
151
+
144
152
def test_settings_filter (self ):
145
- res = render_template (
146
- '{% load bootstrap3 %}' +
147
- '{{ "required_css_class"|bootstrap_setting }}' )
153
+ res = render_template ('{{ "required_css_class"|bootstrap_setting }}' )
148
154
self .assertEqual (res .strip (), 'bootstrap3-req' )
149
- res = render_template (
150
- '{% load bootstrap3 %}' +
151
- '{% if "javascript_in_head"|bootstrap_setting %}' +
152
- 'head{% else %}body{% endif %}'
153
- )
155
+ res = render_template ('{% if "javascript_in_head"|bootstrap_setting %}head{% else %}body{% endif %}' )
154
156
self .assertEqual (res .strip (), 'head' )
155
157
156
158
def test_required_class (self ):
Original file line number Diff line number Diff line change 7
7
from django .template import Variable , VariableDoesNotExist
8
8
from django .template .base import FilterExpression , kwarg_re , TemplateSyntaxError
9
9
10
-
11
10
from .text import text_value
12
11
13
12
@@ -97,14 +96,17 @@ def remove_css_class(css_classes, css_class):
97
96
return ' ' .join (classes_list )
98
97
99
98
100
- def render_link_tag (url , rel = 'stylesheet' , media = 'all' ):
99
+ def render_link_tag (url , rel = 'stylesheet' , media = None ):
101
100
"""
102
101
Build a link tag
103
102
"""
104
- return render_tag (
105
- 'link' ,
106
- attrs = {'href' : url , 'rel' : rel , 'media' : media },
107
- close = False )
103
+ attrs = {
104
+ 'href' : url ,
105
+ 'rel' : rel ,
106
+ }
107
+ if media :
108
+ attrs ['media' ] = media
109
+ return render_tag ('link' , attrs = attrs , close = False )
108
110
109
111
110
112
def render_tag (tag , attrs = None , content = None , close = True ):
You can’t perform that action at this time.
0 commit comments