-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated Evento, Document and Step ct
- Loading branch information
1 parent
6ced6f1
commit 9390b9c
Showing
27 changed files
with
849 additions
and
47 deletions.
There are no files selected for viewing
Empty file.
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,24 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
> | ||
|
||
<!-- <adapter | ||
factory=".servizi_correlati.GetCorrelatiServizi" | ||
provides=".interfaces.ICorrelati" | ||
for="design.plone.contenttypes.interfaces.servizio.IServizio | ||
zope.publisher.interfaces.browser.IHTTPRequest" | ||
name="correlati-servizi" | ||
/> | ||
<adapter factory=".searchabletext_indexers.RelationChoiceFieldConverter" /> | ||
<adapter factory=".searchabletext_indexers.RelationListFieldConverter" /> | ||
<adapter | ||
factory=".searchabletext_indexers.TextBlockSearchableText" | ||
name="text" | ||
/> --> | ||
|
||
<adapter factory=".query.ZCatalogCompatibleQueryAdapter" /> | ||
|
||
</configure> |
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 iosanita.contenttypes.interfaces import IIosanitaContenttypesLayer | ||
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, IIosanitaContenttypesLayer) | ||
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
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/iosanita/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 iosanita.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
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,9 @@ | ||
# -*- coding: utf-8 -*- | ||
from iosanita.contenttypes.interfaces.punto_di_contatto import IPuntoDiContatto | ||
from plone.dexterity.content import Container | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(IPuntoDiContatto) | ||
class PuntoDiContatto(Container): | ||
""" """ |
Empty file.
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,20 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:browser="http://namespaces.zope.org/browser" | ||
xmlns:plone="http://namespaces.plone.org/plone" | ||
i18n_domain="iosanita.contenttypes" | ||
> | ||
|
||
<include | ||
package="Products.CMFCore" | ||
file="permissions.zcml" | ||
/> | ||
|
||
<browser:page | ||
name="io-sanita-settings" | ||
for="Products.CMFPlone.interfaces.IPloneSiteRoot" | ||
class=".settings.IoSanitaControlPanelView" | ||
permission="cmf.ManagePortal" | ||
/> | ||
|
||
</configure> |
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,84 @@ | ||
# -*- coding: utf-8 -*- | ||
from iosanita.contenttypes import _ | ||
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper | ||
from plone.app.registry.browser.controlpanel import RegistryEditForm | ||
from plone.restapi.controlpanels.interfaces import IControlpanel | ||
from zope.interface import Interface | ||
from zope.schema import Bool | ||
from zope.schema import List | ||
from zope.schema import SourceText | ||
from zope.schema import TextLine | ||
|
||
|
||
class IoSanitaSettingsControlpanel(IControlpanel): | ||
""" """ | ||
|
||
|
||
class IIoSanitaSettings(Interface): | ||
|
||
lead_image_dimension = List( | ||
title=_( | ||
"lead_image_dimension_label", | ||
default="Dimensioni lead image", | ||
), | ||
description=_( | ||
"lead_image_dimension_help", | ||
default="Se un content-type deve avere una dimensione della " | ||
"leadimage particolare, indicarle qui. " | ||
"Inserire le dimensioni nella forma di esempio " | ||
"PortalType|900x900", | ||
), | ||
required=True, | ||
default=[ | ||
"News Item|1920x600", | ||
"Servizio|1920x600", | ||
"UnitaOrganizzativa|1920x600", | ||
"Persona|180x100", | ||
], | ||
value_type=TextLine(), | ||
) | ||
|
||
search_sections = SourceText( | ||
title=_("search_sections_label", default="Sezioni ricerca"), | ||
description=_( | ||
"search_sections_help", | ||
default="Inserire una lista di sezioni per la ricerca.", | ||
), | ||
default="", | ||
required=False, | ||
) | ||
|
||
show_modified_default = Bool( | ||
title=_("show_modified_default_label", default="Mostra la data di modifica"), | ||
description=_( | ||
"show_modified_default_help", | ||
default="Questo è il valore di default per decidere se mostrare " | ||
"o meno la data di modifica nei contenuti che hanno la behavior " | ||
"abilitata. E' poi possibile sovrascrivere il default nei singoli " | ||
'contenuti (nel tab "Impostazioni").', | ||
), | ||
default=True, | ||
required=False, | ||
) | ||
show_dynamic_folders_in_footer = Bool( | ||
title=_("show_dynamic_folders_in_footer_label", default="Footer dinamico"), | ||
description=_( | ||
"show_dynamic_folders_in_footer_help", | ||
default="Se selezionato, il footer verrà popolato automaticamente " | ||
"con i contenuti di primo livello non esclusi dalla navigazione.", | ||
), | ||
default=True, | ||
required=False, | ||
) | ||
|
||
|
||
class IoSanitaControlPanelForm(RegistryEditForm): | ||
schema = IIoSanitaSettings | ||
id = "io-sanita-control-panel" | ||
label = _("Impostazioni Io sanita") | ||
|
||
|
||
class IoSanitaControlPanelView(ControlPanelFormWrapper): | ||
""" """ | ||
|
||
form = IoSanitaControlPanelForm |
Oops, something went wrong.