Opened 10 years ago

Closed 10 years ago

#22736 closed Uncategorized (needsinfo)

Preserve POPUP state when using 'save and continue' from model change form inside POPUP?

Reported by: sthzg@… Owned by: nobody
Component: contrib.admin Version: 1.6
Severity: Normal Keywords: admin, popup, change form, _continue
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When showing an admin change form inside a popup (opened with "return showAddAnotherPopup()") and using the 'save and continue' behavior (name="_continue" on the submit button) the popup context is lost in the redirect in contrib.admin.options.py, ln 972.

Would you consider this as unexpected behavior and if so, would it be interesting to preserve that state?

Change History (5)

comment:1 by Tim Graham, 10 years ago

How do you get a save and continue button on the pop-up? Are you using a custom template? I don't think the pop-up is really designed to be used like that.

comment:2 by Stephan Herzog, 10 years ago

Yes, I customized it to achieve this behavior. It makes more sense in my use case than returning to the change list (or closing the popup right away after saving). I thought it would be nice if the popup context remained in that scenario as well.

-- Edit --
A bit more about the use case. I have a change list that amongst other data displays a thumbnail of an extended file object. The change list itself is connected to another content type than this particular file object, but still it is very convenient to be able to edit the file's metadata (only 3 text inputs) without having to leave the context of that change list.

So I tried to open the edit page for the file inside a popup. In this use case it puzzles the user (just admins, but this change list is used a lot) to be returned to the change list page of the file objects after hitting save in the popup), because it isn't accessed in this context. Closing the popup right away isn't convenient either, because many users prefer to take a glance after saving and then closing manually (especially because the changed values are nowhere to be seen on the change list page that opens the popup, so closing it right away causes uncertainty about the correctness of the saved values)

Last edited 10 years ago by Stephan Herzog (previous) (diff)

in reply to:  1 comment:3 by Stephan Herzog, 10 years ago

Replying to timo:

How do you get a save and continue button on the pop-up? Are you using a custom template? I don't think the pop-up is really designed to be used like that.

Sorry, I wrote an answer (comment 2) but added a new comment instead of hitting the reply button.

comment:4 by Tim Graham, 10 years ago

What do you mean by "popup context"? Did you have a look if overriding templates/admin/popup_response.html might help? There's JavaScript logic there which closes the popup if that's what you're trying to avoid.

comment:5 by Tim Graham, 10 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top