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