diff --git a/gas/static/gas/css/gas.css b/gas/static/gas/css/gas.css index 7d40f4d..7b3f257 100644 --- a/gas/static/gas/css/gas.css +++ b/gas/static/gas/css/gas.css @@ -119,7 +119,17 @@ ul.actions li { .form-control { border: 1px solid #ccc; box-shadow: inset 0 1px 1px rgba(0,0,0,.075); - } + width: 100%; +} + +.checkbox .form-control { + min-width: auto; + width: auto; +} + +.checkbox label { + padding-right: 1em; +} .errorlist { display: block;; @@ -151,7 +161,7 @@ textarea { } .form-inline .form-group { - vertical-align: middle; + vertical-align: top; display: inline-block; margin-bottom: 0; } @@ -160,14 +170,6 @@ textarea { min-width: 15em; } -.form-inline .checkbox .form-control { - min-width: auto; -} - -.form-inline .checkbox label { - padding-right: 1em; -} - .form-inline .form-control.select2 { display: inline-block; } diff --git a/gas/templates/gas/tags/forms/field.html b/gas/templates/gas/tags/forms/field.html index 9d7306c..8bf61c3 100644 --- a/gas/templates/gas/tags/forms/field.html +++ b/gas/templates/gas/tags/forms/field.html @@ -4,7 +4,7 @@ {% if field.field.required %} required{% endif %} {% if field.errors %} has-error{% endif %} "> - + {% add_widget_attrs field placeholder=field.label %} {{ field }} diff --git a/gas/templatetags/form_tags.py b/gas/templatetags/form_tags.py index ff39bfc..a49f965 100644 --- a/gas/templatetags/form_tags.py +++ b/gas/templatetags/form_tags.py @@ -7,14 +7,15 @@ from django.urls import reverse register = template.Library() -def base_form_field(field, css='form-control', container_class='', add_another_url=None, field_template=None): +def base_form_field(field, css=None, container_class='', add_another_url=None, field_template=None): if field.is_hidden: return str(field) classes = field.field.widget.attrs.get('class', '').split(' ') + classes.append('form-control') if css: - classes.append(css) + classes.append(css) if isinstance(field.field.widget, forms.Select): classes.append('select2')