예제 #1
0
    def __init__ (self, props_={}):
        props = props_.copy()
        if 'class' in props:
            props['class'] += " carousel"
        else:
            props['class'] = "carousel"

        Box.__init__ (self, props.copy())
        self.images   = List ({'class': 'overview'})
        self.pager    = List ({'class': 'pager'})
        self.controls = None

        Box.__iadd__ (self, self.images)
예제 #2
0
파일: Carousel.py 프로젝트: chetan/cherokee
    def __init__ (self, props_={}):
        props = props_.copy()
        if 'class' in props:
            props['class'] += " carousel"
        else:
            props['class'] = "carousel"

        Box.__init__ (self, props.copy())
        self.images = List ({'class': 'overview'})
        self.pager  = List ({'class': 'pager'})

        Box.__iadd__ (self, self.images)
        arrows = Box({'class':'arrows'})
        arrows += Link (None, RawHTML("%s"%(_('left'))), {'class': "buttons prev"})
        arrows += Link (None, RawHTML("%s"%(_('right'))), {'class': "buttons next"})
        controls = Box({'class':'controls'})
        controls += arrows
        controls += self.pager
        Box.__iadd__ (self, controls)
예제 #3
0
    def Render (self):
        # Add pager and arrows if there is more than 1 item
        if len(self.pager) > 1 and not self.controls:
            arrows = Box({'class':'arrows'})
            arrows += Link (None, RawHTML("%s"%(_('left'))), {'class': "buttons prev"})
            arrows += Link (None, RawHTML("%s"%(_('right'))), {'class': "buttons next"})

            self.controls = Box({'class':'controls'})
            self.controls += arrows
            self.controls += self.pager

            Box.__iadd__ (self, self.controls)

        # Render
        render = Box.Render (self)

        render.headers += HEADERS
        render.js      += JS_INIT %({'id': self.id})

        return render