The Django admin doesn't generate links to render the change or delete 
pages in pop-ups which is the reason this functionality wasn't implemented. 
While it seems like a reasonable request, I'm hesitant to add support for 
them because if such pages aren't in the normal admin workflow they will 
probably tend to get overlooked (and potentially broken) when adding new 
features.

On Thursday, June 26, 2014 10:00:02 AM UTC-4, e.generalov wrote:
>
> 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 difference is in implementation. The render_add method (
> https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1081)
>  
> takes in considiration IS_POPUP_VAR in request.POST and renders 
> admin/popup_response.html 
> template when _popup parameter is present. 
> But the response_change (
> https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1128)
>  
> and response_delete (
> https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1271
> ) methods does not. It was unexpected for me.
>
> 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?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/99ef7643-0dae-4fbf-92dc-bcea08251b6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to