summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-12-01 19:32:27 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-12-01 19:32:27 (GMT)
commitc16db9285b2c033dfc5eb35d799391aa1651b50b (patch)
tree288d6ddaee322091a21f484b486b73538ae270bd
parent1d40abe85222e3328699e5f18e960eca3dcb658a (diff)
downloadtabellio.searchform-c16db9285b2c033dfc5eb35d799391aa1651b50b.zip
tabellio.searchform-c16db9285b2c033dfc5eb35d799391aa1651b50b.tar.gz
tabellio.searchform-c16db9285b2c033dfc5eb35d799391aa1651b50b.tar.bz2
add title/location to event search (#1062)
-rw-r--r--tabellio/searchform/eventsearch.pt17
-rw-r--r--tabellio/searchform/form.py4
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 @@
<span>Nombre de résultats : <span tal:replace="python: len(search_results)"/></span>
</div>
- <div id="results">
- <ul>
+ <div> <!-- id="results"> -->
+ <ul id="events-ul-list">
<tal:entry tal:repeat="item search_batch">
- <li tal:define="oddrow repeat/item/odd; object python: item.getObject()" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
- <h4><a href="#" tal:attributes="href item/getURL" tal:content="item/Title">Véronique Salvi</a></h4>
- <p><span tal:replace="item/start/day"/> <span tal:replace="python: item.getObject().start_month()">mars</span></p>
- </div></li>
+ <li tal:define="oddrow repeat/item/odd; event python: item.getObject()" tal:attributes="class event/klass"><div>
+ <p class="date"><span tal:content="event/longdatetime"/>
+ <br/><span tal:condition="event/place" class="place" tal:content="event/place"></span>
+ <div class="event-data">
+ <h3><span class="event-type-square">■</span><span tal:replace="event/title"/></h3>
+ <p class="description" tal:condition="event/description" tal:content="event/description"></p>
+ <p class="details"><a href="#" tal:attributes="href event/absolute_url">Détails</a></p>
+ </div>
+ </li>
</tal:entry>
</ul>
</div>
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'