From be2d1412d8fd7d7ab5c9e407a6caf7e2f41ae94e Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Thu, 21 Sep 2023 14:37:47 +0200 Subject: [PATCH] Remove provider change form template overrides We relied on these before, to make tags and autocomplete work, but we no longer need them --- .../accounts/hostingprovider/change_form.html | 154 +++++++----------- 1 file changed, 56 insertions(+), 98 deletions(-) diff --git a/templates/admin/accounts/hostingprovider/change_form.html b/templates/admin/accounts/hostingprovider/change_form.html index dc3c5c73..81230b7b 100644 --- a/templates/admin/accounts/hostingprovider/change_form.html +++ b/templates/admin/accounts/hostingprovider/change_form.html @@ -1,111 +1,69 @@ {% extends "admin/change_form.html" %} -{% block extrahead %} - -{{ media }} - -{% comment %} - -This introduces hard coding of the media elements in as a last ditch attempt to get past the infuriating "no tags when debug off" issue, on the hosting provider page. -below is the same output as is generated by outputing: - -{% block.super %} - -... but we are serving unminified versions of all the files. - -{% endcomment %} - - - - - - - - - - - - - - - - - - - - - - - -{% endblock %} - - {% block field_sets %} - {% for fieldset in adminform %} - {% if fieldset.name == "Hostingprovider info" %} - {% include "admin/accounts/hostingprovider/hosting_provider_fieldset.html" %} - {% elif fieldset.name == "Datacenter info" %} - {% include "admin/accounts/hostingprovider/data_center_fieldset.html" %} - {% else %} - {% include "admin/includes/fieldset.html" %} - {% endif %} - {% endfor %} + {% for fieldset in adminform %} + {% if fieldset.name == "Hostingprovider info" %} + {% include "admin/accounts/hostingprovider/hosting_provider_fieldset.html" %} + {% elif fieldset.name == "Datacenter info" %} + {% include "admin/accounts/hostingprovider/data_center_fieldset.html" %} + {% else %} + {% include "admin/includes/fieldset.html" %} + {% endif %} + {% endfor %} {% endblock %} {% block inline_field_sets %} -{% for inline_admin_formset in inline_admin_formsets %} - {% comment %} + {% for inline_admin_formset in inline_admin_formsets %} + {% comment %} We only want to serve the special inline tabular version of the IP approvals widgets and for IP range widgets, - as some providers have massive numbers that stop the page loading + as some providers have massive numbers that stop the page loading properly. The rest we want to serve as using their default inlines. {% endcomment %} - {% if inline_admin_formset.opts.verbose_name_plural == "IP approvals" %} - - {% if ip_approval_count > 500 %} -
-

- {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} -

-

- There are {{ ip_approval_count }} ip approval requests associated with this provider, which is too many to show on this page. Follow this - - this link to the bulk editing interface, with this provider pre-selected. - -

-
- {% else %} - {% include "admin/accounts/hostingprovider/inline_tabular.html" %} - {% endif %} - - {% elif inline_admin_formset.opts.verbose_name_plural == "IPs" %} - - {% if ip_range_count > 500 %} -
-

- {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} -

- -

- There are {{ ip_range_count }} ip ranges associated with this provider, which is too many to show on this page. Follow this - - this link to the bulk editing interface, with this provider pre-selected. - -

-
- {% else %} -

- {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} -

- {% include "admin/accounts/hostingprovider/inline_tabular.html" %} - {% endif %} - - {% else %} - {% include inline_admin_formset.opts.template %} - {% endif %} -{% endfor %} + {% if inline_admin_formset.opts.verbose_name_plural == "IP approvals" %} + + {% if ip_approval_count > 500 %} +
+

+ {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} +

+

+ There are {{ ip_approval_count }} ip approval requests associated with this provider, which is too many to show on this page. Follow this + + this link to the bulk editing interface, with this provider pre-selected. + +

+
+ {% else %} + {% include "admin/accounts/hostingprovider/inline_tabular.html" %} + {% endif %} + + {% elif inline_admin_formset.opts.verbose_name_plural == "IPs" %} + + {% if ip_range_count > 500 %} +
+

+ {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} +

+ +

+ There are {{ ip_range_count }} ip ranges associated with this provider, which is too many to show on this page. Follow this + + this link to the bulk editing interface, with this provider pre-selected. + +

+
+ {% else %} +

+ {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} +

+ {% include "admin/accounts/hostingprovider/inline_tabular.html" %} + {% endif %} + + {% else %} + {% include inline_admin_formset.opts.template %} + {% endif %} + {% endfor %} {% endblock %} - -