コード例 #1
0
    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)
コード例 #2
0
    def __init__(self, **kwargs):
        View.__init__(self, **kwargs)

        self.templateFile = 'dashboard.html'
        self.permissionLevel = 1
        self.isEdit = True
        self.toTemplate.blogPages = PacPages.getBlogPages()
コード例 #3
0
 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))
コード例 #4
0
 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))
コード例 #5
0
    def test_add_new_page_no_page_parent(self):
        message = Pages.addNewPage('dummy', '1', '-1')

        self.assertEquals(message['status'], '-1')
コード例 #6
0
 def editViewDeletePage(self, request):
     message = Pages.deletePage(request.get('page_string_key'))
     return message
コード例 #7
0
 def editViewUpdatePageSettings(self, request):
     message = Pages.updatePageSettings(request.get('page_string_key'),
                                        request.get('is_startpage'),
                                        request.get('sortindex'))
     return message
コード例 #8
0
 def editViewAddNewPage(self, request):
     return Pages.addNewPage(request.get('page_name'),
                             request.get('page_template'),
                             request.get('page_parent_key'))
コード例 #9
0
    def test_add_new_page_no_page_parent(self):
        message = Pages.addNewPage('dummy', '1', '-1')

        self.assertEquals(message['status'], '-1')
コード例 #10
0
 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)
コード例 #11
0
 def editViewDeletePage(self, request):
     message = Pages.deletePage(request.get('page_string_key'))
     return message
コード例 #12
0
 def editViewUpdatePageSettings(self, request):
     message = Pages.updatePageSettings(request.get('page_string_key'), request.get('is_startpage'), request.get('sortindex'))
     return message
コード例 #13
0
 def editViewAddNewPage(self, request):
     return Pages.addNewPage(request.get('page_name'), request.get('page_template'), request.get('page_parent_key'))