Add global search feature

This commit is contained in:
Jonathan Wong 2015-09-25 11:38:55 -07:00
parent 2b9817319a
commit 339361d15c
4 changed files with 119 additions and 0 deletions

View file

@ -1327,6 +1327,12 @@ class WebInterface(object):
cherrypy.response.headers['Content-type'] = 'application/json'
return json.dumps({'message': 'no data received'})
@cherrypy.expose
def search(self, search_query=''):
query = search_query.replace('"', '')
return serve_template(templatename="search.html", title="Search", query=query)
@cherrypy.expose
def search_results(self, query, **kwargs):