浏览代码

[enh] csv/json download buttons

asciimoo 11 年前
父节点
当前提交
d1dd6364c9
共有 2 个文件被更改,包括 15 次插入1 次删除
  1. 14
    0
      searx/templates/results.html
  2. 1
    1
      searx/templates/search.html

+ 14
- 0
searx/templates/results.html 查看文件

@@ -18,5 +18,19 @@
18 18
             {% include 'result_templates/default.html' %}
19 19
         {% endif %}
20 20
     {% endfor %}
21
+    <form method="post" action="">
22
+        <div class="left">
23
+            <input type="hidden" name="q" value="{{ q }}" />
24
+            <input type="hidden" name="format" value="csv" />
25
+            <input type="submit" value="download results in csv" />
26
+        </div>
27
+    </form>
28
+    <form method="post" action="">
29
+        <div class="">
30
+            <input type="hidden" name="q" value="{{ q }}" />
31
+            <input type="hidden" name="format" value="json" />
32
+            <input type="submit" value="download results in json" />
33
+        </div>
34
+    </form>
21 35
 </div>
22 36
 {% endblock %}

+ 1
- 1
searx/templates/search.html 查看文件

@@ -1,4 +1,4 @@
1
-<form method="post" action="/" id="search_form">
1
+<form method="post" action="" id="search_form">
2 2
 <div id="search_wrapper">
3 3
     <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
4 4
     <input type="submit" value="" id="search_submit" />