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

Dx container site root #475

Merged
merged 31 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
66339cb
Just put the content on the site root
jaroel Dec 1, 2017
7349f54
Remove old tests + update changelog
jaroel Jul 31, 2018
099de5f
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Feb 11, 2019
566286f
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Feb 16, 2019
4b34c98
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Mar 3, 2019
fed9890
strip whitespace in robot test and stick value
jaroel Mar 4, 2019
bfbbf52
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Apr 6, 2019
455975d
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Jun 21, 2019
1ccce19
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Jul 6, 2019
5135194
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Dec 10, 2019
cc29391
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Feb 24, 2020
41206f9
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Mar 29, 2020
ea6af80
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel May 27, 2020
1940d02
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Jul 19, 2020
e78bc9d
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Aug 22, 2020
cdd5fa0
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Sep 26, 2020
dd225e6
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Oct 4, 2020
1ae3523
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Dec 9, 2020
942c48c
Fix robot tests.
jaroel Dec 12, 2020
8bfa7d9
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
jaroel Jan 26, 2021
c4d837d
Try to not change an already configured site
ale-rt Feb 10, 2021
6707890
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
ale-rt Feb 10, 2021
c4cac77
Modify the plone site when there is no text
ale-rt Feb 10, 2021
6fcbf96
Restore some tests
ale-rt Feb 10, 2021
b3bf8f1
Restore robot test
ale-rt Feb 11, 2021
6b40140
Move the changelog entry to the news folder
ale-rt Feb 11, 2021
635cfaa
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
ale-rt Feb 13, 2021
527a401
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
ale-rt Apr 23, 2021
6fc1777
url is a string, so it is not callable
ale-rt Apr 23, 2021
0a319ee
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
ale-rt Apr 23, 2021
594d52a
Merge remote-tracking branch 'origin/master' into dxcontainer-siteroot
mauritsvanrees Aug 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/475.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Plone Site is now a DX container. This means that the front-page object no
longer exists.
Refs PLIP 2454.
[jaroel]
77 changes: 34 additions & 43 deletions plone/app/contenttypes/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,51 +154,42 @@ def _setup_constrains(container, allowed_types):


def create_frontpage(portal, target_language):
frontpage_id = 'front-page'

if frontpage_id not in portal.keys():
title = _translate(
u'front-title',
target_language,
u'Welcome to Plone'
)
description = _translate(
u'front-description', target_language,
u'Congratulations! You have successfully installed Plone.'
)
content = createContent(
'Document', id=frontpage_id,
title=title,
description=description,
language=target_language.replace('_', '-').lower())
content = addContentToContainer(portal, content)
front_text = None
if target_language != 'en':
util = queryUtility(ITranslationDomain, 'plonefrontpage')
if util is not None:
translated_text = util.translate(
u'front-text',
target_language=target_language
)
if translated_text != u'front-text':
front_text = translated_text
request = getattr(portal, 'REQUEST', None)
if front_text is None and request is not None:
view = queryMultiAdapter(
(portal, request),
name='plone-frontpage-setup'
if portal.text:
# Do not overwrite existing content
return
portal.title = _translate(
u'front-title',
target_language,
u'Welcome to Plone'
)
portal.description = _translate(
u'front-description', target_language,
u'Congratulations! You have successfully installed Plone.'
)
front_text = None
if target_language != 'en':
util = queryUtility(ITranslationDomain, 'plonefrontpage')
if util is not None:
translated_text = util.translate(
u'front-text',
target_language=target_language
)
if view is not None:
front_text = bodyfinder(view.index()).strip()
content.text = RichTextValue(
front_text,
'text/html',
'text/x-html-safe'
if translated_text != u'front-text':
front_text = translated_text
request = getattr(portal, 'REQUEST', None)
if front_text is None and request is not None:
view = queryMultiAdapter(
(portal, request),
name='plone-frontpage-setup'
)

portal.setDefaultPage('front-page')
_publish(content)
content.reindexObject()
if view is not None:
front_text = bodyfinder(view.index()).strip()
portal.text = RichTextValue(
front_text,
'text/html',
'text/x-html-safe'
)
portal.reindexObject()


def create_news_topic(portal, target_language):
Expand Down
23 changes: 7 additions & 16 deletions plone/app/contenttypes/tests/test_content_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,13 @@ def setUp(self):
# front-page tests #
# #################### #

def test_frontpage_was_created(self):
# Was the object created?
obj = self.portal['front-page']
self.assertEqual(obj.portal_type, 'Document')

def test_frontpage_is_default_page(self):
# Has the object been set on the container as the default page?
self.assertEqual(self.portal.default_page, 'front-page')

def test_frontpage_is_published(self):
# Has the content object been published?
front_page = self.portal['front-page']
current_state = self.portal_workflow.getInfoFor(
front_page,
'review_state')
self.assertEqual(current_state, 'published')
def test_homepage(self):
self.assertEqual(self.portal.title, "Welcome to Plone")
self.assertEqual(
self.portal.description,
"Congratulations! You have successfully installed Plone."
)
self.assertIn("Welcome!", self.portal.text.raw)

# ################# #
# Members tests #
Expand Down