Updated resources path
authorThierry Florac <tflorac@ulthar.net>
Sat, 27 Jan 2018 00:34:47 +0100
changeset 342 d4237323fa56
parent 341 db9167237b09
child 343 9ad82f269ef1
Updated resources path
src/pyams_content/component/association/zmi/__init__.py
src/pyams_content/component/paragraph/zmi/container.py
src/pyams_content/shared/common/zmi/types.py
src/pyams_content/shared/form/zmi/field.py
src/pyams_content/skin/zmi/tinymce.py
--- a/src/pyams_content/component/association/zmi/__init__.py	Fri Jan 26 17:21:59 2018 +0100
+++ b/src/pyams_content/component/association/zmi/__init__.py	Sat Jan 27 00:34:47 2018 +0100
@@ -10,6 +10,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
+
 __docformat__ = 'restructuredtext'
 
 
@@ -20,6 +21,7 @@
 from pyams_content.component.association.interfaces import IAssociationTarget, IAssociationContainer, IAssociationInfo
 from pyams_content.component.association.zmi.interfaces import IAssociationsParentForm, IAssociationsView
 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
+from pyams_content.skin import pyams_content
 from pyams_form.interfaces.form import IInnerSubForm
 from pyams_skin.layer import IPyAMSLayer
 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION, MANAGE_PERMISSION
@@ -34,6 +36,7 @@
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
+from pyams_utils.fanstatic import get_resource_path
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import viewlet_config
@@ -128,7 +131,7 @@
         attributes['table'] = {'id': self.id,
                                'data-ams-plugins': 'pyams_content',
                                'data-ams-plugin-pyams_content-src':
-                                   '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
+                                   get_resource_path(pyams_content),
                                'data-ams-location': absolute_url(IAssociationContainer(self.context), self.request),
                                'data-ams-tablednd-drag-handle': 'td.sorter',
                                'data-ams-tablednd-drop-target': 'set-associations-order.json'}
--- a/src/pyams_content/component/paragraph/zmi/container.py	Fri Jan 26 17:21:59 2018 +0100
+++ b/src/pyams_content/component/paragraph/zmi/container.py	Sat Jan 27 00:34:47 2018 +0100
@@ -37,6 +37,7 @@
 # import packages
 from pyams_content.component.association.zmi import AssociationsContainerView
 from pyams_content.shared.common.zmi import WfModifiedContentColumnMixin
+from pyams_content.skin import pyams_content
 from pyams_form.security import ProtectedFormObjectMixin
 from pyams_pagelet.pagelet import pagelet_config, Pagelet
 from pyams_skin.page import DefaultPageHeaderAdapter
@@ -44,6 +45,7 @@
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, NullAdapter
+from pyams_utils.fanstatic import get_resource_path
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
 from pyams_viewlet.manager import viewletmanager_config, WeightOrderedViewletManager, TemplateBasedViewletManager
