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

Update the "copy page" override to deal with errors in hidden fields #306

Open
Pomax opened this issue Sep 30, 2020 · 5 comments
Open

Update the "copy page" override to deal with errors in hidden fields #306

Pomax opened this issue Sep 30, 2020 · 5 comments

Comments

@Pomax
Copy link
Contributor

Pomax commented Sep 30, 2020

When copying pages, which uses the modeltranslation_copy.html template override, with all but the main locale hidden, it's possible to end up in a state where copying won't succeed because everything except the main locale's fields still conflict with existing data, but you'll never know this because nothing on the copy page actually calls that out.

(the errors are there, but they're associated with hidden fields, so the user doesn't know they're there)

We fixed this for our project by introducing two buttons to, with a single click, show all locale fields, as well as a button to copy changes made to the main locale to all other locales, so it might be useful to land that into the main codebase instead....

Does MozillaFoundation/foundation.mozilla.org#5346 sound like it would be worth folding in?

@DiogoMarques29
Copy link
Collaborator

Hello @Pomax
Great work, I would gladly merge that code into this repo. About the template, we could also make a new block tag inside content so that we could add only the necessary items. If we completely replace the template, maybe there's no need for the new block.
Cheers

@Pomax
Copy link
Contributor Author

Pomax commented Oct 21, 2020

I think adding the block would probably be useful (we didn't add it to ours since it's unlikely anyone will take our code to extend, but I can file a PR that has that block syntax around the buttons so people can extend or override the content as needed themselves).

Can you elaborate on what completely replacing the template might entail?

@DiogoMarques29
Copy link
Collaborator

If we add the buttons to the modeltranslation_copy.html template, as well as the JS code, there is no need to add the new block to the page. Even so, the new block could be useful to other situations.

@Pomax
Copy link
Contributor Author

Pomax commented Oct 21, 2020

Ah, gotcha. Yes, agreed. Adding the block around the buttons won't be necessary to make things work, but it'll offer "folks who might want to something we've not thought of (yet?)" something they can make use of.

@DiogoMarques29
Copy link
Collaborator

Exactly! :)

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

No branches or pull requests

2 participants