mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-12 14:08:28 +02:00
Change file name
This commit is contained in:
parent
f37eafdc53
commit
4d043e586f
5 changed files with 26 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
from datetime import date
|
from datetime import date
|
||||||
import logging
|
import logging
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.db.models import Value, CharField, Q
|
from django.db.models import Value, CharField, Q
|
||||||
from django.db.models.functions import Concat, Coalesce
|
from django.db.models.functions import Concat, Coalesce
|
||||||
|
@ -1436,9 +1437,16 @@ class DomainInformationInline(admin.StackedInline):
|
||||||
We had issues inheriting from both StackedInline
|
We had issues inheriting from both StackedInline
|
||||||
and the source DomainInformationAdmin since these
|
and the source DomainInformationAdmin since these
|
||||||
classes conflict, so we'll just pull what we need
|
classes conflict, so we'll just pull what we need
|
||||||
from DomainInformationAdmin"""
|
from DomainInformationAdmin
|
||||||
|
|
||||||
|
Note that `template` cannot be set through this function,
|
||||||
|
due to how admin.StackedInline behaves.
|
||||||
|
|
||||||
|
See `domain_change_form.html` for more information.
|
||||||
|
"""
|
||||||
|
|
||||||
form = DomainInformationInlineForm
|
form = DomainInformationInlineForm
|
||||||
|
|
||||||
model = models.DomainInformation
|
model = models.DomainInformation
|
||||||
|
|
||||||
fieldsets = copy.deepcopy(DomainInformationAdmin.fieldsets)
|
fieldsets = copy.deepcopy(DomainInformationAdmin.fieldsets)
|
||||||
|
|
|
@ -36,6 +36,7 @@ https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/
|
||||||
{% block fieldset %}
|
{% block fieldset %}
|
||||||
{% include "admin/includes/fieldset.html" %}
|
{% include "admin/includes/fieldset.html" %}
|
||||||
{% endblock fieldset%}
|
{% endblock fieldset%}
|
||||||
|
{# End of .gov override #}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if inline_admin_form.needs_explicit_pk_field %}
|
{% if inline_admin_form.needs_explicit_pk_field %}
|
||||||
|
@ -48,4 +49,4 @@ https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,9 +36,23 @@
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% comment %}
|
||||||
|
The custom inline definition MUST be passed in this way.
|
||||||
|
This is because we can't pass in additional context information from this scope
|
||||||
|
unless by overriding a bunch of base formset functions.
|
||||||
|
In this version of Django, inlines are handled much differently on the backend when there isn't a clear
|
||||||
|
reason as to why. It appears to be that they simply haven't been updated for a while.
|
||||||
|
|
||||||
|
Alternatively, we could create a second "duplicate" detail_table_fieldset.html file (or many if statements),
|
||||||
|
but we lose out on centralizing all this logic inside of one file. The tradeoff here seems to be between
|
||||||
|
code duplication vs not overriding the default.
|
||||||
|
|
||||||
|
As a consequence, this means that we can't override the template on this inline by
|
||||||
|
passing in template="path/to/file". We get much more control this way.
|
||||||
|
{% endcomment %}
|
||||||
{% block inline_field_sets %}
|
{% block inline_field_sets %}
|
||||||
{% for inline_admin_formset in inline_admin_formsets %}
|
{% for inline_admin_formset in inline_admin_formsets %}
|
||||||
{% include "django/admin/includes/domain_information_inline_change_form.html" with original_object=original.domain_info%}
|
{% include "django/admin/includes/domain_info_inline_stacked.html" with original_object=original.domain_info%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,6 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
|
||||||
<td class="padding-left-1">{{ contact.title }}</td>
|
<td class="padding-left-1">{{ contact.title }}</td>
|
||||||
<td class="padding-left-1">
|
<td class="padding-left-1">
|
||||||
{{ contact.email }}
|
{{ contact.email }}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="padding-left-1">{{ contact.phone }}</td>
|
<td class="padding-left-1">{{ contact.phone }}</td>
|
||||||
<td class="padding-left-1 text-size-small">
|
<td class="padding-left-1 text-size-small">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue