renamed verticallayout into stack
[unfold.git] / plugins / lists / staticlist.py
1 from unfold.plugin import Plugin
2
3 class StaticList (Plugin) :
4
5     # only deal with our own stuff here and let Plugin handle the rest
6     def __init__ (self, list=[], with_datatables=False, **settings):
7         Plugin.__init__ (self, **settings)
8         self.list=list
9         self.with_datatables = with_datatables
10
11     # SimpleList is useless per se anyways
12     def template_file (self): 
13         return "staticlist.html"
14     
15     def template_env (self, request):
16         env={}
17         # would need some cleaner means to set a header here
18         header=getattr(self,'header',None)
19         if header: env['header']=header
20         env['list']=self.list
21         env['with_datatables']= "yes" if self.with_datatables else ""
22         return env
23
24     def requirements (self):
25         reqs = { 'js_files' : [ ] ,
26                  'css_files': [ "css/staticlist.css" ],
27                  }
28         if self.with_datatables:
29             reqs['js_files'].append ("js/dataTables.js")
30             reqs['js_files'].append ("js/with-datatables.js")
31         return reqs