add demo_table{_jui}.css to the mix
[unfold.git] / plugins / hazelnut / hazelnut.py
1 from unfold.plugin import Plugin
2
3 class Hazelnut (Plugin):
4
5     def __init__ (self, query, **settings):
6         Plugin.__init__ (self, **settings)
7         self.query=query
8
9     def template_file (self):
10         return "hazelnut.html"
11
12     def template_env (self, request):
13         env={}
14         env.update(self.__dict__)
15         # xxx need to retrieve metadata
16 # $subject_keys = Plugins::get_default_fields($query->subject, $is_unique);
17 # $fields = Plugins::metadata_get_fields($query->subject);
18 # for now I am hard-coding the ones from haze.py
19         env['subject_fields']=[ 'hostname', 'hrn' ]
20         return env
21
22     def requirements (self):
23         reqs = {
24             'js_files' : [ "js/hazelnut.js", 
25                            "js/manifold.js", "js/manifold-query.js", "js/manifold-core.js",
26                            "js/dataTables.js", "js/with-datatables.js",
27                            "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", 
28                            "js/unfold-helper.js",
29                            ] ,
30             'css_files': [ "css/hazelnut.css" , "css/demo_table.css", "css/demo_table_jui.css", ],
31             }
32         return reqs
33
34     # the list of things passed to the js plugin
35     def json_settings_list (self): return ['plugin_uuid','query_uuid']