From 835e11c206aa3782ebbe3a46bfec0a67a92ea98a Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 12 Nov 2024 12:25:03 +0100 Subject: [PATCH] Remove fallback form rendering from uncrispified forms For more information see #3140 and #3157 --- .../nav/web/templates/alertprofiles/base_detail.html | 6 +----- .../templates/alertprofiles/subscription_form.html | 6 +----- .../web/templates/alertprofiles/timeperiod_edit.html | 6 +----- .../web/templates/alertprofiles/timeperiod_form.html | 6 +----- python/nav/web/templates/arnold/justifications.html | 6 +----- .../web/templates/devicehistory/history_search.html | 6 +----- .../web/templates/devicehistory/history_view.html | 6 +----- python/nav/web/templates/ipdevinfo/modules.html | 6 +----- python/nav/web/templates/ipdevinfo/search.html | 6 +----- .../nav/web/templates/ipdevinfo/sensor-details.html | 6 +----- python/nav/web/templates/macwatch/addmacwatch.html | 6 +----- python/nav/web/templates/maintenance/new_task.html | 6 +----- python/nav/web/templates/messages/save.html | 6 +----- python/nav/web/templates/navlets/alert_edit.html | 6 +----- python/nav/web/templates/portadmin/base.html | 6 +----- python/nav/web/templates/seeddb/netbox_wizard.html | 6 +----- .../nav/web/templates/sortedstats/sortedstats.html | 6 +----- python/nav/web/templates/status2/status.html | 6 +----- .../nav/web/templates/threshold/set_threshold.html | 6 +----- python/nav/web/templates/useradmin/group_detail.html | 6 +----- python/nav/web/templates/webfront/login.html | 6 +----- python/nav/web/templates/webfront/preferences.html | 12 ++---------- 22 files changed, 23 insertions(+), 115 deletions(-) diff --git a/python/nav/web/templates/alertprofiles/base_detail.html b/python/nav/web/templates/alertprofiles/base_detail.html index c4aed7a100..289d22f20b 100644 --- a/python/nav/web/templates/alertprofiles/base_detail.html +++ b/python/nav/web/templates/alertprofiles/base_detail.html @@ -14,11 +14,7 @@

