New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added page copy action to admin #380
Conversation
I'm afraid I missed a subtlety here when you emailed around the spec: Wouldn't the user need to be able to choose where to copy the page(s) to? Having to make a copy then move it - two steps - is undesirable. |
I think in most cases, users would just want to copy into the same section of their website. Maybe we could add an optional step after the "set title and slug" form to allow them to move the copied page into a different section of the site at the same time if they wanted to. |
I think that would be nice yeah. In a way it's the terminology that necessitates choosing a destination: "Duplicate" tends to imply "into the same section" whereas "Copy" is tightly coupled with "Paste" which can usually occur anywhere, generally speaking. I think being able to "copy" without being able to choose your "paste" is pretty counter-intuitive, so even if it's not a common requirement to copy to another section, it should definitely be an option. I'd suggest you try and reuse the page chooser modal, as we would when choosing a link during page editing, placed below the title/slug fields, like you said. |
Could the page chooser modal default to the current location (location of the original page)? This assumes the chooser handles going up the tree well, which I haven't played with. |
I'm sure it could. I haven't tried it myself, but it's just a case of telling it which url to open on launch. |
Hi @kaedroho, we want to review and merge this as it stands in 0.4. @davecranwell please create an enhancement ticket for 0.5. Thanks. |
Done #390 |
Conflicts: wagtail/wagtailadmin/views/pages.py
I think we need more consideration of how this works with limited-permission users before it's ready to be merged. Some gotchas that spring to mind (may not be an exhaustive list)...
|
…yed to users without publish permissions.
Conflicts: wagtail/wagtailadmin/forms.py
…serve has not been added to urls.py
…to kaedroho-page-copy-ui Conflicts: wagtail/wagtailadmin/tests/test_pages_views.py
…lug validation method there rather than pushing one in from the view
…to CopyForm itself. This also allows us to move the help text into the actual help_text property, which fixes the dodgy spacing on the form field
…not presented as an 'are you sure?' confirmation message
…there are no subpages
This builds on my previous PR (#379) and adds admin UI for page copy