From a0cbc767e7bb67deabda7a75f6ba5389143b86a0 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sat, 19 Oct 2013 22:35:53 +0200 Subject: [PATCH] [enh] number of search results --- searx/templates/results.html | 3 +++ searx/webapp.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/searx/templates/results.html b/searx/templates/results.html index 287f71477..a6191259b 100644 --- a/searx/templates/results.html +++ b/searx/templates/results.html @@ -1,5 +1,8 @@ {% extends "base.html" %} {% block content %} +
+ searx | Number of results: {{ number_of_results }} +
{% include 'search.html' %}
diff --git a/searx/webapp.py b/searx/webapp.py index 6bfe4c40a..c1b13c419 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -84,7 +84,12 @@ def index(): if request.form.get('format') == 'json': # TODO HTTP headers 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) if remember_categs: resp.set_cookie('categories', ','.join(selected_categories))