Esempio n. 1
0
 def renderHTTP(self,ctx):
     args, kwargs = self.getExtraData(ctx)['template']
     if len(args) == 0:
         self.docFactory = skin.loader("Page.html")
     else:
         self.docFactory = skin.loader("Page-%s.html" % (args[0],))
     return super(PageResource,self).renderHTTP(ctx)
Esempio n. 2
0
 def renderer(ctx, data):
     # If it looks like a filename then load a skin, otherwise look for a
     # named fragment.
     if '.' in name:
         fragment = skin.loader(name, ignoreDocType=True)
     else:
         fragment = getattr(self, 'fragment_%s'%name)
     return fragment
Esempio n. 3
0
    def __init__(self, avatar, product, basketURL, template, baseURL=None):
        super(ProductFragment, self).__init__()
        self.avatar = avatar
        self.product = product
        self.basketURL = basketURL
        self.baseURL = url.here

        self.docFactory = skin.loader(template,ignoreDocType=True)
Esempio n. 4
0
        def renderer(ctx, data):
            # Load the template
#            template = tags.invisible[skin.loader(name, ignoreDocType=True)]
            template = tags.invisible[skin.loader(name)]

            # Fill the inherited template's slots with any available patterns.
            for filler in stan.specials(ctx.tag, 'pattern'):
                template.fillSlots(
                    filler._specials['pattern'],
                    inevow.IQ(ctx.tag).allPatterns(filler._specials['pattern'])
                    )

            return template
Esempio n. 5
0
    def __init__(self, avatar, storeSession, baseURL, basketURL, filters=None, data=None, fragmenttemplate=None, browsertemplate=None):
        super(ProductBrowserFragment, self).__init__()
        self.avatar = avatar
        self.storeSession = storeSession
        self.baseURL = baseURL
        self.basketURL = basketURL
        self.filters = filters
        self.data = data
        if fragmenttemplate is not None:
            self.fragmenttemplate = fragmenttemplate

        if browsertemplate is not None:
            self.docFactory = skin.loader(browsertemplate)
        self.item = []
Esempio n. 6
0
 def setTemplate(self, args, kwargs):
     if args:
         self.docFactory = skin.loader("Page-%s.html" % (args[0],))
Esempio n. 7
0
 def setTemplate(self, args, kwargs):
     if len(args) > 0:
         self.docFactory = skin.loader("NewsItem-%s.html" % (args[0],))
Esempio n. 8
0
 def __init__(self, template):
     self.docFactory = skin.loader(template, ignoreDocType=True)
Esempio n. 9
0
 def renderHTTP(self,ctx):
     large = ctx.arg('large',None)
     if large is not None:
         self.docFactory = skin.loader('Photo-zoom.html')
     return super(Photo, self).renderHTTP(ctx)