Scheduler2 plugin: Disabled logs
[myslice.git] / plugins / lists / simplelist.py
1 from unfold.plugin import Plugin
2
3 class SimpleList (Plugin) :
4
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)
8         self.key=key
9         self.with_datatables = with_datatables
10         # the DOM classname
11         self.classname = classname if classname is not None else "simplelist"
12
13     # SimpleList is useless per se anyways
14     def template_file (self): 
15         return "simplelist.html"
16     
17     def template_env (self, request):
18         env={}
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
24         return env
25
26     def requirements (self):
27         reqs = {
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",
32                            ] ,
33             'css_files': [ "css/simplelist.css" ],
34             }
35         if self.with_datatables:
36             reqs['js_files'].append ("js/dataTables.js")
37             reqs['js_files'].append ("js/with-datatables.js")
38         return reqs
39     
40     def json_settings_list (self): return ['plugin_uuid','query_uuid','key','classname','warning_msg']
41