Mercurial > libervia-web
comparison src/pages/tickets/new/page_meta.py @ 973:2e75dc986e03
pages (tickets): URLs for list and new are set in the template for the whole subhierarchy
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 10 Nov 2017 13:32:57 +0100 |
parents | 6e966ef8d69f |
children | 0f676f09404b |
comparison
equal
deleted
inserted
replaced
972:c4e58c4dba75 | 973:2e75dc986e03 |
---|---|
6 from sat.tools.common import template_xmlui | 6 from sat.tools.common import template_xmlui |
7 from sat.core.log import getLogger | 7 from sat.core.log import getLogger |
8 log = getLogger('pages/ticket') | 8 log = getLogger('pages/ticket') |
9 """ticket handling pages""" | 9 """ticket handling pages""" |
10 | 10 |
11 name = u'tickets_new' | |
11 access = C.PAGES_ACCESS_PROFILE | 12 access = C.PAGES_ACCESS_PROFILE |
12 template = u"ticket/create.html" | 13 template = u"ticket/create.html" |
13 | 14 |
14 | 15 |
15 @defer.inlineCallbacks | 16 @defer.inlineCallbacks |
16 def prepare_render(self, request): | 17 def prepare_render(self, request): |
17 data = self.getRData(request) | 18 data = self.getRData(request) |
19 template_data = request.template_data | |
18 service, node = data.get(u'service', u''), data.get(u'node', u'') | 20 service, node = data.get(u'service', u''), data.get(u'node', u'') |
19 profile = self.getProfile(request) | 21 profile = self.getProfile(request) |
20 schema = yield self.host.bridge.ticketsSchemaGet(service.full(), node, profile) | 22 schema = yield self.host.bridge.ticketsSchemaGet(service.full(), node, profile) |
21 data['schema'] = schema | 23 data['schema'] = schema |
22 # following fields are handled in backend | 24 # following fields are handled in backend |
25 try: | 27 try: |
26 # small trick to get a one line text input instead of the big textarea | 28 # small trick to get a one line text input instead of the big textarea |
27 xmlui_obj.widgets[u'labels'].type = u'string' | 29 xmlui_obj.widgets[u'labels'].type = u'string' |
28 except KeyError: | 30 except KeyError: |
29 pass | 31 pass |
30 request.template_data[u'new_ticket_xmlui'] = xmlui_obj | 32 template_data[u'new_ticket_xmlui'] = xmlui_obj |
31 | 33 |
32 @defer.inlineCallbacks | 34 @defer.inlineCallbacks |
33 def on_data_post(self, request): | 35 def on_data_post(self, request): |
34 data = self.getRData(request) | 36 data = self.getRData(request) |
35 service = data['service'] | 37 service = data['service'] |