diff --git a/muranodashboard/panel/forms.py b/muranodashboard/panel/forms.py index 59e4ae715..12a4100b9 100644 --- a/muranodashboard/panel/forms.py +++ b/muranodashboard/panel/forms.py @@ -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'), diff --git a/muranodashboard/templates/_horizon_form_fields.html b/muranodashboard/templates/_horizon_form_fields.html index 99da44ec2..6e4efff92 100644 --- a/muranodashboard/templates/_horizon_form_fields.html +++ b/muranodashboard/templates/_horizon_form_fields.html @@ -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 %}
- {{ field.label_tag }} + {% if field|is_checkbox %} + {{ field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }} {% if field.errors %} {% for error in field.errors %} {{ error }} @@ -18,5 +23,6 @@
{{ field }}
+ {% endif %}
{% endfor %} diff --git a/muranodashboard/templatetags/__init__.py b/muranodashboard/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/muranodashboard/templatetags/custom_filters.py b/muranodashboard/templatetags/custom_filters.py new file mode 100644 index 000000000..5102abd5d --- /dev/null +++ b/muranodashboard/templatetags/custom_filters.py @@ -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'