def test_add_new_page_container(self): pageName = 'Dummy' pageTemplate = 'PageService.PageTemplates.PageContainer' pageParentKey = '0' message = Pages.addNewPage(pageName, pageTemplate, pageParentKey) page = Pages.getByKey(message['pageKey']) self.assertEqual(page.name, pageName)
def __init__(self, **kwargs): View.__init__(self, **kwargs) self.templateFile = 'dashboard.html' self.permissionLevel = 1 self.isEdit = True self.toTemplate.blogPages = PacPages.getBlogPages()
def postRender(self, language, query): galleryPages = Pages.getPagesByStringKey(str(self.pageKey)) self.childGalleryPages = [] for page in galleryPages: pageModule = PageModules.getByPageKeyAndLanguage(page.key(), language) contentModule = ContentModules.getByNameAndPageModuleKey('AlbumThumbnail', pageModule.key()) image = ImageStore.getImageWithDescription(contentModule.content, language) self.childGalleryPages.append(dict(name = pageModule.name, path = pageModule.path, image = image))
def postRender(self, language, query): galleryPages = Pages.getPagesByStringKey(str(self.pageKey)) self.childGalleryPages = [] for page in galleryPages: pageModule = PageModules.getByPageKeyAndLanguage( page.key(), language) contentModule = ContentModules.getByNameAndPageModuleKey( 'AlbumThumbnail', pageModule.key()) image = ImageStore.getImageWithDescription(contentModule.content, language) self.childGalleryPages.append( dict(name=pageModule.name, path=pageModule.path, image=image))
def test_add_new_page_no_page_parent(self): message = Pages.addNewPage('dummy', '1', '-1') self.assertEquals(message['status'], '-1')
def editViewDeletePage(self, request): message = Pages.deletePage(request.get('page_string_key')) return message
def editViewUpdatePageSettings(self, request): message = Pages.updatePageSettings(request.get('page_string_key'), request.get('is_startpage'), request.get('sortindex')) return message
def editViewAddNewPage(self, request): return Pages.addNewPage(request.get('page_name'), request.get('page_template'), request.get('page_parent_key'))
def postRender(self, language, query): if language in self.pageData and 'GalleryImages' in self.pageData[language]: self.pageData[language]['AlbumName'] = Pages.getParentPageModuleNameByKeyAndLanguage(self.pageKey, language) self.pageData[language]['ImageList'] = ImageStore.getImageListDescriptions(self.pageData[language]['GalleryImages'], language)