소스 검색

[enh] /engines page added

asciimoo 11 년 전
부모
커밋
8b3ca1112c
2개의 변경된 파일32개의 추가작업 그리고 1개의 파일을 삭제
  1. 26
    0
      searx/templates/engines.html
  2. 6
    1
      searx/webapp.py

+ 26
- 0
searx/templates/engines.html 파일 보기

@@ -0,0 +1,26 @@
1
+{% extends 'base.html' %}
2
+{% block content %}
3
+<div class="row">
4
+<h2>Currently used search engines</h2>
5
+
6
+    <table style="width: 80%;">
7
+        <tr>
8
+            <th>Engine name</th>
9
+            <th>Category</th>
10
+        </tr>
11
+    {% for (categ,search_engines) in categs %}
12
+        {% for search_engine in search_engines %}
13
+
14
+            {% if not search_engine.private %}
15
+            <tr>
16
+                <td>{{ search_engine.name }}</td>
17
+                <td>{{ categ }}</td>
18
+            </tr>
19
+            {% endif %}
20
+        {% endfor %}
21
+    {% endfor %}
22
+    </table>
23
+<p>Please add more engines to this list, pull requests are welcome!</p>
24
+<p class="right"><a href="/">back</a></p>
25
+</div>
26
+{% endblock %}

+ 6
- 1
searx/webapp.py 파일 보기

@@ -174,8 +174,13 @@ def index():
174 174
 
175 175
 @app.route('/about', methods=['GET'])
176 176
 def about():
177
+    return render('about.html')
178
+
179
+
180
+@app.route('/engines', methods=['GET'])
181
+def list_engines():
177 182
     global categories
178
-    return render('about.html', categs=categories.items())
183
+    return render('engines.html', categs=categories.items())
179 184
 
180 185
 
181 186
 @app.route('/preferences', methods=['GET', 'POST'])