class Hazelnut (Plugin):
- def __init__ (self, query, checkboxes=False, **settings):
+ # set checkboxes if a final column with checkboxes is desired
+ # pass columns as the initial set of columns
+ # if None then this is taken from the query's fields
+ def __init__ (self, query, checkboxes=False, columns=None, **settings):
Plugin.__init__ (self, **settings)
self.query=query
self.checkboxes=checkboxes
+ if columns is not None:
+ self.columns=columns
+ else:
+ self.columns=self.query.fields
def template_file (self):
return "hazelnut.html"
def template_env (self, request):
env={}
env.update(self.__dict__)
- # xxx need to retrieve metadata
-# $subject_keys = Plugins::get_default_fields($query->subject, $is_unique);
-# $fields = Plugins::metadata_get_fields($query->subject);
-# for now I am hard-coding the ones from haze.py
- env['subject_fields']=[ 'network', 'type', 'hostname', 'hrn' ]
+ env['columns']=self.columns
return env
def requirements (self):
"js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js",
"js/unfold-helper.js",
] ,
- 'css_files': [ "css/hazelnut.css" , "css/demo_table.css", "css/demo_table_jui.css", ],
+ 'css_files': [ "css/hazelnut.css" ,
+ "css/demo_table.css", "css/demo_table_jui.css", "css/jquery-ui.css",
+ ],
}
return reqs
# the list of things passed to the js plugin
- def json_settings_list (self): return ['plugin_uuid','query_uuid']
+ def json_settings_list (self): return ['plugin_uuid','query_uuid','checkboxes']