Skip to content
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

Add feature: copy only plugins in clipboard #293

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

haricot
Copy link
Contributor

@haricot haricot commented May 18, 2018

Summary

  • Copy a plugin into the clipboard without making it a clipboard placeholder reference.
  • Initialize data field identifier with clipboard content
  • Reload the browser when restoring a clipboard to refresh it in the toolbar

Expected behaviour

it can be interesting sometimes in terms of ergonomics to copy only a plugin and its children that avoids several manipulations if we want to recover for example a container with a carousel inside or the carousel and his childs.

Actual behaviour

Currently only placeholders can be copied

@jrief
Copy link
Owner

jrief commented May 20, 2018

I fully agree, that this would be really useful.
One potential upcoming issue could be, that users get confused into which placeholders they will be allowed to copy their clipboard. Could this become a problem in the future?

@haricot
Copy link
Contributor Author

haricot commented May 20, 2018

Yes it's true that it can lead to confusion, we can add more recommendations in the doc:

if we copy a placeholder, the clipboard will be called "placeholer: clipboard" in the other case it will take the name of the first plugins copied, with the latter django-cms will identify in red or blue where he can position them with the drag and drop or with the active paste.
It is preferable to copy the entire tree from the placefolder rather than pieces of it because afterwards it is easier to paste it into another placeholder that will not solicitate a particular location.

if that is not suitable, I will understand that this PR is closed, because it will always be possible to copy the entire placeholder into a specific unpublished draft page, and recover what is desired. This will just generate a few more manipulations.

Another thing, concerning the images.
They could be interesting to generate light images corresponding to the dimension of the images of origins.
This would quickly know which images need to be replaced.
For example:
Parsing the clipboard before its registration, and adding the proportions info:
"image": {"pk": 1, "model": "spin.Image"} => "image": {"pk": 1, "model": "filer.Image: 700x300"}
And during the restore clipboard , if the image pk does not match the proportions, an image is generated and replaces: "image": {"pk": 1, "model": "filer.Image: 700x300"} => "image": {"pk": XXX, "model": "filer.Image"}

The generated images would be placed in folder that could be manually deleted once replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants