Moved MyAMS resources to dedicated package
authorThierry Florac <tflorac@ulthar.net>
Sun, 19 Jul 2020 02:01:21 +0200
changeset 204 53322ba0ec77
parent 203 3c9fb0edbef9
child 205 a731e29446ca
Moved MyAMS resources to dedicated package
src/pyams_file/skin/templates/picture.pt
src/pyams_file/skin/templates/svg-picture.pt
src/pyams_file/widget/__init__.py
--- a/src/pyams_file/skin/templates/picture.pt	Wed Mar 27 09:02:52 2019 +0100
+++ b/src/pyams_file/skin/templates/picture.pt	Sun Jul 19 02:01:21 2020 +0200
@@ -10,7 +10,7 @@
 	</tal:if>
 	<source tal:condition="not:xs_width"
 			media="(max-width: 767px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<tal:if condition="sm_width">
 		<!-- sm source -->
 		<source media="(max-width: 991px)"
@@ -21,7 +21,7 @@
 	</tal:if>
 	<source tal:condition="not:sm_width"
 			media="(max-width: 991px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<tal:if condition="md_width">
 		<!-- md source -->
 		<source media="(max-width: 1199px)"
@@ -32,7 +32,7 @@
 	</tal:if>
 	<source tal:condition="not:md_width"
 			media="(max-width: 1199px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<tal:if condition="lg_width">
 		<!-- lg source -->
 		<source media="(min-width: 1200px)"
@@ -43,7 +43,7 @@
 	</tal:if>
 	<source tal:condition="not:lg_width"
 			media="(min-width: 1200px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<tal:if condition="def_width">
 		<!-- fallback image -->
 		<img style="width: 100%;" class="${css_class}"
--- a/src/pyams_file/skin/templates/svg-picture.pt	Wed Mar 27 09:02:52 2019 +0100
+++ b/src/pyams_file/skin/templates/svg-picture.pt	Sun Jul 19 02:01:21 2020 +0200
@@ -3,16 +3,16 @@
 	tal:define="image_url tales:absolute_url(image);">
 	<source tal:condition="not:xs_width"
 			media="(max-width: 767px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<source tal:condition="not:sm_width"
 			media="(max-width: 991px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<source tal:condition="not:md_width"
 			media="(max-width: 1199px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<source tal:condition="not:lg_width"
 			media="(min-width: 1200px)"
-			srcset="/--static--/pyams_skin/img/dot.png" />
+			srcset="/--static--/myams/img/dot.png" />
 	<!-- fallback image -->
 	<img style="width: 100%;"
 		 tal:define="timestamp tales:timestamp(image)"
--- a/src/pyams_file/widget/__init__.py	Wed Mar 27 09:02:52 2019 +0100
+++ b/src/pyams_file/widget/__init__.py	Sun Jul 19 02:01:21 2020 +0200
@@ -10,33 +10,30 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
-__docformat__ = 'restructuredtext'
-
-
-# import standard library
 import os
 from cgi import FieldStorage
 from datetime import datetime
 
-# import interfaces
-from pyams_file.interfaces import IFileField, IFileWidget, IMediaField, IMediaWidget, \
-    IThumbnailMediaField, IThumbnailMediaWidget, DELETED_FILE, IThumbnails
+from pyramid.interfaces import IView
+from z3c.form.browser.file import FileWidget as BaseFileWidget
+from z3c.form.converter import BaseDataConverter
+from z3c.form.interfaces import IDataConverter, IFieldWidget, NOT_CHANGED
+from z3c.form.util import toBytes
+from z3c.form.widget import FieldWidget
+from zope.dublincore.interfaces import IZopeDublinCore
+from zope.interface import implementer_only
+
+from pyams_file.file import EXTENSIONS_THUMBNAILS
+from pyams_file.interfaces import DELETED_FILE, IFileField, IFileWidget, IMediaField, \
+    IMediaWidget, IThumbnailMediaField, IThumbnailMediaWidget, IThumbnails
 from pyams_form.interfaces.form import IFormLayer
-from pyramid.interfaces import IView
-from z3c.form.interfaces import NOT_CHANGED, IFieldWidget, IDataConverter
-from zope.dublincore.interfaces import IZopeDublinCore
-
-# import packages
-from pyams_file.file import EXTENSIONS_THUMBNAILS
 from pyams_form.widget import widgettemplate_config
 from pyams_utils.adapter import adapter_config
 from pyams_utils.size import get_human_size
 from pyams_utils.url import absolute_url
-from z3c.form.browser.file import FileWidget as BaseFileWidget
-from z3c.form.converter import BaseDataConverter
-from z3c.form.util import toBytes
-from z3c.form.widget import FieldWidget
-from zope.interface import implementer_only
+
+
+__docformat__ = 'restructuredtext'
 
 
 @adapter_config(context=(IFileField, IFileWidget), provides=IDataConverter)
@@ -117,7 +114,7 @@
                     timestamp = self.timestamp
                 return '{0}?_={1}'.format(absolute_url(display, self.request), timestamp)
         name, ext = os.path.splitext(self.current_value.filename)
-        return '/--static--/pyams_skin/img/mimetypes/{0}'.format(EXTENSIONS_THUMBNAILS.get(ext, 'unknown.png'))
+        return '/--static--/myams/img/mimetypes/{0}'.format(EXTENSIONS_THUMBNAILS.get(ext, 'unknown.png'))
 
     def get_thumbnail_target(self):
         value = self.current_value