@@ -96,7 +98,7 @@
         attributes['table'] = {'id': self.id,
                                'data-ams-plugins': 'pyams_content',
                                'data-ams-plugin-pyams_content-src':
-                                   '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
+                                   get_resource_path(pyams_content),
                                'data-ams-location': absolute_url(IParagraphContainer(self.context), self.request),
                                'data-ams-pre-reload': 'PyAMS_content.paragraphs.preReload',
                                'data-ams-post-reload': 'PyAMS_content.paragraphs.postReload',
--- a/src/pyams_content/shared/common/zmi/types.py	Fri Jan 26 17:21:59 2018 +0100
+++ b/src/pyams_content/shared/common/zmi/types.py	Sat Jan 27 00:34:47 2018 +0100
@@ -19,6 +19,7 @@
 from pyams_content.interfaces import MANAGE_TOOL_PERMISSION
 from pyams_content.shared.common.interfaces.types import ITypedSharedTool, ITypedDataManager, \
     IBaseDataType, IDataType, ISubType
+from pyams_content.skin import pyams_content
 from pyams_i18n.interfaces import II18n
 from pyams_skin.interfaces.container import ITableElementName
 from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager
@@ -38,6 +39,7 @@
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_skin.viewlet.toolbar import ToolbarAction
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter
+from pyams_utils.fanstatic import get_resource_path
 from pyams_utils.traversing import get_parent
 from pyams_utils.unicode import translate_string
 from pyams_utils.url import absolute_url
@@ -89,7 +91,7 @@
         attributes['table'] = {'id': self.id,
                                'data-ams-plugins': 'pyams_content',
                                'data-ams-plugin-pyams_content-src':
-                                   '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
+                                   get_resource_path(pyams_content),
                                'data-ams-location': absolute_url(ITypedDataManager(self.context), self.request),
                                'data-ams-tablednd-drag-handle': 'td.sorter',
                                'data-ams-tablednd-drop-target': 'set-types-order.json'}
@@ -339,7 +341,7 @@
         attributes['table'] = {'id': self.id,
                                'data-ams-plugins': 'pyams_content',
                                'data-ams-plugin-pyams_content-src':
-                                   '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
+                                   get_resource_path(pyams_content),
                                'data-ams-location': absolute_url(self.context, self.request),
                                'data-ams-tablednd-drag-handle': 'td.sorter',
                                'data-ams-tablednd-drop-target': 'set-subtypes-order.json'}
--- a/src/pyams_content/shared/form/zmi/field.py	Fri Jan 26 17:21:59 2018 +0100
+++ b/src/pyams_content/shared/form/zmi/field.py	Sat Jan 27 00:34:47 2018 +0100
@@ -21,6 +21,7 @@
 from pyams_content.shared.common.interfaces import IWfSharedContent
 from pyams_content.shared.form.interfaces import IFormFieldContainerTarget, IFormFieldContainer, IFormField, \
     IFormFieldFactory
+from pyams_content.skin import pyams_content
 from pyams_form.interfaces.form import IFormSecurityContext
 from pyams_i18n.interfaces import II18n
 from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager
@@ -41,6 +42,7 @@
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_skin.viewlet.toolbar import ToolbarAction
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
+from pyams_utils.fanstatic import get_resource_path
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import viewlet_config
@@ -92,7 +94,7 @@
         attributes['table'] = {'id': self.id,
                                'data-ams-plugins': 'pyams_content',
                                'data-ams-plugin-pyams_content-src':
-                                   '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
+                                   get_resource_path(pyams_content),
                                'data-ams-location': absolute_url(IFormFieldContainer(self.context), self.request),
                                'data-ams-tablednd-drag-handle': 'td.sorter',
                                'data-ams-tablednd-drop-target': 'set-form-fields-order.json'}
--- a/src/pyams_content/skin/zmi/tinymce.py	Fri Jan 26 17:21:59 2018 +0100
+++ b/src/pyams_content/skin/zmi/tinymce.py	Sat Jan 27 00:34:47 2018 +0100
@@ -16,12 +16,14 @@
 # import standard library
 
 # import interfaces
+from pyams_content.skin import pyams_content
 from pyams_form.interfaces.form import IForm
 from pyams_skin.interfaces.tinymce import ITinyMCEConfiguration
 from pyams_skin.layer import IPyAMSLayer
 
 # import packages
 from pyams_utils.adapter import adapter_config, ContextRequestAdapter
+from pyams_utils.fanstatic import get_resource_path
 
 
 @adapter_config(context=(IForm, IPyAMSLayer), provides=ITinyMCEConfiguration)
@@ -30,7 +32,9 @@
 
     @property
     def configuration(self):
-        return {'ams-plugins': 'pyams_content',
-                'ams-plugin-pyams_content-src': '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
-                'ams-plugin-pyams_content-async': 'false',
-                'ams-tinymce-init-callback': 'PyAMS_content.TinyMCE.initEditor'}
+        return {
+            'ams-plugins': 'pyams_content',
+            'ams-plugin-pyams_content-src': get_resource_path(pyams_content),
+            'ams-plugin-pyams_content-async': 'false',
+            'ams-tinymce-init-callback': 'PyAMS_content.TinyMCE.initEditor'
+        }