fewer js source files : manifold.js holds the global manifold object (that maps uuids...
[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, **settings):
7         Plugin.__init__ (self, **settings)
8         self.key=key
9         self.with_datatables = with_datatables
10
11     # SimpleList is useless per se anyways
12     def template_file (self): 
13         return "simplelist.html"
14     
15     def template_env (self, request):
16         env={}
17         header=getattr(self,'header',None)
18         if header: env['header']=header
19         env['with_datatables']= "yes" if self.with_datatables else ""
20         return env
21
22     def requirements (self):
23         reqs = {
24             'js_files' : [ "js/simplelist.js", "js/plugin.js",
25                            "js/manifold.js", "js/manifold-query.js", 
26                            "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", 
27                            "js/myslice.js",
28                            ] ,
29             'css_files': [ "css/simplelist.css" ],
30             }
31         if self.with_datatables:
32             reqs['js_files'].append ("js/dataTables.js")
33             reqs['js_files'].append ("js/with-datatables.js")
34         return reqs
35     
36     def json_settings_list (self): return ['plugin_uuid','query_uuid','key']
37