1 from unfold.plugin import Plugin
3 class SimpleList (Plugin) :
5 # only deal with our own stuff here and let Plugin handle the rest
6 def __init__ (self, key, with_datatables=False, classname=None, **settings):
7 Plugin.__init__ (self, **settings)
9 self.with_datatables = with_datatables
11 self.classname = classname if classname is not None else "simplelist"
13 # SimpleList is useless per se anyways
14 def template_file (self):
15 return "simplelist.html"
17 def template_env (self, request):
19 # would need some cleaner means to set a header here
20 header=getattr(self,'header',None)
21 if header: env['header']=header
22 env['with_datatables']= "yes" if self.with_datatables else ""
23 env['classname']=self.classname
26 def requirements (self):
28 'js_files' : [ "js/simplelist.js",
29 "js/manifold.js", "js/manifold-query.js",
30 "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js",
31 "js/unfold-helper.js",
33 'css_files': [ "css/simplelist.css" ],
35 if self.with_datatables:
36 reqs['js_files'].append ("js/dataTables.js")
37 reqs['js_files'].append ("js/with-datatables.js")
40 def json_settings_list (self): return ['plugin_uuid','query_uuid','key','classname','warning_msg']