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

WIP: [Sitebuilder] Make snippets aware of multiple sites #35

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

Conversation

kaedroho
Copy link
Contributor

https://projects.torchbox.com/projects/girl-effect-corporate-site/tickets/146

This PR implements site-based isolation into Wagtail's snippets module. All snippets are now associated with a site, and editors who have not got permission to edit pages in a site will no longer have permission to edit snippets for that site as well.

TODO:

  • Make snippet chooser aware of the page's site (currently only supports choosing snippets from the main site)

@kaedroho kaedroho force-pushed the feature/sitebuilder-snippets branch 2 times, most recently from 2c573c0 to 5acb405 Compare January 26, 2018 16:30
@kaedroho kaedroho force-pushed the feature/sitebuilder-snippets branch from 5acb405 to 3c14a42 Compare January 26, 2018 16:33
@Parbhat Parbhat force-pushed the feature/sitebuilder-snippets branch from 3b30633 to 9199337 Compare April 26, 2018 11:14
@kaedroho
Copy link
Contributor Author

kaedroho commented Apr 27, 2018

For the commit "Fix merge conflicts with master". I'm not sure what this is doing? Could you instead merge master into this branch to resolve conflicts?

@@ -5,7 +5,7 @@
<div class="nice-padding">
{# Need to keep the form in the HTML, even if the snippet is not searchable #}
{# This is to allow pagination links to be generated from the form action URL #}
<form class="snippet-search search-bar" action="{% url 'wagtailsnippets:choose' model_opts.app_label model_opts.model_name site.id %}" method="GET" novalidate>
<form class="snippet-search search-bar" action="{% url 'wagtailsnippets:choose' site.id model_opts.app_label model_opts.model_name %}" method="GET" novalidate>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for changing the order of these parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see it now. It makes it possible to insert the site id into the URL in wagtail_hooks.py

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Thanks for the review.

@Parbhat
Copy link

Parbhat commented Apr 27, 2018

@kaedroho the commit message is somewhat misleading. The commit merge master in the branch and resolve conflicts.

@kaedroho
Copy link
Contributor Author

These changes look good to me

@Parbhat
Copy link

Parbhat commented Apr 27, 2018

@kaedroho Added a commit to add js file snippet-chooser.js and remove static directory from .gitignore

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