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

Buttons to "copy stream fields" are not working with snippets #256

Open
twbagustin opened this issue Oct 11, 2019 · 4 comments
Open

Buttons to "copy stream fields" are not working with snippets #256

twbagustin opened this issue Oct 11, 2019 · 4 comments

Comments

@twbagustin
Copy link

The registered hook only captures this url right now

@hooks.register('register_admin_urls')
def copy_streamfields_content():
    return [
        url(r'(?P<page_id>\d+)/edit/copy_translation_content$',
            return_translation_target_field_rendered_html, name=''),
    ]

and correspondent view only works with Pages

@twbagustin
Copy link
Author

Any idea of the effort in hours involved to provide support for snippets too? I'm guessing JS shouldn't be touched, only a new url pattern and a new view, could any maintainer confirm? So I can work in a pull request 😄

@jordanmt
Copy link

jordanmt commented Feb 5, 2020

I'm looking into this as well. Here's what I'm finding so far:

  • copy_stream_fields.js will need to be updated, as it serializes the form using selector #page-edit-form. I think a more generic way to do this would be to select form using .content, i.e. serializedForm = $(".content > form").serializeArray();. This should limit it to the main form for Pages as well as Snippets.
  • return_translation_target_field_rendered_html view needs the app, model, and ID of the snippet and a few other tweaks (removal of .specific at least)

A similar need exists for Wagtail Settings objects, which work a bit differently (we need the site ID rather than an ID for the object).

@ayushin
Copy link

ayushin commented May 20, 2020

Anybody's working on this?

@TonisPiip
Copy link

So currently there is no support for snippets at all?

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

4 participants