Split checkbox input and label in one line

Change-Id: I68576607cd4d34743f7b12c3ed6f50aaf631d961
This commit is contained in:
Ekaterina Fedorova 2013-07-19 13:03:17 +04:00
parent 9f7f785358
commit e8971b77ca
4 changed files with 20 additions and 1 deletions

View File

@ -278,6 +278,10 @@ class WizardFormMSSQLConfiguration(WizardFormIISConfiguration,
label=_('Mixed-mode Authentication '),
initial=True,
required=False)
#add style to split label and checkbox
mixed_mode.widget.attrs['style'] = 'float: left; \
width: auto; \
margin-right: 10px;'
password_field1 = PasswordField(
_('SA password'),

View File

@ -1,3 +1,5 @@
{% load custom_filters %}
{% for hidden in wizard.form.hidden_fields %}
{{ hidden }}
{% endfor %}
@ -8,7 +10,10 @@
{% endif %}
{% for field in wizard.form.visible_fields %}
<div class="control-group form-field clearfix{% if field.errors %} error{% endif %}">
{{ field.label_tag }}
{% if field|is_checkbox %}
{{ field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.errors %}
{% for error in field.errors %}
<span class="help-inline">{{ error }}</span>
@ -18,5 +23,6 @@
<div class="input">
{{ field }}
</div>
{% endif %}
</div>
{% endfor %}

View File

View File

@ -0,0 +1,9 @@
from django import template
register = template.Library()
@register.filter(name='is_checkbox')
def is_checkbox(field):
return field.field.widget.__class__.__name__ == 'CheckboxInput'