# HG changeset patch # User Samuel Trégouët <samuel.tregouet@logilab.fr> # Date 1465911288 -7200 # Tue Jun 14 15:34:48 2016 +0200 # Node ID 815e7137f5278a41ccdda0290fc0fc7506fb79ef # Parent 914633163f129c0fac13605eb79ddbd036eaf2d7 view: move search_comp rendering in method so it is easier to override this behavior diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -77,13 +77,15 @@ 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) + 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)