diff --git a/python/nav/web/seeddb/forms/__init__.py b/python/nav/web/seeddb/forms/__init__.py index e2170eef9a..5bdc5eef0b 100644 --- a/python/nav/web/seeddb/forms/__init__.py +++ b/python/nav/web/seeddb/forms/__init__.py @@ -126,7 +126,7 @@ def cut_branch(field, klass, pk): return [c for c in field.choices if c[0] not in descendant_ids] -# non-crispy helpers +# helpers def get_single_layout(heading, row): diff --git a/python/nav/web/seeddb/page/service/edit.py b/python/nav/web/seeddb/page/service/edit.py index 146528691e..a52443525a 100644 --- a/python/nav/web/seeddb/page/service/edit.py +++ b/python/nav/web/seeddb/page/service/edit.py @@ -24,7 +24,6 @@ from nav.models.service import Service, ServiceProperty from nav.models.manage import Netbox -from nav.web.crispyforms import set_flat_form_attributes from nav.web.servicecheckers import get_description, load_checker_classes from nav.web.message import new_message, Messages from nav.web.seeddb.page.service import ServiceInfo @@ -45,8 +44,6 @@ def __init__(self, *args, **kwargs): widget=forms.Select(attrs={'class': 'select2'}), ) - self.attrs = set_flat_form_attributes() - @staticmethod def _build_checker_choices(): checkers = load_checker_classes() @@ -75,8 +72,6 @@ class ServiceForm(forms.Form): handler = forms.CharField(widget=forms.HiddenInput) netbox = forms.IntegerField(widget=forms.HiddenInput) - attrs = set_flat_form_attributes() - class ServicePropertyForm(forms.Form): """Form for editing service properties""" @@ -94,8 +89,6 @@ def __init__(self, *args, **kwargs): for arg, descr in opt_args: self.fields[arg] = forms.CharField(required=False, help_text=descr) - self.attrs = set_flat_form_attributes() - def service_edit(request, service_id=None): """Controller for editing services""" diff --git a/python/nav/web/templates/seeddb/edit.html b/python/nav/web/templates/seeddb/edit.html index 0c68208a30..3fd9f1901a 100644 --- a/python/nav/web/templates/seeddb/edit.html +++ b/python/nav/web/templates/seeddb/edit.html @@ -1,6 +1,4 @@ {% extends "seeddb/base.html" %} -{% load crispy_forms_tags %} - {% block base_header_additional_head %} {{ block.super }} @@ -41,13 +39,9 @@

{{ title }}
Attributes - {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {% block crispyfields %} - {{ form|crispy }} - {% endblock %} - {% endif %} + {% block formfields %} + {% include 'custom_crispy_templates/_form_content.html' %} + {% endblock %}
diff --git a/python/nav/web/templates/seeddb/edit_prefix.html b/python/nav/web/templates/seeddb/edit_prefix.html index 1c81a208fc..cd4e24761c 100644 --- a/python/nav/web/templates/seeddb/edit_prefix.html +++ b/python/nav/web/templates/seeddb/edit_prefix.html @@ -1,5 +1,5 @@ {% extends "seeddb/edit.html" %} -{% block crispyfields %} +{% block formfields %} {{ block.super }} {% include 'custom_crispy_templates/_form_content.html' with form=vlan_form %} {% endblock %} diff --git a/python/nav/web/templates/seeddb/edit_vlan.html b/python/nav/web/templates/seeddb/edit_vlan.html index 41dc68e875..49a808f9f9 100644 --- a/python/nav/web/templates/seeddb/edit_vlan.html +++ b/python/nav/web/templates/seeddb/edit_vlan.html @@ -1,5 +1,5 @@ {% extends "seeddb/edit.html" %} -{% block crispyfields %} +{% block formfields %}

Net type
{{ object.net_type }}

diff --git a/python/nav/web/templates/seeddb/list.html b/python/nav/web/templates/seeddb/list.html index d1ff5bc3ca..f286f4a9a4 100644 --- a/python/nav/web/templates/seeddb/list.html +++ b/python/nav/web/templates/seeddb/list.html @@ -1,23 +1,14 @@ {% extends "seeddb/base.html" %} -{% load crispy_forms_tags %} {% block content %} {% if filter_form %} {% if filter_form.base_fields|length >= 3 %} - {% if filter_form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' with form=filter_form %} - {% else %} - {{ filter_form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' with form=filter_form %} {% else %}
- {% if filter_form.attrs %} {% include 'custom_crispy_templates/flat_form.html' with form=filter_form %} - {% else %} - {% crispy filter_form %} - {% endif %}
{% endif %} diff --git a/python/nav/web/templates/seeddb/service_netbox_form.html b/python/nav/web/templates/seeddb/service_netbox_form.html index a2024f9c1f..72c6059000 100644 --- a/python/nav/web/templates/seeddb/service_netbox_form.html +++ b/python/nav/web/templates/seeddb/service_netbox_form.html @@ -15,11 +15,7 @@

Add new service checker - {% if choice_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=choice_form %} - {% else %} - {{ choice_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=choice_form %}
diff --git a/python/nav/web/templates/seeddb/service_property_form.html b/python/nav/web/templates/seeddb/service_property_form.html index 4c9c50bfe1..b93706168b 100644 --- a/python/nav/web/templates/seeddb/service_property_form.html +++ b/python/nav/web/templates/seeddb/service_property_form.html @@ -19,17 +19,9 @@

Attributes - {% if service_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=service_form %} - {% else %} - {{ service_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=service_form %} {% if property_form.fields %} - {% if property_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=property_form %} - {% else %} - {{ property_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=property_form %} {% else %}
There are no attributes for this service.