浏览代码

[enh] suggestion rendering

asciimoo 11 年前
父节点
当前提交
33969ca670
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 3
    0
      searx/static/css/style.css
  2. 6
    3
      searx/templates/results.html

+ 3
- 0
searx/static/css/style.css 查看文件

@@ -136,3 +136,6 @@ tr:hover td { background: #DDDDDD; }
136 136
 }
137 137
 
138 138
 #results { margin-left: 10px; margin-top: 10px; }
139
+
140
+#suggestions { max-width: 50em;}
141
+#suggestions span { padding: 2px 6px; margin: 2px 4px;  font-size: 0.8em; display: inline-block; background: #E4E4E4; border-radius: 4px; }

+ 6
- 3
searx/templates/results.html 查看文件

@@ -5,9 +5,12 @@
5 5
     {% include 'search.html' %}
6 6
 </div>
7 7
 <div id="results">
8
-<div>
9
-    Number of results: {{ number_of_results }}
10
-</div>
8
+    {% if suggestions %}
9
+    <div id="suggestions">Suggestions: {% for suggestion in suggestions %}<span>{{ suggestion }}</span>{% endfor %}</div>
10
+    {% endif %}
11
+    <div>
12
+        Number of results: {{ number_of_results }}
13
+    </div>
11 14
     {% for result in results %}
12 15
         {% if result['template'] %}
13 16
             {% include 'result_templates/'+result['template'] %}