Use "resource_path" TALES extension to get resource URL
authorThierry Florac <thierry.florac@onf.fr>
Tue, 16 May 2017 10:59:49 +0200
changeset 74 57f97b550c57
parent 73 22bd0cc53c47
child 75 06d6babc5fd7
Use "resource_path" TALES extension to get resource URL
src/pyams_content/component/gallery/zmi/templates/gallery-images.pt
src/pyams_content/component/gallery/zmi/templates/widget-input.pt
--- a/src/pyams_content/component/gallery/zmi/templates/gallery-images.pt	Tue May 16 10:58:42 2017 +0200
+++ b/src/pyams_content/component/gallery/zmi/templates/gallery-images.pt	Tue May 16 10:59:49 2017 +0200
@@ -1,10 +1,10 @@
 <div id="gallery-images" class="sortable gallery" i18n:domain="pyams_content"
 	 data-ams-plugins="pyams_content"
-	 data-ams-plugin-pyams_content-src="/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js"
+	 tal:attributes="data-ams-plugin-pyams_content-src extension:resource_path('pyams_content.skin:pyams_content');
+					 data-ams-location extension:absolute_url(context);
+					 class '{0} gallery'.format('sortable' if request.has_permission(view.permission) else '');"
 	 data-ams-plugin-pyams_content-async="false"
-	 data-ams-sortable-stop="PyAMS_content.galleries.setOrder"
-	 tal:attributes="data-ams-location extension:absolute_url(context);
-					 class '{0} gallery'.format('sortable' if request.has_permission(view.permission) else '');">
+	 data-ams-sortable-stop="PyAMS_content.galleries.setOrder">
 	<div tal:repeat="image context.values()"
 		 class="image margin-5 margin-bottom-10 radius-4 padding-5 pull-left text-center"
 		 style="position: relative;"
--- a/src/pyams_content/component/gallery/zmi/templates/widget-input.pt	Tue May 16 10:58:42 2017 +0200
+++ b/src/pyams_content/component/gallery/zmi/templates/widget-input.pt	Tue May 16 10:59:49 2017 +0200
@@ -1,6 +1,6 @@
 <label class="input bordered with-icon" i18n:domain="pyams_content"
 	   data-ams-plugins="pyams_content"
-	   data-ams-plugin-pyams_content-src="/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js">
+	   tal:attributes="data-ams-plugin-pyams_content-src extension:resource_path('pyams_content.skin:pyams_content')">
 	<i class="icon-append fa fa-plus-square txt-color-green hint opaque"
 		title="Add gallery" i18n:attributes="title"
 		data-ams-url="add-gallery.html?origin=link" data-toggle="modal"