From 990a6f51e88b7f291b84b5eaedac58ff4b56adf8 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:12:00 -0600 Subject: [PATCH] Add custom inline --- src/registrar/admin.py | 3 +- src/registrar/templates/admin/stacked.html | 51 +++++++++++++++++++ ...domain_information_inline_change_form.html | 6 +++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/registrar/templates/admin/stacked.html create mode 100644 src/registrar/templates/django/admin/domain_information_inline_change_form.html diff --git a/src/registrar/admin.py b/src/registrar/admin.py index b06111e5b..21850364e 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -69,6 +69,7 @@ class DomainInformationInlineForm(forms.ModelForm): widgets = { "other_contacts": NoAutocompleteFilteredSelectMultiple("other_contacts", False), } + template = "django/admin/domain_information_change_form.html" class DomainRequestAdminForm(forms.ModelForm): @@ -1440,8 +1441,8 @@ class DomainInformationInline(admin.StackedInline): from DomainInformationAdmin""" form = DomainInformationInlineForm - model = models.DomainInformation + template = "django/admin/domain_information_inline_change_form.html" fieldsets = copy.deepcopy(DomainInformationAdmin.fieldsets) # remove .gov domain from fieldset diff --git a/src/registrar/templates/admin/stacked.html b/src/registrar/templates/admin/stacked.html new file mode 100644 index 000000000..8eac01864 --- /dev/null +++ b/src/registrar/templates/admin/stacked.html @@ -0,0 +1,51 @@ +{% load i18n admin_urls %} +{% load i18n static %} + +{% comment %} +This is copied from Djangos implementation of this template, with added "blocks" +It is not inherently customizable on its own, so we can modify this instead. +https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/edit_inline/stacked.html +{% endcomment %} + +