src/pyams_skin/__init__.py
changeset 0 bb4aabe07487
child 114 f2bd42ce8a2b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/__init__.py	Thu Feb 19 10:59:00 2015 +0100
@@ -0,0 +1,79 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+from fanstatic import Resource, Library
+
+from pyramid.i18n import TranslationStringFactory
+_ = TranslationStringFactory('pyams_skin')
+
+
+library = Library('pyams_skin', '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',
+                               minified='css/ext/bootstrap-modal.min.css',
+                               depends=[bootstrap_css, ])
+
+awesomefonts_css = Resource(library, 'css/ext/font-awesome-4.3.0.css',
+                            minified='css/ext/font-awesome-4.3.0.min.css',
+                            depends=[bootstrap_css, ])
+
+myams_css = Resource(library, 'css/myams.css',
+                     minified='css/myams.min.css',
+                     depends=[bootstrap_modal_css, awesomefonts_css])
+
+
+jquery = Resource(library, 'js/ext/jquery-2.1.3.js',
+                  minified='js/ext/jquery-2.1.3.min.js',
+                  bottom=True)
+
+jquery_ui = Resource(library, 'js/ext/jquery-ui-1.11.2.js',
+                     minified='js/ext/jquery-ui-1.11.2.min.js',
+                     depends=[jquery, ],
+                     bottom=True)
+
+jquery_dataTables = Resource(library, 'js/ext/jquery-dataTables-1.9.4.js',
+                             minified='js/ext/jquery-dataTables-1.9.4.min.js',
+                             depends=[jquery, ],
+                             bottom=True)
+
+jquery_dataTables_tableTools = Resource(library, 'js/ext/jquery-dataTables-tableTools.js',
+                                        minified='js/ext/jquery-dataTables-tableTools.min.js',
+                                        depends=[jquery_dataTables, ],
+                                        bottom=True)
+
+bootstrap = Resource(library, 'js/ext/bootstrap-3.3.2.js',
+                     minified='js/ext/bootstrap-3.3.2.min.js',
+                     depends=[jquery, jquery_ui, bootstrap_css, bootstrap_modal_css],
+                     bottom=True)
+
+myams = Resource(library, 'js/myams.js',
+                 minified='js/myams.min.js',
+                 depends=[bootstrap, myams_css],
+                 bottom=True)
+
+
+def includeme(config):
+    """Pyramid include"""
+
+    # add translations
+    config.add_translation_dirs('pyams_skin:locales')
+
+    # load registry components
+    config.scan()
+
+    if hasattr(config, 'load_zcml'):
+        config.load_zcml('configure.zcml')