Create separate resource for "MyAMS.js" and "MyAMS.css"
authorThierry Florac <thierry.florac@onf.fr>
Wed, 23 May 2018 15:19:33 +0200
changeset 325 e55bab04b4d6
parent 324 49c7deef8eef
child 326 b0295d75e7b8
Create separate resource for "MyAMS.js" and "MyAMS.css"
src/pyams_skin/__init__.py
--- a/src/pyams_skin/__init__.py	Wed May 23 15:18:46 2018 +0200
+++ b/src/pyams_skin/__init__.py	Wed May 23 15:19:33 2018 +0200
@@ -13,7 +13,7 @@
 __docformat__ = 'restructuredtext'
 
 
-from fanstatic import Resource, Library
+from fanstatic import Resource, Library, Group
 
 from pyramid.i18n import TranslationStringFactory
 _ = TranslationStringFactory('pyams_skin')
@@ -21,6 +21,11 @@
 
 library = Library('pyams_skin', 'resources')
 
+
+#
+# CSS resources
+#
+
 bootstrap_css = Resource(library, 'css/ext/bootstrap-3.3.2.css',
                          minified='css/ext/bootstrap-3.3.2.min.css')
 bootstrap_modal_css = Resource(library, 'css/ext/bootstrap-modal.css',
@@ -36,6 +41,10 @@
                      depends=[bootstrap_modal_css, awesomefonts_css])
 
 
+#
+# Javascript resources
+#
+
 jquery = Resource(library, 'js/ext/jquery-2.1.3.js',
                   minified='js/ext/jquery-2.1.3.min.js',
                   bottom=True)
@@ -64,10 +73,17 @@
                      minified='js/ext/js-cookie.min.js',
                      bottom=True)
 
-myams = Resource(library, 'js/myams.js',
-                 minified='js/myams.min.js',
-                 depends=[bootstrap, js_cookie, myams_css],
-                 bottom=True)
+myams_js = Resource(library, 'js/myams.js',
+                    minified='js/myams.min.js',
+                    depends=[bootstrap, js_cookie],
+                    bottom=True)
+
+
+#
+# Global resources
+#
+
+myams = Group(depends=[myams_css, myams_js])
 
 
 def includeme(config):