示例#1
0
文件: homepage.py 项目: hforge/itws
 def init_resource(self, **kw):
     self.make_resource('ws-data', WSDataFolder)
     self.make_resource('repository', Repository)
     # Sidebar Aware
     SideBarAware.init_resource(self, **kw)
     # ContentBar Aware
     ContentBarAware.init_resource(self, **kw)
示例#2
0
    def init_resource(self, **kw):
        if 'add_boxes' in kw:
            add_boxes = kw.get('add_boxes')
            del kw['add_boxes']
        else:
            add_boxes = True

        SideBarAware.init_resource(self, **kw)
        ContentBarAware.init_resource(self, **kw)
        ResourcesOrderedContainer.init_resource(self, **kw)

        # Preorder items
        if kw.get('add_boxes', True) is True:
            site_root = self.get_site_root()
            language = site_root.get_property('website_languages')[0]

            repository = self.get_site_root().get_repository()
            sidebar_table = self.get_resource(self.sidebar_name)
            # tags cloud (created by repository)
            sidebar_table.add_new_record({'name': repository.tags_box})
            # TOC
            box_cls = ContentBoxSectionChildrenToc
            self.make_resource('toc', box_cls,
                    title={language: box_cls.class_title.gettext()})
            contentbar_table = self.get_resource(self.contentbar_name)
            contentbar_table.add_new_record({'name': 'toc'})
示例#3
0
文件: homepage.py 项目: hforge/itws
 def get_internal_use_resource_names(self):
     return freeze(SideBarAware.get_internal_use_resource_names(self) +
                   ContentBarAware.get_internal_use_resource_names(self) +
                   ['ws-data/', 'repository/'])
示例#4
0
 def get_internal_use_resource_names(self):
     return freeze(SideBarAware.get_internal_use_resource_names(self) +
                   ContentBarAware.get_internal_use_resource_names(self) +
                   ['order-section', 'children-toc'])
示例#5
0
 def get_catalog_values(self):
     return merge_dicts(ResourcesOrderedContainer.get_catalog_values(self),
                        TagsAware.get_catalog_values(self),
                        SideBarAware.get_catalog_values(self),
                        ContentBarAware.get_catalog_values(self))