Opened 12 years ago

Closed 11 years ago

#19773 closed Cleanup/optimization (fixed)

Moving the response after a popup submission to a template so that it can be overwritten.

Reported by: jimmylam@… Owned by: nobody
Component: contrib.admin Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, after a popup submission (e.g. adding another User thur the "+" link in django admin), the response is

'<!DOCTYPE html><html><head><title></title></head><body>'
'<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script></body></html>' % \

# escape() calls force_unicode.
(escape(pk_value), escapejs(obj)))

Can this be changed so that it is loaded from a template file? And so, the template file can then be overwritten.

Since most browsers are having more strict cross-site pop-up windows security checking and my site are being loaded from different subdomains. In order to make them work together, i have to add the javascript
'document.domain = 'mydomain.com' in the templates, including the admin templates.

However, the above response can't be modified or overwritten because it's part of the code within the response_add method of ModelAdmin.

Change History (4)

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

Sure, this would be a good improvement.

comment:2 by javimansilla, 12 years ago

Submitted pull request https://github.com/django/django/pull/853 doing the needed changes.

comment:3 by Ramiro Morales, 12 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In f819bef3dc935851f71e4ad84592eee8664a48f3:

Fixed #19773 - Added admin/popup_response.html template.

Thanks jimmylam@ for the suggestion.

Note: See TracTickets for help on using tickets.
Back to Top