1 from unfold.composite import Composite
2 from unfold.plugin import Plugin
4 class Wizard(Composite):
6 def __init__(self, *args, **kwargs):
7 Composite.__init__(self, *args, **kwargs)
8 self.validate_step_js = []
10 # This, as well as the setting passing code, requires all step to be passed at init :/
11 for i, son in enumerate(self.sons):
13 js = son.get_validation_js()
14 js_name = "%s_validate_step_%d" % (self.domid.replace('-', '_'), i)
15 self.add_js_chunks("""
22 self.validate_step_js.append(js_name)
24 # self.add_js_chunks("""
28 # """ % (js_name, js))
30 def export_json_settings(self):
31 # We need initialization, even though we are not associated with a query
34 def requirements (self):
35 #return { 'js_files' : ['js/wizard.js', 'js/jquery.smartWizard-2.0.min.js', ],
36 return { 'js_files' : ['js/wizard.js', 'js/jquery.smartWizard-2.0.js', ],
37 'css_files' : ['css/wizard.css', 'css/smart_wizard.css', ]
40 def template_file (self):
43 # the list of things passed to the js plugin
44 def json_settings_list (self): return ['plugin_uuid', 'start_step', 'validate_step_js']