# HG changeset patch # User Goffi # Date 1510317177 -3600 # Node ID 2e75dc986e0381728b5b31d5fd1004876b852457 # Parent c4e58c4dba75dbc60dab192ab44f051e8ccc4ea0 pages (tickets): URLs for list and new are set in the template for the whole subhierarchy diff -r c4e58c4dba75 -r 2e75dc986e03 src/pages/tickets/new/page_meta.py --- a/src/pages/tickets/new/page_meta.py Fri Nov 10 11:10:15 2017 +0100 +++ b/src/pages/tickets/new/page_meta.py Fri Nov 10 13:32:57 2017 +0100 @@ -8,6 +8,7 @@ log = getLogger('pages/ticket') """ticket handling pages""" +name = u'tickets_new' access = C.PAGES_ACCESS_PROFILE template = u"ticket/create.html" @@ -15,6 +16,7 @@ @defer.inlineCallbacks def prepare_render(self, request): data = self.getRData(request) + template_data = request.template_data service, node = data.get(u'service', u''), data.get(u'node', u'') profile = self.getProfile(request) schema = yield self.host.bridge.ticketsSchemaGet(service.full(), node, profile) @@ -27,7 +29,7 @@ xmlui_obj.widgets[u'labels'].type = u'string' except KeyError: pass - request.template_data[u'new_ticket_xmlui'] = xmlui_obj + template_data[u'new_ticket_xmlui'] = xmlui_obj @defer.inlineCallbacks def on_data_post(self, request): diff -r c4e58c4dba75 -r 2e75dc986e03 src/pages/tickets/page_meta.py --- a/src/pages/tickets/page_meta.py Fri Nov 10 11:10:15 2017 +0100 +++ b/src/pages/tickets/page_meta.py Fri Nov 10 13:32:57 2017 +0100 @@ -42,10 +42,12 @@ node = u'' data = self.getRData(request) - data['service'] = service data['node'] = node + template_data = request.template_data + template_data[u'url_tickets_list'] = self.getPageByName('tickets_list').getURL(service.full(), node or u'@') + template_data[u'url_tickets_new'] = u'/' + ('/'.join(request.prepath + ['new']).decode('utf-8')) @defer.inlineCallbacks def prepare_render(self, request):