Hello!
In my AngularJs application I want to reuse some django admin forms (to "add", "edit" and "delete" orders)
but show them in the iframe instead of popup windows.
In order to display "add" form in iframe I create a template:
<iframe src="/admin/order/order/add/?_popup=1" width="300" height="200"></iframe>
<script>
window.dismissAddAnotherPopup = function customDismissAddAnotherPopup(window, val, obj) {
};
</script>
And redefine admin/popup_response.html template to search dissmissAddAnotherPopup function in the window.parent (that is in iframe) too:
<!DOCTYPE html>
<html>
<head><title></title></head>
<body>
<script type="text/javascript">
(window.opener || window.parent).dismissAddAnotherPopup(window, "{{ value }}", "{{ obj }}");
</script>
</body>
</html>
When user submit "add" form in the iframe then django responds with `admin/popup_response.html` template
and my JavaScript application takes notification from dismissAddAnotherPopup function.
It works as expected.
I have a trouble then try to implement the same logic for "edit" and "delete" forms (/admin/order/order/1/?_popup=1 and /admin/order/order/1/delete/?_popup=1 urls).
When user submit form data then Django responds with redirect to usual list of objects instead of admin/popup_response.html.
The delete_view method does not hides decoration (breadcrumbs and footer) then _popup is present (/admin/order/order/1/delete/?_popup=1). It was unexpected for me too.
Do you assess these features as errors and will you accept a PR to correct them?