示例#1
0
 def _get_loaders(self):
     """this method is not used
     over-ridden function _get_loaders that creates
     the loader for the skin templates
     """
     loaders = list()
     skin_dirs = utils.get_available_skins(selected=self.skin).values()
     template_dirs = [os.path.join(skin_dir, 'templates') for skin_dir in skin_dirs]
     loaders.append(jinja_loaders.FileSystemLoader(template_dirs))
     return loaders
示例#2
0
def load_skins():
    skins = dict()
    for skin_name in utils.get_available_skins():
        skins[skin_name] = SkinEnvironment(
                                skin=skin_name,
                                extensions=['jinja2.ext.i18n', 'jinja2.ext.with_']
                            )
        skins[skin_name].set_language(django_settings.LANGUAGE_CODE)
        #from openode.templatetags import extra_filters_jinja as filters
        #skins[skin_name].filters['media'] = filters.media
    return skins