From c16db9285b2c033dfc5eb35d799391aa1651b50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 1 Dec 2011 20:32:27 +0100 Subject: [PATCH] add title/location to event search (#1062) --- tabellio/searchform/eventsearch.pt | 17 +++++++++++------ tabellio/searchform/form.py | 4 ++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tabellio/searchform/eventsearch.pt b/tabellio/searchform/eventsearch.pt index 385af5f..b0d8efe 100644 --- a/tabellio/searchform/eventsearch.pt +++ b/tabellio/searchform/eventsearch.pt @@ -32,13 +32,18 @@ Nombre de résultats : -
-
    +
    +
    diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py index fb199b1..d57e8ab 100644 --- a/tabellio/searchform/form.py +++ b/tabellio/searchform/form.py @@ -577,6 +577,7 @@ class DeputySearchForm(form.Form): class IEventSearch(interface.Interface): search_type_is_event = schema.TextLine(title=u'Search Type', default=u'1', required=False) + text = schema.TextLine(title=_(u'Title / Location'), required=False) start = schema.Date(title=_(u'Start'), required=False) end = schema.Date(title=_(u'End'), required=False) @@ -956,6 +957,9 @@ class SearchView(BrowserView): elif data.get('end'): kw['start'] = {'query': data.get('end'), 'range': 'max'} + if data.get('text'): + kw['SearchableText'] = data.get('text') + kw['sort_on'] = 'start' kw['sort_order'] = 'descending'