-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
7,092 additions
and
4,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,9 +137,11 @@ eggs = createcoverage | |
[versions] | ||
# Don't use a released version of design.plone.contenttypes | ||
design.plone.contenttypes = | ||
plone.restapi = | ||
|
||
[sources] | ||
#collective.volto.blocksfield = git https://github.com/collective/collective.volto.blocksfield.git [email protected]:collective/collective.volto.blocksfield.git branch=main | ||
#redturtle.volto = git https://github.com/RedTurtle/redturtle.volto.git [email protected]:RedTurtle/redturtle.volto.git | ||
#redturtle.bandi = git https://github.com/RedTurtle/redturtle.bandi.git [email protected]:RedTurtle/redturtle.bandi.git | ||
#plone.restapi = git https://github.com/plone/plone.restapi.git | ||
collective.volto.enhancedlinks = git https://github.com/RegioneER/collective.volto.enhancedlinks.git pushurl[email protected]:RegioneER/collective.volto.enhancedlinks.git branch=main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from design.plone.contenttypes.interfaces import IDesignPloneContenttypesLayer | ||
from plone.restapi.interfaces import IZCatalogCompatibleQuery | ||
from plone.restapi.search.query import ZCatalogCompatibleQueryAdapter as BaseAdapter | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
from zope.interface import Interface | ||
from plone import api | ||
|
||
|
||
@implementer(IZCatalogCompatibleQuery) | ||
@adapter(Interface, IDesignPloneContenttypesLayer) | ||
class ZCatalogCompatibleQueryAdapter(BaseAdapter): | ||
""" """ | ||
|
||
def __call__(self, query): | ||
""" | ||
Do not show excluded from search items when anonymous are performing | ||
some catalog searches | ||
""" | ||
query = super().__call__(query=query) | ||
|
||
if api.user.is_anonymous(): | ||
# For the anonymous user, only content that is not "excluded from the search" is found | ||
query["exclude_from_search"] = False | ||
|
||
return query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/design/plone/contenttypes/behaviors/exclude_from_search.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
from design.plone.contenttypes import _ | ||
from plone.autoform.interfaces import IFormFieldProvider | ||
from plone.dexterity.interfaces import IDexterityContent | ||
from plone.supermodel import model | ||
from zope import schema | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
from zope.interface import provider | ||
|
||
|
||
@provider(IFormFieldProvider) | ||
class IExcludeFromSearch(model.Schema): | ||
""" """ | ||
|
||
exclude_from_search = schema.Bool( | ||
title=_("exclude_from_search_label", default="Escludi dalla ricerca"), | ||
description=_( | ||
"help_exclude_from_search", | ||
default="Se selezionato, questo contenuto non verrà mostrato nelle ricerche del sito per gli utenti anonimi.", | ||
), | ||
required=False, | ||
default=False, | ||
) | ||
model.fieldset( | ||
"settings", | ||
fields=["exclude_from_search"], | ||
) | ||
|
||
|
||
@implementer(IExcludeFromSearch) | ||
@adapter(IDexterityContent) | ||
class ExcludeFromSearch(object): | ||
""" """ | ||
|
||
def __init__(self, context): | ||
self.context = context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...plone/contenttypes/browser/overrides/plone.app.contenttypes.browser.templates.newsitem.pt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.