--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,19 @@
+
+syntax: regexp
+^develop-eggs$
+syntax: regexp
+^parts$
+syntax: regexp
+^bin$
+syntax: regexp
+^\.installed\.cfg$
+syntax: regexp
+^\.settings$
+syntax: regexp
+^build$
+syntax: regexp
+^dist$
+syntax: regexp
+^\.idea$
+syntax: regexp
+.*\.pyc$
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,42 @@
+Zope Public License (ZPL) Version 2.1
+=====================================
+
+A copyright notice accompanies this license document that identifies
+the copyright holders.
+
+This license has been certified as open source. It has also been designated
+as GPL compatible by the Free Software Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying copyright
+ notice, this list of conditions, and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of the
+ copyright holders. Use of them is covered by separate agreement with the
+ copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of any
+ change.
+
+
+Disclaimer
+==========
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MANIFEST.in Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,5 @@
+include *.txt
+recursive-include docs *
+recursive-include src *
+global-exclude *.pyc
+global-exclude *.*~
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bootstrap.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,178 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation and Contributors.
+# 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.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+"""
+
+import os
+import shutil
+import sys
+import tempfile
+
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+usage = '''\
+[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
+
+Bootstraps a buildout-based project.
+
+Simply run this script in a directory containing a buildout.cfg, using the
+Python that you want bin/buildout to use.
+
+Note that by using --find-links to point to local resources, you can keep
+this script from going over the network.
+'''
+
+parser = OptionParser(usage=usage)
+parser.add_option("-v", "--version", help="use a specific zc.buildout version")
+
+parser.add_option("-t", "--accept-buildout-test-releases",
+ dest='accept_buildout_test_releases',
+ action="store_true", default=False,
+ help=("Normally, if you do not specify a --version, the "
+ "bootstrap script and buildout gets the newest "
+ "*final* versions of zc.buildout and its recipes and "
+ "extensions for you. If you use this flag, "
+ "bootstrap and buildout will get the newest releases "
+ "even if they are alphas or betas."))
+parser.add_option("-c", "--config-file",
+ help=("Specify the path to the buildout configuration "
+ "file to be used."))
+parser.add_option("-f", "--find-links",
+ help=("Specify a URL to search for buildout releases"))
+parser.add_option("--allow-site-packages",
+ action="store_true", default=False,
+ help=("Let bootstrap.py use existing site packages"))
+
+
+options, args = parser.parse_args()
+
+######################################################################
+# load/install setuptools
+
+try:
+ if options.allow_site_packages:
+ import setuptools
+ import pkg_resources
+ from urllib.request import urlopen
+except ImportError:
+ from urllib2 import urlopen
+
+ez = {}
+exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
+
+if not options.allow_site_packages:
+ # ez_setup imports site, which adds site packages
+ # this will remove them from the path to ensure that incompatible versions
+ # of setuptools are not in the path
+ import site
+ # inside a virtualenv, there is no 'getsitepackages'.
+ # We can't remove these reliably
+ if hasattr(site, 'getsitepackages'):
+ for sitepackage_path in site.getsitepackages():
+ sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
+
+setup_args = dict(to_dir=tmpeggs, download_delay=0)
+ez['use_setuptools'](**setup_args)
+import setuptools
+import pkg_resources
+
+# This does not (always?) update the default working set. We will
+# do it.
+for path in sys.path:
+ if path not in pkg_resources.working_set.entries:
+ pkg_resources.working_set.add_entry(path)
+
+######################################################################
+# Install buildout
+
+ws = pkg_resources.working_set
+
+cmd = [sys.executable, '-c',
+ 'from setuptools.command.easy_install import main; main()',
+ '-mZqNxd', tmpeggs]
+
+find_links = os.environ.get(
+ 'bootstrap-testing-find-links',
+ options.find_links or
+ ('http://downloads.buildout.org/'
+ if options.accept_buildout_test_releases else None)
+ )
+if find_links:
+ cmd.extend(['-f', find_links])
+
+setuptools_path = ws.find(
+ pkg_resources.Requirement.parse('setuptools')).location
+
+requirement = 'zc.buildout'
+version = options.version
+if version is None and not options.accept_buildout_test_releases:
+ # Figure out the most recent final version of zc.buildout.
+ import setuptools.package_index
+ _final_parts = '*final-', '*final'
+
+ def _final_version(parsed_version):
+ for part in parsed_version:
+ if (part[:1] == '*') and (part not in _final_parts):
+ return False
+ return True
+ index = setuptools.package_index.PackageIndex(
+ search_path=[setuptools_path])
+ if find_links:
+ index.add_find_links((find_links,))
+ req = pkg_resources.Requirement.parse(requirement)
+ if index.obtain(req) is not None:
+ best = []
+ bestv = None
+ for dist in index[req.project_name]:
+ distv = dist.parsed_version
+ if _final_version(distv):
+ if bestv is None or distv > bestv:
+ best = [dist]
+ bestv = distv
+ elif distv == bestv:
+ best.append(dist)
+ if best:
+ best.sort()
+ version = best[-1].version
+if version:
+ requirement = '=='.join((requirement, version))
+cmd.append(requirement)
+
+import subprocess
+if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
+ raise Exception(
+ "Failed to execute command:\n%s" % repr(cmd)[1:-1])
+
+######################################################################
+# Import and run buildout
+
+ws.add_entry(tmpeggs)
+ws.require(requirement)
+import zc.buildout.buildout
+
+if not [a for a in args if '=' not in a]:
+ args.append('bootstrap')
+
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+ args[0:0] = ['-c', options.config_file]
+
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildout.cfg Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,71 @@
+[buildout]
+eggs-directory = /var/local/env/pyams/eggs
+extends = http://download.ztfy.org/pyams/pyams-dev.cfg
+find-links = http://download.ztfy.org/eggs
+
+socket-timeout = 3
+
+#allow-picked-versions = false
+show-picked-versions = true
+newest = false
+
+allow-hosts =
+ bitbucket.org
+ *.python.org
+ *.sourceforge.net
+ github.com
+
+versions = versions
+
+src = src
+develop =
+ .
+ ../ext/lingua
+ ../pyams_catalog
+ ../pyams_file
+ ../pyams_form
+ ../pyams_i18n
+ ../pyams_pagelet
+ ../pyams_skin
+ ../pyams_template
+ ../pyams_utils
+ ../pyams_viewlet
+
+parts =
+ package
+ i18n
+ pyflakes
+ test
+
+[package]
+recipe = zc.recipe.egg
+eggs =
+ pyams_default_theme
+ pyramid
+ zope.component
+ zope.interface
+
+[i18n]
+recipe = zc.recipe.egg
+eggs =
+ babel
+ lingua
+
+[pyflakes]
+recipe = zc.recipe.egg
+eggs = pyflakes
+scripts = pyflakes
+entry-points = pyflakes=pyflakes.scripts.pyflakes:main
+initialization = if not sys.argv[1:]: sys.argv[1:] = ["${buildout:src}"]
+
+[pyflakesrun]
+recipe = collective.recipe.cmd
+on_install = true
+cmds = ${buildout:develop}/bin/${pyflakes:scripts}
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = pyams_default_theme [test]
+
+[versions]
+pyams_default_theme = 0.1.0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/HISTORY.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,6 @@
+History
+=======
+
+0.1.0
+-----
+ - first release
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+"""
+This module contains pyams_default_theme package
+"""
+import os
+from setuptools import setup, find_packages
+
+DOCS = os.path.join(os.path.dirname(__file__),
+ 'docs')
+
+README = os.path.join(DOCS, 'README.txt')
+HISTORY = os.path.join(DOCS, 'HISTORY.txt')
+
+version = '0.1.0'
+long_description = open(README).read() + '\n\n' + open(HISTORY).read()
+
+tests_require = []
+
+setup(name='pyams_default_theme',
+ version=version,
+ description="PyAMS default theme",
+ long_description=long_description,
+ classifiers=[
+ "License :: OSI Approved :: Zope Public License",
+ "Development Status :: 4 - Beta",
+ "Programming Language :: Python",
+ "Framework :: Pyramid",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ keywords='Pyramid PyAMS',
+ author='Thierry Florac',
+ author_email='tflorac@ulthar.net',
+ url='http://hg.ztfy.org/pyams/pyams_default_theme',
+ license='ZPL',
+ packages=find_packages('src'),
+ package_dir={'': 'src'},
+ namespace_packages=[],
+ include_package_data=True,
+ package_data={'': ['*.zcml', '*.txt', '*.pt', '*.pot', '*.po', '*.mo', '*.png', '*.gif', '*.jpeg', '*.jpg', '*.css', '*.js']},
+ zip_safe=False,
+ # uncomment this to be able to run tests with setup.py
+ test_suite="pyams_default_theme.tests.test_utilsdocs.test_suite",
+ tests_require=tests_require,
+ extras_require=dict(test=tests_require),
+ install_requires=[
+ 'setuptools',
+ # -*- Extra requirements: -*-
+ 'pyams_skin',
+ 'pyramid',
+ 'zope.component',
+ 'zope.interface',
+ ],
+ entry_points={
+ 'fanstatic.libraries': [
+ 'pyams_default_theme = pyams_default_theme:library'
+ ]
+ })
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/PKG-INFO Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,18 @@
+Metadata-Version: 1.1
+Name: pyams-default-theme
+Version: 0.1.0
+Summary: PyAMS default theme
+Home-page: http://hg.ztfy.org/pyams/pyams_default_theme
+Author: Thierry Florac
+Author-email: tflorac@ulthar.net
+License: ZPL
+Description:
+
+
+Keywords: Pyramid PyAMS
+Platform: UNKNOWN
+Classifier: License :: OSI Approved :: Zope Public License
+Classifier: Development Status :: 4 - Beta
+Classifier: Programming Language :: Python
+Classifier: Framework :: Pyramid
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/SOURCES.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,31 @@
+MANIFEST.in
+setup.py
+docs/HISTORY.txt
+docs/README.txt
+src/pyams_default_theme/__init__.py
+src/pyams_default_theme/configuration.py
+src/pyams_default_theme/include.py
+src/pyams_default_theme/layer.py
+src/pyams_default_theme/page.py
+src/pyams_default_theme/skin.py
+src/pyams_default_theme.egg-info/PKG-INFO
+src/pyams_default_theme.egg-info/SOURCES.txt
+src/pyams_default_theme.egg-info/dependency_links.txt
+src/pyams_default_theme.egg-info/entry_points.txt
+src/pyams_default_theme.egg-info/namespace_packages.txt
+src/pyams_default_theme.egg-info/not-zip-safe
+src/pyams_default_theme.egg-info/requires.txt
+src/pyams_default_theme.egg-info/top_level.txt
+src/pyams_default_theme/doctests/README.txt
+src/pyams_default_theme/interfaces/__init__.py
+src/pyams_default_theme/resources/css/pyams-default.css
+src/pyams_default_theme/resources/css/pyams-default.min.css
+src/pyams_default_theme/resources/img/dot.png
+src/pyams_default_theme/resources/js/pyams-default.js
+src/pyams_default_theme/resources/js/pyams-default.min.js
+src/pyams_default_theme/resources/less/pyams-default.less
+src/pyams_default_theme/templates/index.pt
+src/pyams_default_theme/templates/layout.pt
+src/pyams_default_theme/tests/__init__.py
+src/pyams_default_theme/tests/test_utilsdocs.py
+src/pyams_default_theme/tests/test_utilsdocstrings.py
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/dependency_links.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/entry_points.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,3 @@
+[fanstatic.libraries]
+pyams_default_theme = pyams_default_theme:library
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/namespace_packages.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/not-zip-safe Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/requires.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,7 @@
+pyams_skin
+pyramid
+setuptools
+zope.component
+zope.interface
+
+[test]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme.egg-info/top_level.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+pyams_default_theme
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/__init__.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,39 @@
+#
+# 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 pyams_skin import myams_css, myams
+
+from pyramid.i18n import TranslationStringFactory
+_ = TranslationStringFactory('pyams_default_theme')
+
+
+library = Library('pyams_default_theme', 'resources')
+
+pyams_default_theme_css = Resource(library, 'css/pyams-default.css',
+ minified='css/pyams-default.min.css',
+ depends=[myams_css, ])
+
+pyams_default_theme = Resource(library, 'js/pyams-default.js',
+ minified='js/pyams-default.min.js',
+ depends=[myams, pyams_default_theme_css],
+ bottom=True)
+
+
+def includeme(config):
+ """Pyramid include"""
+
+ from .include import include_package
+ include_package(config)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/configuration.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,61 @@
+#
+# 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'
+
+
+# import standard library
+import pkg_resources
+
+# import interfaces
+from pyams_default_theme.layer import IPyAMSDefaultLayer
+from pyams_skin.interfaces.configuration import IStaticConfiguration
+from pyams_utils.interfaces.site import IStaticConfigurationManager
+
+# import packages
+from pyams_content.root import SiteRootStaticConfiguration as SiteRootStaticConfigurationBase
+from pyams_utils.adapter import adapter_config
+from zope.interface import Interface
+
+from pyams_default_theme import _
+
+
+@adapter_config(context=(IStaticConfigurationManager, IPyAMSDefaultLayer, Interface), provides=IStaticConfiguration)
+class StaticConfiguration(SiteRootStaticConfigurationBase):
+ """PyAMS default skin static configuration"""
+
+ application_package = 'pyams_default_theme'
+ application_name = 'PyAMS'
+
+ version_location = 'menus'
+
+ include_header = False
+ include_top_links = False
+ include_site_search = True
+ site_search_placeholder = _("Search...")
+ site_search_handler = '#search.html'
+ include_mobile_search = True
+ mobile_search_placeholder = _("Search...")
+ mobile_search_handler = '#search.html'
+ include_user_activity = True
+ include_user_shortcuts = True
+ include_logout_button = True
+ include_minify_button = True
+ include_flags = False
+ include_menus = False
+ include_ribbon = False
+ include_reload_button = False
+ body_css_class = 'minified hidden-menu'
+
+ @property
+ def version(self):
+ return pkg_resources.get_distribution(self.application_package).version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/doctests/README.txt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,3 @@
+===========================
+pyams_default_theme package
+===========================
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/include.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,30 @@
+#
+# 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'
+
+
+# import standard library
+
+# import interfaces
+
+# import packages
+
+
+def include_package(config):
+ """Pyramid include"""
+
+ # add translations
+ config.add_translation_dirs('pyams_default_theme:locales')
+
+ # load registry components
+ config.scan()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/interfaces/__init__.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,23 @@
+#
+# 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'
+
+
+# import standard library
+
+# import interfaces
+from zope.interface import Interface
+
+# import packages
+
+from pyams_default_theme import _
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/layer.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,25 @@
+#
+# 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'
+
+
+# import standard library
+
+# import interfaces
+
+# import packages
+from pyams_skin.layer import IPyAMSUserLayer
+
+
+class IPyAMSDefaultLayer(IPyAMSUserLayer):
+ """PyAMS default user layer"""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/page.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,30 @@
+#
+# 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'
+
+
+# import standard library
+
+# import interfaces
+from pyams_default_theme.layer import IPyAMSDefaultLayer
+
+# import packages
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_template.template import layout_config, template_config
+
+
+@pagelet_config(name='', layer=IPyAMSDefaultLayer)
+@layout_config(template='templates/layout.pt', layer=IPyAMSDefaultLayer)
+@template_config(template='templates/index.pt', layer=IPyAMSDefaultLayer)
+class BaseIndexPage(object):
+ """Default base index page"""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/resources/css/pyams-default.css Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,20 @@
+@media only screen and (min-width: 1200px) {
+ .portal-page .slot.col-lg-0 {
+ display: none;
+ }
+}
+@media only screen and (min-width: 992px) and (max-width: 1199px) {
+ .portal-page .slot.col-md-0 {
+ display: none;
+ }
+}
+@media only screen and (min-width: 768px) and (max-width: 991px) {
+ .portal-page .slot.col-sm-0 {
+ display: none;
+ }
+}
+@media only screen and (max-width: 767px) {
+ .portal-page .slot.col-xs-0 {
+ display: none;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/resources/css/pyams-default.min.css Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+@media only screen and (min-width:1200px){.portal-page .slot.col-lg-0{display:none}}@media only screen and (min-width:992px) and (max-width:1199px){.portal-page .slot.col-md-0{display:none}}@media only screen and (min-width:768px) and (max-width:991px){.portal-page .slot.col-sm-0{display:none}}@media only screen and (max-width:767px){.portal-page .slot.col-xs-0{display:none}}
\ No newline at end of file
Binary file src/pyams_default_theme/resources/img/dot.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/resources/js/pyams-default.js Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,11 @@
+(function($, globals) {
+
+ "use strict";
+
+ var MyAMS = globals.MyAMS;
+ var PyAMS_default = {
+
+ };
+ globals.PyAMS_default = PyAMS_default;
+
+})(jQuery, this);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/resources/js/pyams-default.min.js Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+(function(c,b){var d=b.MyAMS;var a={};b.PyAMS_default=a})(jQuery,this);
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/resources/less/pyams-default.less Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,25 @@
+.portal-page {
+
+ .slot {
+ @media only screen and (min-width: 1200px) {
+ &.col-lg-0 {
+ display: none;
+ }
+ }
+ @media only screen and (min-width: 992px) and (max-width: 1199px) {
+ &.col-md-0 {
+ display: none;
+ }
+ }
+ @media only screen and (min-width: 768px) and (max-width: 991px) {
+ &.col-sm-0 {
+ display: none;
+ }
+ }
+ @media only screen and (max-width: 767px) {
+ &.col-xs-0 {
+ display: none;
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/skin.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,44 @@
+#
+# 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'
+
+
+# import standard library
+
+# import interfaces
+from pyams_default_theme.layer import IPyAMSDefaultLayer
+from pyams_skin.interfaces import ISkin
+from pyams_skin.interfaces.resources import IResources
+
+# import packages
+from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
+from pyams_utils.registry import utility_config
+from zope.interface import Interface
+
+from pyams_default_theme import _, pyams_default_theme
+
+
+@utility_config(name='PyAMS default skin', provides=ISkin)
+class PyAMSDefaultSkin(object):
+ """PyAMS default skin"""
+
+ label = _("PyAMS default skin")
+ layer = IPyAMSDefaultLayer
+
+
+@adapter_config(context=(Interface, IPyAMSDefaultLayer, Interface), provides=IResources)
+class ResourcesAdapter(ContextRequestViewAdapter):
+ """PyAMS default skin resources"""
+
+ def get_resources(self):
+ pyams_default_theme.need()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/templates/index.pt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,3 @@
+<div class="margin-20 padding-20 text-align-center">
+ <i class="fa fa-4x fa-cog fa-spin"></i>
+</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/templates/layout.pt Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,192 @@
+<!DOCTYPE html>
+<html lang="en" i18n:domain="pyams_default_theme"
+ tal:define="config extension:configuration;
+ static extension:static_configuration;
+ anonymous request.principal.id == '__none__';"
+ tal:attributes="lang request.locale_name">
+<head>
+ <tal:var replace="structure extension:metas" />
+
+ <title tal:attributes="data-ams-title-prefix config.get_title_prefix(request)"
+ tal:content="config.title"></title>
+
+ <tal:if define="icon config.icon | nothing; url extension:absolute_url(icon);" condition="icon">
+ <!-- Favorite icon -->
+ <link rel="shortcut icon" tal:attributes="href url" type="image/x-icon">
+ <link rel="icon" tal:attributes="href url" type="image/x-icon">
+ </tal:if>
+
+ <tal:var replace="extension:resources" />
+
+</head>
+<body tal:attributes="class static.body_css_class">
+
+ <!-- Page header -->
+ <header id="header" tal:condition="static.include_header">
+
+ <!-- Logo -->
+ <div id="logo-group">
+ <span id="logo"
+ tal:define="logo config.logo | nothing"
+ tal:condition="logo">
+ <a href="/">
+ <img tal:attributes="src extension:absolute_url(logo, '++thumb++200x36.png');" />
+ </a>
+ </span>
+ </div>
+ <!-- end logo -->
+
+ <!-- projects drop-downs -->
+ <div id="top-links" tal:condition="static.include_top_links">
+ <tal:div replace="structure provider:pyams.toplinks" />
+ </div>
+ <!-- end projects drop-downs -->
+
+ <!-- pulled right: nav area -->
+ <div class="pull-right">
+
+ <!-- multiple langs dropdown -->
+ <ul class="header-dropdown-list hidden-xs" tal:condition="static.include_flags">
+ <li tal:content="structure provider:pyams.flags"></li>
+ </ul>
+ <!-- end multiple langs -->
+
+ <!-- collapse menu button -->
+ <div id="hide-menu" class="btn-header pull-right" tal:condition="static.include_menus">
+ <span>
+ <a href="#" title="Hide menu" class="hint" i18n:attributes="title"
+ data-ams-hint-gravity="ne"><i class="fa fa-bars"></i></a>
+ </span>
+ </div>
+ <!-- end collapse menu -->
+
+ <!-- User avatar and user menus -->
+ <div id="user-menu" class="btn-header pull-right margin-left-10"
+ tal:condition="not:anonymous">
+ <span class="btn btn-sm btn-success" data-toggle="dropdown">
+ <tal:var define="profile extension:public_profile(request)">
+ <tal:if condition="profile.avatar">
+ <img tal:define="src extension:absolute_url(profile.avatar)"
+ tal:attributes="src string:${src}/++thumb++square:32x32.png" />
+ </tal:if>
+ <tal:if condition="not:profile.avatar">
+ <i class="fa fa-user img hint" data-ams-hint-gravity="ne"
+ title="Update your profile to select an avatar..." i18n:attributes="title"></i>
+ </tal:if>
+ <i class="fa fa-caret-down pull-right padding-y-5"></i>
+ </tal:var>
+ </span>
+ <tal:var content="structure provider:pyams.user_menus" />
+ </div>
+ <!-- end user avatar -->
+
+ <tal:var define="shortcuts provider:pyams.shortcuts;
+ display_shortcuts (not anonymous) and shortcuts and static.include_user_shortcuts"
+ condition="display_shortcuts">
+ <!-- user shortcuts -->
+ <div class="btn-header pull-right" tal:condition="static.include_menus">
+ <span>
+ <a href="#" title="My shortcuts" id="show-shortcuts" class="hint" i18n:attributes="title"
+ data-ams-hint-gravity="ne"><i class="fa fa-bookmark-o"></i></a>
+ </span>
+ </div>
+ <div id="shortcuts">
+ <tal:var content="structure shortcuts" />
+ <div tal:condition="static.version_location == 'shortcuts'" class="version">
+ <tal:var content="static.application_name" /> - version <tal:var content="static.version" />
+ </div>
+ </div>
+ <!-- end user shortcuts -->
+ </tal:var>
+
+ <tal:if condition="static.include_user_activity and not anonymous">
+ <tal:var define="activity provider:pyams.activity"
+ condition="activity">
+ <!-- user notifications button -->
+ <div id="user-activity" class="btn-header pull-right" tal:condition="static.include_menus">
+ <span>
+ <a href="#" title="Notifications" class="activity-button hint" i18n:attributes="title"
+ data-ams-hint-gravity="ne"><i class="fa fa-bell"></i></a>
+ <b class="badge bg-color-danger txt-color-white hidden">0</b>
+ <!-- AJAX-dropdown -->
+ <div class="ajax-dropdown"
+ tal:content="structure activity">
+ </div>
+ <!-- end AJAX-dropdown -->
+ </span>
+ </div>
+ <!-- end user notifications -->
+ </tal:var>
+ </tal:if>
+
+ <tal:if condition="static.include_mobile_search">
+ <!-- search mobile button (this is hidden till mobile view port) -->
+ <tal:var content="structure provider:pyams.mobile_search" />
+ <!-- end search mobile button -->
+ </tal:if>
+
+ <tal:if condition="static.include_site_search">
+ <!-- site search field -->
+ <tal:var content="structure provider:pyams.site_search" />
+ <!-- end site search field -->
+ </tal:if>
+
+ </div>
+ <!-- end nav area -->
+
+ </header>
+ <!-- end page header -->
+
+ <!-- Menus panel -->
+ <aside id="left-panel" tal:condition="static.include_menus">
+
+ <!-- AJAX progress gear -->
+ <div id="ajax-gear"><i class="fa fa-2x fa-spin fa-gear"></i></div>
+ <!-- Navigation menus -->
+ <nav tal:content="structure provider:pyams.menus"></nav>
+ <span class="minifyme" style=""> <i class="fa fa-arrow-circle-left hit"></i> </span>
+
+ <div tal:condition="static.version_location == 'menus'" class="version">
+ <!-- Application version -->
+ <tal:var content="static.application_name" /> - version <tal:var content="static.version" />
+ </div>
+ </aside>
+ <!-- end menus panel -->
+
+ <!-- Main panel -->
+ <div id="main" role="main">
+
+ <!-- Ribbon -->
+ <div id="ribbon" tal:condition="static.include_ribbon">
+ <!-- Refresh button -->
+ <span class="ribbon-button-alignment">
+ <span id="refresh" class="btn btn-ribbon hint" data-ams-hint-gravity="w" data-ams-hint-html="true"
+ title="<span><i class='text-warning fa fa-warning'></i> WARNING: this will reset all your widgets status!</span>"
+ tal:condition="static.include_reload_button" i18n:attributes="title">
+ <i class="fa fa-refresh"></i>
+ </span>
+ </span>
+ <!-- breadcrumb -->
+ <ol class="breadcrumb">
+ <tal:var content="structure provider:pyams.breadcrumbs" />
+ </ol>
+ </div>
+ <!-- end ribbon -->
+
+ <!-- Content -->
+ <div id="content" style="opacity: 1;">
+ <!--[if lt IE 9]>
+ <h1 i18n:translate="">Your browser is too old. Please install version 9 or higher of Internet Explorer.</h1>
+ <![endif]-->
+ <tal:var content="structure provider:pagelet" />
+ </div>
+ <!-- end content -->
+
+ </div>
+ <!-- end main panel -->
+
+ <!-- Javascript extensions -->
+ <tal:var content="structure provider:pyams.jsextensions" />
+ <!-- end javascript extensions -->
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/tests/__init__.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,1 @@
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/tests/test_utilsdocs.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,59 @@
+#
+# 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.
+#
+
+"""
+Generic Test case for pyams_default_theme doctest
+"""
+__docformat__ = 'restructuredtext'
+
+import unittest
+import doctest
+import sys
+import os
+
+
+current_dir = os.path.dirname(__file__)
+
+def doc_suite(test_dir, setUp=None, tearDown=None, globs=None):
+ """Returns a test suite, based on doctests found in /doctest."""
+ suite = []
+ if globs is None:
+ globs = globals()
+
+ flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE |
+ doctest.REPORT_ONLY_FIRST_FAILURE)
+
+ package_dir = os.path.split(test_dir)[0]
+ if package_dir not in sys.path:
+ sys.path.append(package_dir)
+
+ doctest_dir = os.path.join(package_dir, 'doctests')
+
+ # filtering files on extension
+ docs = [os.path.join(doctest_dir, doc) for doc in
+ os.listdir(doctest_dir) if doc.endswith('.txt')]
+
+ for test in docs:
+ suite.append(doctest.DocFileSuite(test, optionflags=flags,
+ globs=globs, setUp=setUp,
+ tearDown=tearDown,
+ module_relative=False))
+
+ return unittest.TestSuite(suite)
+
+def test_suite():
+ """returns the test suite"""
+ return doc_suite(current_dir)
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/tests/test_utilsdocstrings.py Wed Jun 07 11:23:39 2017 +0200
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+"""
+Generic Test case for pyams_default_theme doc strings
+"""
+__docformat__ = 'restructuredtext'
+
+import unittest
+import doctest
+import sys
+import os
+
+
+current_dir = os.path.abspath(os.path.dirname(__file__))
+
+def doc_suite(test_dir, globs=None):
+ """Returns a test suite, based on doc tests strings found in /*.py"""
+ suite = []
+ if globs is None:
+ globs = globals()
+
+ flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE |
+ doctest.REPORT_ONLY_FIRST_FAILURE)
+
+ package_dir = os.path.split(test_dir)[0]
+ if package_dir not in sys.path:
+ sys.path.append(package_dir)
+
+ # filtering files on extension
+ docs = [doc for doc in
+ os.listdir(package_dir) if doc.endswith('.py')]
+ docs = [doc for doc in docs if not doc.startswith('__')]
+
+ for test in docs:
+ fd = open(os.path.join(package_dir, test))
+ content = fd.read()
+ fd.close()
+ if '>>> ' not in content:
+ continue
+ test = test.replace('.py', '')
+ location = 'pyams_default_theme.%s' % test
+ suite.append(doctest.DocTestSuite(location, optionflags=flags,
+ globs=globs))
+
+ return unittest.TestSuite(suite)
+
+def test_suite():
+ """returns the test suite"""
+ return doc_suite(current_dir)
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')