Skip to content

Commit

Permalink
Upgrade crispy to 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sshwsfc committed Sep 4, 2013
1 parent fe0eb2c commit 1240d0d
Show file tree
Hide file tree
Showing 36 changed files with 44 additions and 412 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django>=1.4
django-crispy-forms>=1.2.3
django-crispy-forms>=1.4.0
2 changes: 1 addition & 1 deletion xadmin/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Container(layout.Div):
# Override bootstrap3
class InputGroup(layout.Field):

template = "bootstrap3/layout/input_group.html"
template = "xadmin/layout/input_group.html"

def __init__(self, field, *args, **kwargs):
self.field = field
Expand Down
25 changes: 20 additions & 5 deletions xadmin/static/xadmin/css/xadmin.form.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,44 @@ select.selectmultiple {
.select2-container{
width: 100%;
}
.select2-container.form-control{
padding: 0px;
border: 0px;
}
.select2-container .select2-choice {
height: 35px;
padding-top: 3px;
}

/* form css */
.form-container .column{
min-height: 60px;
}
.form-group {
margin-right: -15px;
margin-left: -15px;
}
.control-label {
padding: 6px 10px;
font-weight: bold;
}
.controls {
padding: 0px 15px 0px 15px;
}
.controls:before,
.controls:after {
display: table;
content: " ";
}
.controls:after {
clear: both;
}
.control-wrap {
display: block;
width: 100%;
padding-right: 45px;
}
.asterisk_field {
.asteriskField, .asterisk-field {
color: red;
}

Expand All @@ -34,10 +53,6 @@ select.selectmultiple {
display: inline-block;
}

.controls > .radio:first-child,
.controls > .checkbox:first-child {
margin-top: 0px;
}
.help-block {
margin-bottom: 0px;
}
Expand Down
10 changes: 0 additions & 10 deletions xadmin/templates/bootstrap3/accordion-group.html

This file was deleted.

3 changes: 0 additions & 3 deletions xadmin/templates/bootstrap3/accordion.html

This file was deleted.

22 changes: 0 additions & 22 deletions xadmin/templates/bootstrap3/betterform.html

This file was deleted.

8 changes: 0 additions & 8 deletions xadmin/templates/bootstrap3/display_form.html

This file was deleted.

8 changes: 0 additions & 8 deletions xadmin/templates/bootstrap3/errors.html

This file was deleted.

10 changes: 0 additions & 10 deletions xadmin/templates/bootstrap3/errors_formset.html

This file was deleted.

29 changes: 13 additions & 16 deletions xadmin/templates/bootstrap3/field.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
{% load crispy_forms_field %}

{% if field.is_hidden %}
{{ field }}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group row{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} has-error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">

{% if field.label and not field|is_checkbox %}
<label for="{{ field.id_for_label }}" class="control-label">
{{ field.label|safe }}{% if field.field.required %}<span class="asterisk_field">*</span>{% endif %}
</label>
{% endif %}
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="form-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} has-error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label and not field|is_checkbox and form_show_labels %}
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}

{% if field|css_class == "checkboxselectmultiple" %}
{% if field|is_checkboxselectmultiple %}
{% include 'bootstrap3/layout/checkboxselectmultiple.html' %}
{% endif %}

{% if field|css_class == "radioselect" %}
{% if field|is_radioselect %}
{% include 'bootstrap3/layout/radioselect.html' %}
{% endif %}

{% if field|css_class != "checkboxselectmultiple" and field|css_class != "radioselect" %}
<div class="controls clearfix">
{% if not field|is_checkboxselectmultiple and not field|is_radioselect %}
<div class="controls {{ field_class }}">
{% if field|is_checkbox %}
<label for="{{ field.id_for_label }}" class="checkbox {% if field.field.required %}requiredField{% endif %}">
<label for="{{ field.id_for_label }}" class="checkbox {% if field.field.required %} requiredField{% endif %}">
{% crispy_field field %}
{{ field.label|safe }}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</label>
{% else %}
{% block normal_field %}
{% crispy_field field %}
{% endblock normal_field %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
{% endif %}
</div>
{% endif %}
</div>
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
{% endif %}
31 changes: 0 additions & 31 deletions xadmin/templates/bootstrap3/field.strict.html

This file was deleted.

24 changes: 0 additions & 24 deletions xadmin/templates/bootstrap3/layout/appended_prepended_text.html

This file was deleted.

23 changes: 0 additions & 23 deletions xadmin/templates/bootstrap3/layout/appended_text.html

This file was deleted.

9 changes: 0 additions & 9 deletions xadmin/templates/bootstrap3/layout/baseinput.html

This file was deleted.

1 change: 0 additions & 1 deletion xadmin/templates/bootstrap3/layout/button.html

This file was deleted.

11 changes: 0 additions & 11 deletions xadmin/templates/bootstrap3/layout/checkboxselectmultiple.html

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions xadmin/templates/bootstrap3/layout/field_errors.html

This file was deleted.

5 changes: 0 additions & 5 deletions xadmin/templates/bootstrap3/layout/field_errors_block.html

This file was deleted.

17 changes: 0 additions & 17 deletions xadmin/templates/bootstrap3/layout/field_with_buttons.html

This file was deleted.

3 changes: 0 additions & 3 deletions xadmin/templates/bootstrap3/layout/formactions.html

This file was deleted.

7 changes: 0 additions & 7 deletions xadmin/templates/bootstrap3/layout/help_text.html

This file was deleted.

13 changes: 0 additions & 13 deletions xadmin/templates/bootstrap3/layout/help_text_and_errors.html

This file was deleted.

27 changes: 0 additions & 27 deletions xadmin/templates/bootstrap3/layout/multifield.html

This file was deleted.

Loading

0 comments on commit 1240d0d

Please sign in to comment.