diff --git a/python/nav/web/arnold/forms.py b/python/nav/web/arnold/forms.py index 024138fdc3..d47b901a1e 100644 --- a/python/nav/web/arnold/forms.py +++ b/python/nav/web/arnold/forms.py @@ -26,6 +26,7 @@ CheckBox, FlatFieldset, FormColumn, + FormDiv, FormRow, SubmitField, set_flat_form_attributes, @@ -302,22 +303,25 @@ def clean(self): return cleaned_data def __init__(self, *args, **kwargs): - self.helper = FormHelper() - self.helper.form_tag = False - self.helper.layout = Layout( - 'target', - 'method', - Div('qvlan', css_class='qvlanrow'), - 'justification', - 'comment', - 'days', - Submit('submit', 'Detain'), - ) - super(ManualDetentionForm, self).__init__(*args, **kwargs) self.fields['justification'].choices = get_justifications() self.fields['qvlan'].choices = get_quarantine_vlans() + self.attrs = set_flat_form_attributes( + form_fields=[ + self['target'], + self['method'], + FormDiv( + fields=[self['qvlan']], + css_classes='qvlanrow', + ), + self['justification'], + self['comment'], + self['days'], + ], + submit_field=SubmitField(value='Detain'), + ) + def get_justifications(profileid=None): """Return list of justifications ready for use as choices in forms diff --git a/python/nav/web/templates/arnold/manualdetain-step2.html b/python/nav/web/templates/arnold/manualdetain-step2.html index 6bbd72ac70..8e8c7471ca 100644 --- a/python/nav/web/templates/arnold/manualdetain-step2.html +++ b/python/nav/web/templates/arnold/manualdetain-step2.html @@ -1,5 +1,4 @@ {% extends 'arnold/base.html' %} -{% load crispy_forms_tags %} {% load info %} @@ -68,7 +67,7 @@ {# Display form for setting detention choices. #} - {% crispy form %} + {% include 'custom_crispy_templates/_form_content.html' %} {# formcontainer #}