Skip to content

Commit 432744b

Browse files
author
Dylan Verheul
committed
Bug fixes
1 parent da0c144 commit 432744b

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
{% spaceless %}
2-
{% comment %}
3-
Spaceless is required here to make sure prepend and append work properly
4-
{% endcomment %}
5-
{% with prepend=prepend|default:field.field.widget.bootstrap.prepend|default:"" append=append|default:field.field.widget.bootstrap.append|default:"" %}
6-
{% if prepend %}
7-
<div class="input-prepend"><span class="add-on">{{ prepend }}</span>{{ field }}</div>
8-
{% else %}
9-
{% if append %}
10-
<div class="input-append">{{ field }}<span class="add-on">{{ append }}</span></div>
1+
{% comment %}
2+
Spaceless is required here to make sure prepend and append work properly
3+
{% endcomment %}
4+
{% if field.field.widget.bootstrap %}
5+
{% with bootstrap as field.field.widget.bootstrap %}
6+
{% with prepend=prepend|default:field.field.widget.bootstrap.prepend|default:"" append=append|default:field.field.widget.bootstrap.append|default:"" %}
7+
{% if prepend %}
8+
{% if append %}
9+
<div class="input-prepend input-append">
10+
<span class="add-on">{{ prepend }}</span>{{ field }}<span class="add-on">{{ append }}</span>
11+
</div>
12+
{% else %}
13+
<div class="input-prepend">
14+
<span class="add-on">{{ prepend }}</span>{{ field }}
15+
</div>
16+
{% endif %}
1117
{% else %}
12-
{{ field }}
18+
{% if append %}
19+
<div class="input-append">
20+
{{ field }}<span class="add-on">{{ append }}</span>
21+
</div>
22+
{% else %}
23+
{{ field }}
24+
{% endif %}
1325
{% endif %}
14-
{% endif %}
26+
{% endwith %}
1527
{% endwith %}
16-
{% endspaceless %}
28+
{% else %}
29+
{{ field }}
30+
{% endif %}

Diff for: bootstrap_toolkit/templates/bootstrap_toolkit/field_vertical.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{% include "bootstrap_toolkit/field_errors.html" with inline=False %}
2323
</div>
2424
{% else %}
25-
<label class="contral-label"{% if field.auto_id %} for="{{ field.auto_id }}"{% endif %}>{{ field.label }}</label>
25+
<label class="control-label"{% if field.auto_id %} for="{{ field.auto_id }}"{% endif %}>{{ field.label }}</label>
2626
<div class="controls">
2727
{% include "bootstrap_toolkit/field_default.html" %}
2828
{% include "bootstrap_toolkit/field_help.html" with inline=True %}

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='django-bootstrap-toolkit',
5-
version='2.5.1',
5+
version='2.5.2',
66
url='https://github.com/dyve/django-bootstrap-toolkit',
77
author='Dylan Verheul',
88
author_email='[email protected]',

0 commit comments

Comments
 (0)