mirror of https://github.com/searxng/searxng.git
[enh] number of search results
This commit is contained in:
parent
2cfefea06d
commit
a0cbc767e7
|
@ -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>
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue