import os from scaffold.core.widget import base_widget class control(base_widget): """Image cycle widgets""" view = [] buttons = [] content = [] count = 0 with open(os.path.abspath('./widgets/banner_slider.js')) as fp: script = [fp.read()] def create(self): self.reset() def reset(self): self.view = [] self.buttons = [] self.content = [] def append(self, image, link, title, intro=''): text = '
%s
%s
' % (title, intro) if title else '' if link: self.content.append(u'%s' % (link, self.uri.add_domain(image), text)) else: self.content.append(u'%s' % (self.uri.add_domain(image), text)) def render(self): self.count += 1 htm = u'
' return htm