# HG changeset patch # User Thierry Florac # Date 1547138706 -3600 # Node ID 4c4b26c3972a5d250833099cd0a8f9eaef36ebf5 # Parent 03631bacc24081e1084b8fb8c1e03fcee4688765 Use workflow visible states instead of published states diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/component/illustration/__init__.py --- a/src/pyams_default_theme/component/illustration/__init__.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/component/illustration/__init__.py Thu Jan 10 17:45:06 2019 +0100 @@ -79,7 +79,7 @@ @adapter_config(context=(ISharedContent, IPyAMSLayer), provides=IContentNavigationIllustration) def shared_content_illustration_factory(context, request): """Shared content illustration factory""" - version = context.published_version + version = context.visible_version if version is not None: return request.registry.queryMultiAdapter((version, request), IContentNavigationIllustration) diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/features/sitemap/__init__.py --- a/src/pyams_default_theme/features/sitemap/__init__.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/features/sitemap/__init__.py Thu Jan 10 17:45:06 2019 +0100 @@ -100,6 +100,6 @@ workflow = IWorkflow(context) params = Eq(catalog['parents'], intids.register(context)) & \ Any(catalog['content_type'], CONTENT_TYPES.keys()) & \ - Any(catalog['workflow_state'], workflow.published_states) + Any(catalog['workflow_state'], workflow.visible_states) for version in unique_iter(CatalogResultSet(CatalogQuery(catalog).query(params))): yield from product(II18nManager(version).get_languages(), (version,)) diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/routes.py --- a/src/pyams_default_theme/routes.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/routes.py Thu Jan 10 17:45:06 2019 +0100 @@ -43,7 +43,7 @@ if workflow is not None: versions = IWorkflowVersions(target, None) if versions is not None: - versions = versions.get_versions(workflow.published_states, sort=True) + versions = versions.get_versions(workflow.visible_states, sort=True) if versions: target = versions[-1] if (target is not None) and not IWorkflowPublicationInfo(target).is_visible(request): diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/shared/common/navigation.py --- a/src/pyams_default_theme/shared/common/navigation.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/shared/common/navigation.py Thu Jan 10 17:45:06 2019 +0100 @@ -49,6 +49,6 @@ @property def visible(self): - version = self.context.published_version + version = self.context.visible_version if version is not None: return IWorkflowPublicationInfo(version).is_visible(self.request) diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/shared/common/oid.py --- a/src/pyams_default_theme/shared/common/oid.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/shared/common/oid.py Thu Jan 10 17:45:06 2019 +0100 @@ -49,7 +49,7 @@ if workflow is not None: versions = IWorkflowVersions(target, None) if versions is not None: - versions = versions.get_versions(workflow.published_states, sort=True) + versions = versions.get_versions(workflow.visible_states, sort=True) if versions: target = versions[-1] if (target is not None) and not IWorkflowPublicationInfo(target).is_visible(self.request): diff -r 03631bacc240 -r 4c4b26c3972a src/pyams_default_theme/shared/common/summary.py --- a/src/pyams_default_theme/shared/common/summary.py Wed Jan 09 15:44:26 2019 +0100 +++ b/src/pyams_default_theme/shared/common/summary.py Thu Jan 10 17:45:06 2019 +0100 @@ -41,6 +41,6 @@ @adapter_config(context=(ISharedContent, IPyAMSUserLayer), provides=IContentSummaryInfo) def shared_content_summary_adapter(context, request): """Shared content summary adapter""" - version = context.published_version + version = context.visible_version if version is not None: return request.registry.queryMultiAdapter((version, request), IContentSummaryInfo)