Mercurial > libervia-web
changeset 971:6e966ef8d69f
page(tickets/new): use string instead of textbox for labels, and use comma to split them
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 09 Nov 2017 08:02:49 +0100 |
parents | bc28b9068f91 |
children | c4e58c4dba75 |
files | src/pages/tickets/new/page_meta.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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