Skip to content
Snippets Groups Projects
Commit 815e7137f527 authored by Samuel Trégouët's avatar Samuel Trégouët
Browse files

view: move search_comp rendering in method

so it is easier to override this behavior
parent 914633163f12
No related branches found
No related tags found
No related merge requests found
......@@ -77,10 +77,9 @@
class ElasticSearchView(StartupView):
__regid__ = "esearch"
def call(self, **kwargs):
# TODO if no ES configuration, redirect or display warning
def render_search_comp(self):
search_comp = self._cw.vreg['components'].select_or_none('search-comp',
self._cw)
if search_comp:
search_comp.render(w=self.w)
......@@ -82,8 +81,11 @@
search_comp = self._cw.vreg['components'].select_or_none('search-comp',
self._cw)
if search_comp:
search_comp.render(w=self.w)
def call(self, **kwargs):
# TODO if no ES configuration, redirect or display warning
self.render_search_comp()
self.w(u'<h1>%s</h1>' % self._cw._('Recherche'))
query_string = xml_escape(self._cw.form.get('search', ''))
self.w(u'<h2>Resultats pour : <em>%s</em></h2>' % query_string)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment