1 from unfold.plugin import Plugin
3 class StaticList (Plugin) :
5 """ StaticList allows you to display an html list
6 that you provide the contents for in the 'list' input argument
7 It is static in the sense that no query is going to be used to
11 # only deal with our own stuff here and let Plugin handle the rest
12 def __init__ (self, list=[], with_datatables=False, **settings):
13 Plugin.__init__ (self, **settings)
15 self.with_datatables = with_datatables
17 # SimpleList is useless per se anyways
18 def template_file (self):
19 return "staticlist.html"
21 def template_env (self, request):
23 # would need some cleaner means to set a header here
24 header=getattr(self,'header',None)
25 if header: env['header']=header
27 env['with_datatables']= "yes" if self.with_datatables else ""
30 def requirements (self):
31 reqs = { 'js_files' : [ ] ,
32 'css_files': [ "css/staticlist.css" ],
34 if self.with_datatables:
35 reqs['js_files'].append ("js/dataTables.js")
36 reqs['js_files'].append ("js/with-datatables.js")