summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-12-04 20:07:04 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-12-04 20:07:04 (GMT)
commitf3b88bf17e6a32ec9c7cee7b927b507281727029 (patch)
tree4ba2de7d3229c14e00cd79bf7cb479f1d7af663f
parent569f2b9e8947bb7307b92e64c01daed4b20e56b1 (diff)
downloadtabellio.searchform-f3b88bf17e6a32ec9c7cee7b927b507281727029.zip
tabellio.searchform-f3b88bf17e6a32ec9c7cee7b927b507281727029.tar.gz
tabellio.searchform-f3b88bf17e6a32ec9c7cee7b927b507281727029.tar.bz2
propose to do a full text search if not result were found (#1055)
-rw-r--r--tabellio/searchform/simple.pt23
1 files changed, 21 insertions, 2 deletions
diff --git a/tabellio/searchform/simple.pt b/tabellio/searchform/simple.pt
index 246263c..25cf882 100644
--- a/tabellio/searchform/simple.pt
+++ b/tabellio/searchform/simple.pt
@@ -28,10 +28,10 @@
page_batch python:Batch(list(page_results), b_size, int(b_page_start), orphan=1, b_start_str='b_page_start');
doc_batch python:Batch(list(doc_results), b_size, int(b_doc_start), orphan=1, b_start_str='b_doc_start');
event_batch python:Batch(list(event_results), b_size, int(b_event_start), orphan=1, b_start_str='b_event_start');
+ searchable_text python: request.form.get('SearchableText');
">
<form method="get" action="search2">
- <input name="SearchableText" type="text"
- tal:attributes="value python: request.form.get('SearchableText')"/>
+ <input name="SearchableText" type="text" tal:attributes="value searchable_text"/>
<input type="submit" class="submit-widget" value="Recherche"/>
</form>
@@ -71,6 +71,25 @@
</div>
+ <div id="docs-results" tal:condition="python:len(doc_results) == 0 and searchable_text">
+ <h2 id="b_doc_start">Documents et dossiers</h2>
+ <div class="resultsinfobox">
+ <span>Nombre de résultats : <span tal:replace="python:len(doc_results)"/></span>
+ <a class="button" tal:attributes="href view/docdos_form_url">Filtre avancé</a>
+ </div>
+
+ <p>
+ Aucun document n'a été trouvé lors d'une recherche simple, il est possible
+ d'effectuer la recherche dans les textes des documents, cela peut prendre
+ quelques dizaines de secondes.
+ </p>
+
+ <p>
+ <a tal:attributes="href string:${view/docdos_form_url}?document.widgets.sort_on:list=Session&document.widgets.search_type_is_document=1&document.widgets.text=${searchable_text}">Recherche appronfondie dans les textes</a>
+ </p>
+
+ </div>
+
<div id="docs-results" tal:condition="python:len(doc_results)">
<h2 id="b_doc_start">Documents et dossiers</h2>
<div class="resultsinfobox">