summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2013-10-19 22:35:53 +0200
committerasciimoo <asciimoo@gmail.com>2013-10-19 22:35:53 +0200
commita0cbc767e7bb67deabda7a75f6ba5389143b86a0 (patch)
treecf414e464365d847082945557acef562f6b14929
parent2cfefea06d55f1df7ac7e33c874e6d8b1f5edc63 (diff)
[enh] number of search results
-rw-r--r--searx/templates/results.html3
-rw-r--r--searx/webapp.py7
2 files changed, 9 insertions, 1 deletions
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 %}
+<div class="right">
+ <a href="/" title="searx" class="site_link">searx</a> | Number of results: {{ number_of_results }}
+</div>
<div class="small">
{% include 'search.html' %}
</div>
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))