Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed
--- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Wed Nov 14 17:29:40 2018 +0100
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-11-14 12:23+0100\n"
+"POT-Creation-Date: 2018-11-14 17:16+0100\n"
"PO-Revision-Date: 2015-09-10 10:42+0200\n"
"Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
"Language-Team: French\n"
@@ -2172,7 +2172,7 @@
#: src/pyams_content/interfaces/__init__.py:113
#: src/pyams_content/features/review/interfaces.py:74
-#: src/pyams_content/shared/view/interfaces.py:37
+#: src/pyams_content/shared/view/interfaces.py:39
msgid "Creation date"
msgstr "Date de création"
@@ -3806,160 +3806,166 @@
"Trier tous les résultats sur la date de première publication (du plus récent "
"au plus ancien)"
-#: src/pyams_content/shared/view/interfaces.py:29
+#: src/pyams_content/shared/view/interfaces.py:31
msgid "View"
msgstr "Vue"
-#: src/pyams_content/shared/view/interfaces.py:160
-msgid "Always include selected internal references"
-msgstr "Toujours inclure toutes les références internes"
-
-#: src/pyams_content/shared/view/interfaces.py:161
-msgid "Include selected internal references only if empty"
-msgstr "Inclure les références internes seulement lorsque la vue est vide"
-
-#: src/pyams_content/shared/view/interfaces.py:38
+#: src/pyams_content/shared/view/interfaces.py:40
msgid "Last update date"
msgstr "Date de dernière modification"
-#: src/pyams_content/shared/view/interfaces.py:39
+#: src/pyams_content/shared/view/interfaces.py:41
msgid "Current publication date"
msgstr "Date de publication de la version actuelle"
-#: src/pyams_content/shared/view/interfaces.py:40
+#: src/pyams_content/shared/view/interfaces.py:42
msgid "First publication date"
msgstr "Date de première publication"
-#: src/pyams_content/shared/view/interfaces.py:58
+#: src/pyams_content/shared/view/interfaces.py:60
msgid "Select context type?"
msgstr "Même gabarit que le contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:59
+#: src/pyams_content/shared/view/interfaces.py:61
msgid "If 'yes', content type will be extracted from context"
msgstr ""
"Si 'oui', seuls des contenus du même gabarit que le contexte seront "
"automatiquement sélectionnés"
-#: src/pyams_content/shared/view/interfaces.py:63
+#: src/pyams_content/shared/view/interfaces.py:65
msgid "Other content types"
msgstr "Autres gabarits"
-#: src/pyams_content/shared/view/interfaces.py:64
+#: src/pyams_content/shared/view/interfaces.py:66
msgid "Selected content types; leave empty for all"
msgstr ""
"Autres gabarits sélectionnés ; si l'on n'extrait pas le gabarit du contexte "
"et si cette sélection est vide, tous les gabarits seront pris en charge"
-#: src/pyams_content/shared/view/interfaces.py:71
+#: src/pyams_content/shared/view/interfaces.py:73
msgid "Select context data type?"
msgstr "Même type que le contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:72
+#: src/pyams_content/shared/view/interfaces.py:74
msgid ""
"If 'yes', content data type (if available) will be extracted from context"
msgstr ""
"Si 'oui', et si le contexte de la vue est \"typé\", seuls des contenus du "
"même type que le contexte seront automatiquement sélectionnés"
-#: src/pyams_content/shared/view/interfaces.py:77
+#: src/pyams_content/shared/view/interfaces.py:79
msgid "Other data types"
msgstr "Autres types de contenus"
-#: src/pyams_content/shared/view/interfaces.py:78
+#: src/pyams_content/shared/view/interfaces.py:80
msgid "Selected data types; leave empty for all"
msgstr ""
"Autres types de contenus sélectionnés ; si l'on n'extrait pas le type du "
"contexte et si cette sélection est vide, tous les contenus (typés ou non) "
"seront pris en charge"
-#: src/pyams_content/shared/view/interfaces.py:85
+#: src/pyams_content/shared/view/interfaces.py:87
msgid "Order by"
msgstr "Ordre de tri"
-#: src/pyams_content/shared/view/interfaces.py:86
+#: src/pyams_content/shared/view/interfaces.py:88
msgid "Property to use to sort results"
msgstr ""
"Propriété utilisée pour trier les résultats ; par défaut, le tri se fait en "
"ordre inverse, donc du plus récent au plus ancien"
-#: src/pyams_content/shared/view/interfaces.py:91
+#: src/pyams_content/shared/view/interfaces.py:93
msgid "Reversed order?"
msgstr "Ordre inverse ?"
-#: src/pyams_content/shared/view/interfaces.py:92
+#: src/pyams_content/shared/view/interfaces.py:94
msgid "If 'yes', items order will be reversed"
msgstr ""
"Si 'non', le tri se fera en ordre \"naturel\", donc du plus ancien au plus "
"récent"
-#: src/pyams_content/shared/view/interfaces.py:96
+#: src/pyams_content/shared/view/interfaces.py:98
#: src/pyams_content/shared/view/portlet/interfaces.py:91
msgid "Results count limit"
msgstr "Limite de résultats"
-#: src/pyams_content/shared/view/interfaces.py:97
+#: src/pyams_content/shared/view/interfaces.py:99
msgid "Maximum number of results that the view may retrieve"
msgstr "Nombre maximal de résultats que la vue doit renvoyer"
-#: src/pyams_content/shared/view/interfaces.py:170
+#: src/pyams_content/shared/view/interfaces.py:163
+msgid "Always include selected internal references"
+msgstr "Toujours inclure toutes les références internes"
+
+#: src/pyams_content/shared/view/interfaces.py:164
+msgid "Include selected internal references only if view is empty"
+msgstr "Inclure les références internes seulement lorsque la vue est vide"
+
+#: src/pyams_content/shared/view/interfaces.py:165
+msgid "Include ONLY selected references (no search will be made)"
+msgstr ""
+"N'inclure QUE les références internes (aucune autre recherche ne sera "
+"effectuée)"
+
+#: src/pyams_content/shared/view/interfaces.py:174
msgid "Internal references usage"
msgstr "Utilisation des références internes"
-#: src/pyams_content/shared/view/interfaces.py:171
+#: src/pyams_content/shared/view/interfaces.py:175
msgid "Specify how selected references are included into view results"
msgstr ""
"Indique comment les références internes indiquées seront intégrées à la "
"liste des résultats"
-#: src/pyams_content/shared/view/interfaces.py:176
+#: src/pyams_content/shared/view/interfaces.py:180
msgid "Exclude context?"
msgstr "Exclure le contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:177
+#: src/pyams_content/shared/view/interfaces.py:181
msgid "If 'yes', context will be excluded from results list"
msgstr ""
"Si 'oui', le contexte d'application de la vue sera automatiquement exclu de "
"la liste des résultats"
-#: src/pyams_content/shared/view/interfaces.py:188
+#: src/pyams_content/shared/view/interfaces.py:192
msgid "Select context tags?"
msgstr "Tags du contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:189
+#: src/pyams_content/shared/view/interfaces.py:193
msgid "If 'yes', tags will be extracted from context"
msgstr ""
"Si 'oui', les tags associés au contexte d'application de la vue seront "
"automatiquement sélectionnés"
-#: src/pyams_content/shared/view/interfaces.py:193
+#: src/pyams_content/shared/view/interfaces.py:197
msgid "Other tags"
msgstr "Autres tags"
-#: src/pyams_content/shared/view/interfaces.py:209
+#: src/pyams_content/shared/view/interfaces.py:213
msgid "Select context themes?"
msgstr "Thèmes du contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:210
+#: src/pyams_content/shared/view/interfaces.py:214
msgid "If 'yes', themes will be extracted from context"
msgstr ""
"Si 'oui', les thèmes associés au contexte d'application de la vue seront "
"automatiquement sélectionnés"
-#: src/pyams_content/shared/view/interfaces.py:214
+#: src/pyams_content/shared/view/interfaces.py:218
msgid "Other themes"
msgstr "Autres thèmes"
-#: src/pyams_content/shared/view/interfaces.py:230
+#: src/pyams_content/shared/view/interfaces.py:234
msgid "Select context collections?"
msgstr "Collections du contexte ?"
-#: src/pyams_content/shared/view/interfaces.py:231
+#: src/pyams_content/shared/view/interfaces.py:235
msgid "If 'yes', collections will be extracted from context"
msgstr ""
"Si 'oui', les collections associées au contexte d'application de la vue "
"seront automatiquement sélectionnés"
-#: src/pyams_content/shared/view/interfaces.py:235
+#: src/pyams_content/shared/view/interfaces.py:239
msgid "Other collections"
msgstr "Autres collections"
@@ -4062,10 +4068,34 @@
msgid "No result found"
msgstr "aucun"
-#: src/pyams_content/shared/view/zmi/properties.py:45
+#: src/pyams_content/shared/view/zmi/properties.py:43
msgid "Main view settings"
msgstr "Paramètres de la vue"
+#: src/pyams_content/shared/view/zmi/properties.py:69
+msgid ""
+"These settings apply to search made by the view.\n"
+"\n"
+"If you select the option \"Include ONLY selected references\", via the "
+"\"References\" menu, only \n"
+"selected references will be selected (if published) and no real search will "
+"be made !\n"
+"\n"
+"In other modes, and if no search criteria is defined (in this form, or in "
+"other settings forms), ALL\n"
+"published contents will be selected by the view !!\n"
+msgstr ""
+"Ces paramètres s'appliquent aux recherches effectuées par la vue.\n"
+"\n"
+"Si vous sélectionnez l'option \"N'inclure QUE les références internes\", via "
+"le menu \"Références\", seules les références imposées seront sélectionnées "
+"(si elles sont publiées) et aucune recherche complémentaire ne sera "
+"effectuée !\n"
+"\n"
+"Dans les autres modes, si aucun critère de recherche n'est indiqué (dans ce "
+"formulaire, ou via les autres menus), ce sont TOUS les contenus publiées qui "
+"seront sélectionnés par la vue !!\n"
+
#: src/pyams_content/shared/view/zmi/__init__.py:44
msgid "This view"
msgstr "Cette vue"
@@ -6113,6 +6143,9 @@
msgid "Add automatic content archiver"
msgstr "Ajout d'une tâche d'archivage automatique"
+#~ msgid "Only include internal references"
+#~ msgstr "N'inclure que les références internes, sans effectuer de recherche"
+
#~ msgid "(gallery contains 1 media)"
#~ msgstr "(1 média dans la galerie)"
--- a/src/pyams_content/locales/pyams_content.pot Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/locales/pyams_content.pot Wed Nov 14 17:29:40 2018 +0100
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-11-14 12:23+0100\n"
+"POT-Creation-Date: 2018-11-14 17:16+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2056,7 +2056,7 @@
#: ./src/pyams_content/interfaces/__init__.py:113
#: ./src/pyams_content/features/review/interfaces.py:74
-#: ./src/pyams_content/shared/view/interfaces.py:37
+#: ./src/pyams_content/shared/view/interfaces.py:39
msgid "Creation date"
msgstr ""
@@ -3554,137 +3554,141 @@
msgid "Sort all results by first publication date"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:29
+#: ./src/pyams_content/shared/view/interfaces.py:31
msgid "View"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:160
-msgid "Always include selected internal references"
-msgstr ""
-
-#: ./src/pyams_content/shared/view/interfaces.py:161
-msgid "Include selected internal references only if empty"
-msgstr ""
-
-#: ./src/pyams_content/shared/view/interfaces.py:38
-msgid "Last update date"
-msgstr ""
-
-#: ./src/pyams_content/shared/view/interfaces.py:39
-msgid "Current publication date"
-msgstr ""
-
#: ./src/pyams_content/shared/view/interfaces.py:40
+msgid "Last update date"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:41
+msgid "Current publication date"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:42
msgid "First publication date"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:58
+#: ./src/pyams_content/shared/view/interfaces.py:60
msgid "Select context type?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:59
+#: ./src/pyams_content/shared/view/interfaces.py:61
msgid "If 'yes', content type will be extracted from context"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:63
+#: ./src/pyams_content/shared/view/interfaces.py:65
msgid "Other content types"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:64
+#: ./src/pyams_content/shared/view/interfaces.py:66
msgid "Selected content types; leave empty for all"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:71
+#: ./src/pyams_content/shared/view/interfaces.py:73
msgid "Select context data type?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:72
+#: ./src/pyams_content/shared/view/interfaces.py:74
msgid ""
"If 'yes', content data type (if available) will be extracted from context"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:77
+#: ./src/pyams_content/shared/view/interfaces.py:79
msgid "Other data types"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:78
+#: ./src/pyams_content/shared/view/interfaces.py:80
msgid "Selected data types; leave empty for all"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:85
+#: ./src/pyams_content/shared/view/interfaces.py:87
msgid "Order by"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:86
+#: ./src/pyams_content/shared/view/interfaces.py:88
msgid "Property to use to sort results"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:91
+#: ./src/pyams_content/shared/view/interfaces.py:93
msgid "Reversed order?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:92
+#: ./src/pyams_content/shared/view/interfaces.py:94
msgid "If 'yes', items order will be reversed"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:96
+#: ./src/pyams_content/shared/view/interfaces.py:98
#: ./src/pyams_content/shared/view/portlet/interfaces.py:91
msgid "Results count limit"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:97
+#: ./src/pyams_content/shared/view/interfaces.py:99
msgid "Maximum number of results that the view may retrieve"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:170
+#: ./src/pyams_content/shared/view/interfaces.py:163
+msgid "Always include selected internal references"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:164
+msgid "Include selected internal references only if view is empty"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:165
+msgid "Include ONLY selected references (no search will be made)"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:174
msgid "Internal references usage"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:171
+#: ./src/pyams_content/shared/view/interfaces.py:175
msgid "Specify how selected references are included into view results"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:176
+#: ./src/pyams_content/shared/view/interfaces.py:180
msgid "Exclude context?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:177
+#: ./src/pyams_content/shared/view/interfaces.py:181
msgid "If 'yes', context will be excluded from results list"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:188
+#: ./src/pyams_content/shared/view/interfaces.py:192
msgid "Select context tags?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:189
-msgid "If 'yes', tags will be extracted from context"
-msgstr ""
-
#: ./src/pyams_content/shared/view/interfaces.py:193
+msgid "If 'yes', tags will be extracted from context"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:197
msgid "Other tags"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:209
+#: ./src/pyams_content/shared/view/interfaces.py:213
msgid "Select context themes?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:210
-msgid "If 'yes', themes will be extracted from context"
-msgstr ""
-
#: ./src/pyams_content/shared/view/interfaces.py:214
+msgid "If 'yes', themes will be extracted from context"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:218
msgid "Other themes"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:230
+#: ./src/pyams_content/shared/view/interfaces.py:234
msgid "Select context collections?"
msgstr ""
-#: ./src/pyams_content/shared/view/interfaces.py:231
-msgid "If 'yes', collections will be extracted from context"
-msgstr ""
-
#: ./src/pyams_content/shared/view/interfaces.py:235
+msgid "If 'yes', collections will be extracted from context"
+msgstr ""
+
+#: ./src/pyams_content/shared/view/interfaces.py:239
msgid "Other collections"
msgstr ""
@@ -3768,10 +3772,21 @@
msgid "No result found"
msgstr ""
-#: ./src/pyams_content/shared/view/zmi/properties.py:45
+#: ./src/pyams_content/shared/view/zmi/properties.py:43
msgid "Main view settings"
msgstr ""
+#: ./src/pyams_content/shared/view/zmi/properties.py:69
+msgid ""
+"These settings apply to search made by the view.\n"
+"\n"
+"If you select the option \"Include ONLY selected references\", via the \"References\" menu, only \n"
+"selected references will be selected (if published) and no real search will be made !\n"
+"\n"
+"In other modes, and if no search criteria is defined (in this form, or in other settings forms), ALL\n"
+"published contents will be selected by the view !!\n"
+msgstr ""
+
#: ./src/pyams_content/shared/view/zmi/__init__.py:44
msgid "This view"
msgstr ""
--- a/src/pyams_content/shared/view/__init__.py Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/shared/view/__init__.py Wed Nov 14 17:29:40 2018 +0100
@@ -163,26 +163,33 @@
# check publication dates
now = tztime(datetime.utcnow())
params = Lt(catalog['effective_date'], now)
- params &= Gt(catalog['push_end_date'], now)
- # check content types
- content_types = view.get_content_types(context)
- if content_types:
- params &= Any(catalog['content_type'], content_types)
- # check data types
- data_types = view.get_data_types(context)
- if data_types:
- params &= Any(catalog['data_type'], data_types)
# check workflow states
wf_params = None
for workflow in registry.getAllUtilitiesRegisteredFor(IWorkflow):
wf_params = or_(wf_params, Any(catalog['workflow_state'], workflow.published_states))
params &= wf_params
# check custom extensions
+ do_search = True
for name, adapter in sorted(registry.getAdapters((view,), IViewQueryParamsExtension),
key=lambda x: x[1].weight):
new_params = adapter.get_params(context)
+ if isinstance(new_params, tuple):
+ new_params, do_search = new_params
if new_params:
params &= new_params
+ if not do_search:
+ break
+ # activate search
+ if do_search:
+ params &= Gt(catalog['push_end_date'], now)
+ # check content types
+ content_types = view.get_content_types(context)
+ if content_types:
+ params &= Any(catalog['content_type'], content_types)
+ # check data types
+ data_types = view.get_data_types(context)
+ if data_types:
+ params &= Any(catalog['data_type'], data_types)
return params
def get_results(self, context, sort_index, reverse, limit):
--- a/src/pyams_content/shared/view/interfaces.py Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/shared/view/interfaces.py Wed Nov 14 17:29:40 2018 +0100
@@ -12,6 +12,8 @@
__docformat__ = 'restructuredtext'
+from collections import OrderedDict
+
from zope.interface import Attribute, Interface
from zope.schema import Bool, Choice, Int, Set
from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
@@ -155,11 +157,13 @@
ALWAYS_REFERENCE_MODE = 'always'
IFEMPTY_REFERENCE_MODE = 'if_empty'
+ONLY_REFERENCE_MODE = 'only'
-REFERENCES_MODES = {
- ALWAYS_REFERENCE_MODE: _("Always include selected internal references"),
- IFEMPTY_REFERENCE_MODE: _("Include selected internal references only if empty")
-}
+REFERENCES_MODES = OrderedDict((
+ (ALWAYS_REFERENCE_MODE, _("Always include selected internal references")),
+ (IFEMPTY_REFERENCE_MODE, _("Include selected internal references only if view is empty")),
+ (ONLY_REFERENCE_MODE, _("Include ONLY selected references (no search will be made)"))
+))
REFERENCES_MODES_VOCABULARY = SimpleVocabulary([SimpleTerm(v, title=t) for v, t in REFERENCES_MODES.items()])
--- a/src/pyams_content/shared/view/reference.py Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/shared/view/reference.py Wed Nov 14 17:29:40 2018 +0100
@@ -22,7 +22,8 @@
from pyams_catalog.query import CatalogResultSet, and_
from pyams_content.shared.view.interfaces import ALWAYS_REFERENCE_MODE, IViewInternalReferencesSettings, \
- IViewQueryFilterExtension, IViewQueryParamsExtension, IViewSettings, IWfView, VIEW_REFERENCES_SETTINGS_KEY
+ IViewQueryFilterExtension, IViewQueryParamsExtension, IViewSettings, IWfView, VIEW_REFERENCES_SETTINGS_KEY, \
+ ONLY_REFERENCE_MODE
from pyams_content.workflow import VISIBLE_STATES
from pyams_sequence.interfaces import ISequentialIdInfo
from pyams_utils.adapter import ContextAdapter, adapter_config, get_annotation_adapter
@@ -54,19 +55,23 @@
class ViewThemesQueryParamsExtension(ContextAdapter):
"""View internal references query params extension"""
- weight = 50
+ weight = 10
def get_params(self, context):
settings = IViewInternalReferencesSettings(self.context)
params = None
- # check themes
+ # check view references mode
+ if settings.references_mode == ONLY_REFERENCE_MODE:
+ catalog = get_utility(ICatalog)
+ params = Any(catalog['oid'], settings.references)
+ # check view settings
if settings.exclude_context:
sequence = ISequentialIdInfo(context, None)
if sequence is not None:
oid = sequence.hex_oid
catalog = get_utility(ICatalog)
params = and_(params, NotEq(catalog['oid'], oid))
- return params
+ return params, settings.references_mode != ONLY_REFERENCE_MODE
@adapter_config(name='references', context=IWfView, provides=IViewQueryFilterExtension)
--- a/src/pyams_content/shared/view/theme.py Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/shared/view/theme.py Wed Nov 14 17:29:40 2018 +0100
@@ -9,31 +9,27 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
-from pyams_content.component.theme import ICollectionsInfo
__docformat__ = 'restructuredtext'
-
-# import standard library
-
-# import interfaces
from hypatia.interfaces import ICatalog
-from pyams_content.component.theme.interfaces import ITagsInfo, IThemesInfo
-from pyams_content.shared.view.interfaces import IWfView, IViewSettings, IViewThemesSettings, \
- IViewQueryParamsExtension, VIEW_THEMES_SETTINGS_KEY, IViewTagsSettings, VIEW_TAGS_SETTINGS_KEY, \
- IViewCollectionsSettings, VIEW_COLLECTIONS_SETTINGS_KEY
-from zope.intid.interfaces import IIntIds
-
-# import packages
from hypatia.query import Any
from persistent import Persistent
-from pyams_catalog.query import and_
-from pyams_utils.adapter import adapter_config, get_annotation_adapter, ContextAdapter
-from pyams_utils.registry import get_utility
from zope.container.contained import Contained
from zope.interface import implementer
+from zope.intid.interfaces import IIntIds
from zope.schema.fieldproperty import FieldProperty
+from pyams_content.component.theme import ICollectionsInfo
+from pyams_content.component.theme.interfaces import ITagsInfo, IThemesInfo
+from pyams_content.shared.view.interfaces import IViewCollectionsSettings, IViewQueryParamsExtension, IViewSettings, \
+ IViewTagsSettings, IViewThemesSettings, IWfView, VIEW_COLLECTIONS_SETTINGS_KEY, VIEW_TAGS_SETTINGS_KEY, \
+ VIEW_THEMES_SETTINGS_KEY
+from pyams_utils.adapter import ContextAdapter, adapter_config, get_annotation_adapter
+from pyams_utils.registry import get_utility
+
+from pyams_catalog.query import and_
+
#
# Tags management
--- a/src/pyams_content/shared/view/zmi/properties.py Wed Nov 14 12:25:30 2018 +0100
+++ b/src/pyams_content/shared/view/zmi/properties.py Wed Nov 14 17:29:40 2018 +0100
@@ -12,24 +12,22 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
import json
-# import interfaces
-from pyams_content.shared.view.interfaces import IWfView
-from pyams_form.interfaces.form import IInnerSubForm
-from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces.data import IObjectData
+from z3c.form import field
+from zope.interface import alsoProvides
-# import packages
from pyams_content.shared.common.types import get_all_data_types
from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm
+from pyams_content.shared.view.interfaces import IWfView
+from pyams_form.help import FormHelp
+from pyams_form.interfaces.form import IFormHelp, IInnerSubForm
from pyams_form.widget import HiddenSelect2FieldWidget
+from pyams_skin.layer import IPyAMSLayer
from pyams_utils.adapter import adapter_config
+from pyams_utils.interfaces.data import IObjectData
from pyams_zmi.form import InnerAdminEditForm
-from z3c.form import field
-from zope.interface import alsoProvides
+from pyams_zmi.layer import IAdminLayer
from pyams_content import _
@@ -62,3 +60,18 @@
'ams-select2-data': json.dumps(get_all_data_types(self.request))
}
alsoProvides(widget, IObjectData)
+
+
+@adapter_config(context=(IWfView, IAdminLayer, ViewPropertiesEditForm), provides=IFormHelp)
+class ViewPropertiesFormHelp(FormHelp):
+ """View properties form help"""
+
+ message = _("""These settings apply to search made by the view.
+
+If you select the option "Include ONLY selected references", via the "References" menu, only
+selected references will be selected (if published) and no real search will be made !
+
+In other modes, and if no search criteria is defined (in this form, or in other settings forms), ALL
+published contents will be selected by the view !!
+""")
+ message_format = 'rest'