[enh] number of search results

This commit is contained in:
asciimoo 2013-10-19 22:35:53 +02:00
parent 2cfefea06d
commit a0cbc767e7
2 changed files with 9 additions and 1 deletions

View file

@ -1,5 +1,8 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<div class="right">
<a href="/" title="searx" class="site_link">searx</a> | Number of results: {{ number_of_results }}
</div>
<div class="small"> <div class="small">
{% include 'search.html' %} {% include 'search.html' %}
</div> </div>

View file

@ -84,7 +84,12 @@ def index():
if request.form.get('format') == 'json': if request.form.get('format') == 'json':
# TODO HTTP headers # TODO HTTP headers
return json.dumps({'query': query, 'results': results}) return json.dumps({'query': query, 'results': results})
template = render('results.html', results=results, q=query.decode('utf-8'), selected_categories=selected_categories) template = render('results.html'
,results=results
,q=query.decode('utf-8')
,selected_categories=selected_categories
,number_of_results=len(results)
)
resp = make_response(template) resp = make_response(template)
if remember_categs: if remember_categs:
resp.set_cookie('categories', ','.join(selected_categories)) resp.set_cookie('categories', ','.join(selected_categories))