- {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %} {% block form_additional_fields %} {% endblock %} diff --git a/python/nav/web/templates/alertprofiles/subscription_form.html b/python/nav/web/templates/alertprofiles/subscription_form.html index 55b46a7a79..65eb0caa24 100644 --- a/python/nav/web/templates/alertprofiles/subscription_form.html +++ b/python/nav/web/templates/alertprofiles/subscription_form.html @@ -83,11 +83,7 @@
{{ editing|yesno:"Edit,Add new" }} subscription
Add your first filter group to fix this problem. {% endif %} - {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %}
diff --git a/python/nav/web/templates/alertprofiles/timeperiod_edit.html b/python/nav/web/templates/alertprofiles/timeperiod_edit.html index 6fc7c471f9..5be4056737 100644 --- a/python/nav/web/templates/alertprofiles/timeperiod_edit.html +++ b/python/nav/web/templates/alertprofiles/timeperiod_edit.html @@ -4,10 +4,6 @@
- {% if time_period_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %} - {% else %} - {{ time_period_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %}
{% endblock %} diff --git a/python/nav/web/templates/alertprofiles/timeperiod_form.html b/python/nav/web/templates/alertprofiles/timeperiod_form.html index 3ce021324b..4882592b18 100644 --- a/python/nav/web/templates/alertprofiles/timeperiod_form.html +++ b/python/nav/web/templates/alertprofiles/timeperiod_form.html @@ -4,8 +4,4 @@

Edit time period

Add new time period

{% endif %} -{% if time_period_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %} -{% else %} - {{ time_period_form }} -{% endif %} +{% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %} diff --git a/python/nav/web/templates/arnold/justifications.html b/python/nav/web/templates/arnold/justifications.html index a9bb20aff1..c9bb74954e 100644 --- a/python/nav/web/templates/arnold/justifications.html +++ b/python/nav/web/templates/arnold/justifications.html @@ -50,11 +50,7 @@ {% comment %} Form for creating new justifications {% endcomment %}
- {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %}
diff --git a/python/nav/web/templates/devicehistory/history_search.html b/python/nav/web/templates/devicehistory/history_search.html index fb8da9f750..29b7401084 100644 --- a/python/nav/web/templates/devicehistory/history_search.html +++ b/python/nav/web/templates/devicehistory/history_search.html @@ -10,11 +10,7 @@
- {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %}
diff --git a/python/nav/web/templates/devicehistory/history_view.html b/python/nav/web/templates/devicehistory/history_view.html index da833980fe..801e8d515c 100644 --- a/python/nav/web/templates/devicehistory/history_view.html +++ b/python/nav/web/templates/devicehistory/history_view.html @@ -11,11 +11,7 @@ {% endfor %} {% endfor %} - {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %}
diff --git a/python/nav/web/templates/ipdevinfo/modules.html b/python/nav/web/templates/ipdevinfo/modules.html index 100dfcee07..96b02bb271 100644 --- a/python/nav/web/templates/ipdevinfo/modules.html +++ b/python/nav/web/templates/ipdevinfo/modules.html @@ -7,11 +7,7 @@
- {% if activity_interval_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=activity_interval_form %} - {% else %} - {{ activity_interval_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=activity_interval_form %}
diff --git a/python/nav/web/templates/ipdevinfo/search.html b/python/nav/web/templates/ipdevinfo/search.html index 723a38bccc..4c8bbd3725 100644 --- a/python/nav/web/templates/ipdevinfo/search.html +++ b/python/nav/web/templates/ipdevinfo/search.html @@ -6,11 +6,7 @@

IP Device search

- {% if search_form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' with form=search_form %} - {% else %} - {{ search_form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' with form=search_form %}
diff --git a/python/nav/web/templates/ipdevinfo/sensor-details.html b/python/nav/web/templates/ipdevinfo/sensor-details.html index 096aee7d9f..e8968d2283 100644 --- a/python/nav/web/templates/ipdevinfo/sensor-details.html +++ b/python/nav/web/templates/ipdevinfo/sensor-details.html @@ -104,11 +104,7 @@

Display values

Add to dashboard
- {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %}
{% else %} diff --git a/python/nav/web/templates/macwatch/addmacwatch.html b/python/nav/web/templates/macwatch/addmacwatch.html index 134ed23cb2..97495ef1c7 100644 --- a/python/nav/web/templates/macwatch/addmacwatch.html +++ b/python/nav/web/templates/macwatch/addmacwatch.html @@ -5,11 +5,7 @@
Back - {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %}
diff --git a/python/nav/web/templates/maintenance/new_task.html b/python/nav/web/templates/maintenance/new_task.html index a52be9eda0..526f99a876 100644 --- a/python/nav/web/templates/maintenance/new_task.html +++ b/python/nav/web/templates/maintenance/new_task.html @@ -35,11 +35,7 @@

{{ heading }}

Details - {% if task_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=task_form %} - {% else %} - {{ task_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=task_form %}
diff --git a/python/nav/web/templates/messages/save.html b/python/nav/web/templates/messages/save.html index b189e34f4c..cee3f7f603 100644 --- a/python/nav/web/templates/messages/save.html +++ b/python/nav/web/templates/messages/save.html @@ -23,11 +23,7 @@

{{ caption }}

- {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %}
diff --git a/python/nav/web/templates/navlets/alert_edit.html b/python/nav/web/templates/navlets/alert_edit.html index d48f09112d..83f371a4ad 100644 --- a/python/nav/web/templates/navlets/alert_edit.html +++ b/python/nav/web/templates/navlets/alert_edit.html @@ -12,11 +12,7 @@

- {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %} Cancel
diff --git a/python/nav/web/templates/portadmin/base.html b/python/nav/web/templates/portadmin/base.html index c8a874fe8d..61bc610723 100644 --- a/python/nav/web/templates/portadmin/base.html +++ b/python/nav/web/templates/portadmin/base.html @@ -22,11 +22,7 @@ {% block page_content %} - {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %} {% block content %} {% if form.is_bound %} diff --git a/python/nav/web/templates/seeddb/netbox_wizard.html b/python/nav/web/templates/seeddb/netbox_wizard.html index 0bd9befa99..81a671ac9e 100644 --- a/python/nav/web/templates/seeddb/netbox_wizard.html +++ b/python/nav/web/templates/seeddb/netbox_wizard.html @@ -40,11 +40,7 @@

{{ title }}

- {% if form.attrs %} - {% include 'seeddb/_seeddb_netbox_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'seeddb/_seeddb_netbox_form_content.html' %}
diff --git a/python/nav/web/templates/sortedstats/sortedstats.html b/python/nav/web/templates/sortedstats/sortedstats.html index 9e11a21a0f..41c659b7a6 100644 --- a/python/nav/web/templates/sortedstats/sortedstats.html +++ b/python/nav/web/templates/sortedstats/sortedstats.html @@ -22,11 +22,7 @@
{% endif %} - {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %} {# Display view if exists #} {% if result %} diff --git a/python/nav/web/templates/status2/status.html b/python/nav/web/templates/status2/status.html index 4889622630..ad8aee57af 100644 --- a/python/nav/web/templates/status2/status.html +++ b/python/nav/web/templates/status2/status.html @@ -29,11 +29,7 @@ {# Form for filtering events #} {% if id %} Delete diff --git a/python/nav/web/templates/useradmin/group_detail.html b/python/nav/web/templates/useradmin/group_detail.html index d161305e8b..c558056fb8 100644 --- a/python/nav/web/templates/useradmin/group_detail.html +++ b/python/nav/web/templates/useradmin/group_detail.html @@ -77,11 +77,7 @@

Create new group

{% endif %}
Add group member
- {% if account_form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' with form=account_form %} - {% else %} - {{ account_form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' with form=account_form %} {# END GROUP MEMBERS #} diff --git a/python/nav/web/templates/webfront/login.html b/python/nav/web/templates/webfront/login.html index 7f73c90cca..fda2bda3aa 100644 --- a/python/nav/web/templates/webfront/login.html +++ b/python/nav/web/templates/webfront/login.html @@ -48,11 +48,7 @@ {% endif %} - {% if form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' %} About audit logging in NAV diff --git a/python/nav/web/templates/webfront/preferences.html b/python/nav/web/templates/webfront/preferences.html index d81fb54d83..b4235332c8 100644 --- a/python/nav/web/templates/webfront/preferences.html +++ b/python/nav/web/templates/webfront/preferences.html @@ -61,11 +61,7 @@
- {% if columns_form.attrs %} - {% include 'custom_crispy_templates/flat_form.html' with form=columns_form %} - {% else %} - {{ columns_form }} - {% endif %} + {% include 'custom_crispy_templates/flat_form.html' with form=columns_form %}
@@ -79,11 +75,7 @@

{% else %}
- {% if password_form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' with form=password_form %} - {% else %} - {{ password_form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' with form=password_form %}
{% endif %}