1 from unfold.plugin import Plugin
3 class Hazelnut (Plugin):
5 # set checkboxes if a final column with checkboxes is desired
6 # pass columns as the initial set of columns
7 # if None then this is taken from the query's fields
8 def __init__ (self, query, checkboxes=False, columns=None, datatables_options={}, **settings):
9 Plugin.__init__ (self, **settings)
11 self.checkboxes=checkboxes
12 if columns is not None:
15 self.columns=self.query.fields
16 self.datatables_options=datatables_options
18 def template_file (self):
19 return "hazelnut.html"
21 def template_env (self, request):
23 env.update(self.__dict__)
24 env['columns']=self.columns
27 def requirements (self):
29 'js_files' : [ "js/hazelnut.js",
30 "js/manifold.js", "js/manifold-query.js",
31 "js/dataTables.js", "js/dataTables.bootstrap.js", "js/with-datatables.js",
32 "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js",
33 "js/unfold-helper.js",
35 'css_files': [ "css/hazelnut.css" ,
36 "css/dataTables.bootstrap.css",
41 # the list of things passed to the js plugin
42 def json_settings_list (self): return ['plugin_uuid','query_uuid','checkboxes','datatables_options']