File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
templates/bootstrap_toolkit Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 6262* to Twitter for building and releasing Bootstrap
6363* to the Django community for Django
6464* to the authors of django-bootstrap-form for the inspiration
65- * to Stefan Petre
65+ * to Stefan Petre for the datepicker
Original file line number Diff line number Diff line change 11{% spaceless %}
2- {% if prepend %}
3- < div class ="input-prepend "> < span class ="add-on "> {{ prepend }}</ span > {{ field }}</ div >
4- {% else %}
5- {% if append %}
6- < div class ="input-append "> {{ field }}< span class ="add-on "> {{ append }}</ span > </ div >
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 append=append|default:field.field.widget.bootstrap.append %}
6+ {% if prepend %}
7+ < div class ="input-prepend "> < span class ="add-on "> {{ prepend }}</ span > {{ field }}</ div >
78 {% else %}
8- {{ field }}
9+ {% if append %}
10+ < div class ="input-append "> {{ field }}< span class ="add-on "> {{ append }}</ span > </ div >
11+ {% else %}
12+ {{ field }}
13+ {% endif %}
914 {% endif %}
10- {% endif %}
11- {% endspaceless %}
15+ {% endwith %}
16+ {% endspaceless %}
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ def add_to_css_class(classes, new_class):
2121
2222class BootstrapDateInput (forms .TextInput ):
2323
24+ bootstrap = {
25+ 'append' : mark_safe ('<i class="icon-th"></i>' ),
26+ 'prepend' : None ,
27+ }
28+
2429 class Media :
2530 js = (
2631 settings .STATIC_URL + 'datepicker/js/bootstrap-datepicker.js' ,
You can’t perform that action at this time.
0 commit comments