def __init__(self, **kwargs):
        View.__init__(self, **kwargs)

        self.templateFile = 'imagestore.html'
        self.permissionLevel = 1
        self.isEdit = True
        self.toTemplate.uploadUrl = blobstore.create_upload_url('/edit/AddUpdateImageStore')
        self.toTemplate.imageList = PacImageStore.getAll()

        query = kwargs['query']
        if query.getvalue('item_id'):
            self.itemId = str(query.getvalue('item_id'))
            self.toTemplate.currentImage = PacImageStore.getByIdForEdit(self.itemId)
    def __init__(self, **kwargs):
        View.__init__(self, **kwargs)

        self.templateFile = 'imagestore.html'
        self.permissionLevel = 1
        self.isEdit = True
        self.toTemplate.uploadUrl = blobstore.create_upload_url(
            '/edit/AddUpdateImageStore')
        self.toTemplate.imageList = PacImageStore.getAll()

        query = kwargs['query']
        if query.getvalue('item_id'):
            self.itemId = str(query.getvalue('item_id'))
            self.toTemplate.currentImage = PacImageStore.getByIdForEdit(
                self.itemId)
 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 getSingleImageModule(template, name):
    templateData = {}
    imageList = dbImageStore.ImageStore.all()
    for lang in template.pageData:
        if name in template.pageData[lang] and template.pageData[lang][name] != '':
            templateData[lang] = ImageStore.getByIdForEdit(template.pageData[lang][name])['imageEntry']

    return { 'name' : name, 'type' : 'singleImage', 'file' : 'modules/module_page_single_image.html', 'data' : templateData, 'imageList' : imageList }
 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)
 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 getSingleImageModule(template, name):
    templateData = {}
    imageList = dbImageStore.ImageStore.all()
    for lang in template.pageData:
        if name in template.pageData[lang] and template.pageData[lang][name] != "":
            templateData[lang] = ImageStore.getByIdForEdit(template.pageData[lang][name])["imageEntry"]

    return {
        "name": name,
        "type": "singleImage",
        "file": "modules/module_page_single_image.html",
        "data": templateData,
        "imageList": imageList,
    }
Exemple #8
0
 def editViewDeleteImage(self, request):
     message = ImageStore.DeleteImage(request.get('image_string_key'))
     return message
 def postRender(self, language, query):
     if language in self.pageData and 'MainImage' in self.pageData[
             language] and self.pageData[language]['MainImage'] != '':
         self.pageData[language][
             'LeftImage'] = ImageStore.getImageWithDescription(
                 self.pageData[language]['MainImage'], language)
 def postRender(self, language, query):
     if language in self.pageData and 'MainImage' in self.pageData[language] and self.pageData[language]['MainImage'] != '':
         self.pageData[language]['LeftImage'] = ImageStore.getImageWithDescription(self.pageData[language]['MainImage'], language)
 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)