# HG changeset patch # User Goffi # Date 1510210969 -3600 # Node ID 6e966ef8d69fe4e6652839ca00331cc50ed3fd9e # Parent bc28b9068f912acf8992fc80c4eac9beed3a719a page(tickets/new): use string instead of textbox for labels, and use comma to split them diff -r bc28b9068f91 -r 6e966ef8d69f src/pages/tickets/new/page_meta.py --- a/src/pages/tickets/new/page_meta.py Thu Nov 09 08:02:49 2017 +0100 +++ b/src/pages/tickets/new/page_meta.py Thu Nov 09 08:02:49 2017 +0100 @@ -22,6 +22,11 @@ # following fields are handled in backend ignore = ('reporter', 'created', 'updated', 'comments_uri', 'status') xmlui_obj = template_xmlui.create(self.host, schema, ignore=ignore) + try: + # small trick to get a one line text input instead of the big textarea + xmlui_obj.widgets[u'labels'].type = u'string' + except KeyError: + pass request.template_data[u'new_ticket_xmlui'] = xmlui_obj @defer.inlineCallbacks @@ -32,6 +37,10 @@ posted_data = self.getAllPostedData(request) if not posted_data['title']: self.pageError(request, C.HTTP_BAD_REQUEST) + try: + posted_data['labels'] = [l.strip() for l in posted_data['labels'][0].split(',')] + except (KeyError, IndexError): + pass profile = self.getProfile(request) yield self.host.bridge.ticketsSet(service.full(), node, posted_data, u'', u'', {}, profile) # we don't want to redirect to creation page on success, but to tickets list