SLA plugin code updated & SLA app folder cleaned
[myslice.git] / plugins / apply / __init__.py
1 from unfold.plugin import Plugin
2 from plugins.queryupdater import QueryUpdaterPlugin
3
4 class ApplyPlugin(Plugin):
5     
6     def __init__ (self, query=None, **settings):
7         Plugin.__init__ (self, **settings)
8         self.query              = query
9         self.username = str(settings['username'])
10
11     def template_file (self):
12         return "apply.html"
13 #
14 #    def template_env(self, request):
15 #        query_updater = QueryUpdaterPlugin(
16 #            page                = self.page,
17 #            title               = 'Pending operations',
18 #            query               = self.query,
19 #            togglable           = False,
20 #            # start turned off, it will open up itself when stuff comes in
21 #            toggled             = True,
22 #            domid               = 'pending',
23 #            outline_complete    = True,
24 #            username            = request.user, # XXX ???
25 #        )
26 #
27 #        env = Plugin.template_env(self, request)
28 #        env.update({'query_updater': query_updater.render(request)})
29 #        return env
30
31     def requirements (self):
32         reqs = {
33             'js_files' : [
34                 'js/dataTables.js',
35                 'js/apply.js'
36             ],
37             'css_files' : [
38                 'css/dataTables.bootstrap.css',
39                 'css/apply.css'
40             ],
41         }
42         return reqs
43
44     def json_settings_list (self):
45         # query_uuid will pass self.query results to the javascript
46         # and will be available as "record" in :
47         # on_new_record: function(record)
48         return ['plugin_uuid', 'domid', 'query_uuid', 'username']
49
50     def export_json_settings (self):
51         return True