瀏覽代碼

[enh] about page added

asciimoo 11 年之前
父節點
當前提交
9ead6546a4
共有 4 個文件被更改,包括 39 次插入41 次删除
  1. 11
    0
      searx/static/css/style.css
  2. 19
    39
      searx/templates/about.html
  3. 2
    1
      searx/templates/index.html
  4. 7
    1
      searx/webapp.py

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

@@ -4,6 +4,17 @@ html {
4 4
       -ms-text-size-adjust: 100%;
5 5
   color: #444444;
6 6
 }
7
+
8
+#header { position: absolute; top: 0; left: 0; width: 100%; padding: 0 16px; background: #444444; line-height: 40px; }
9
+#header a { color: #CCCCCC; padding: 0 8px; }
10
+#header a:hover { color: #FFFFFF; }
11
+
12
+.row { max-width: 800px; margin: auto; text-align: justify; }
13
+.row h1 { font-size: 3em; margin-top: 50px; }
14
+.row p { padding: 0 10px; }
15
+
16
+h1.title { margin-top: 80px; }
17
+
7 18
 .center { text-align: center; }
8 19
 
9 20
 h1 { font-size: 5em; }

+ 19
- 39
searx/templates/about.html 查看文件

@@ -1,47 +1,27 @@
1
-<h1>About searx</h1>
1
+{% extends 'base.html' %}
2
+{% block content %}
3
+{% include 'header.html' %}
4
+<div class="row">
5
+    <h1>About <a href="/">searx</a></h1>
2 6
 
3
-<p>searx is a meta-search engine inspired by the seeks-project. You can add it to your browsers search bar and even make it your default search engine. It tries to provide basic privacy by mixing your queries with queries from others while avoiding logging of queries. For all browsers (except chrom*) queries are made using a POST request. Thus they don't show up in our logs, nor in your url history. For chrome users there is an exception searx is used from the search bar, it issues GET requests.</p>
4
-
5
-<h2>FAQ</h2>
6
-<h3>Trust</h3>
7
-<p>It's ok if you don't trust us regarding the logs, <a href="https://github.com/asciimoo/searx">take the code</a> and run it yourself for your friends! decentralize!</p>
7
+    <p>searx is a meta-search engine inspired by the seeks-project.<br />You can add it to your browsers search bar and even make it your default search engine.<br />It tries to provide basic privacy by mixing your queries with queries from others while avoiding logging of queries. For all browsers (except chrom*) queries are made using a POST request. Thus they don't show up in our logs, nor in your url history. For chrome users there is an exception searx is used from the search bar, it issues GET requests.</p>
8 8
 
9 9
 <h2>Supported engines</h2>
10 10
 
11
-<h3>General Category</h3>
12
-<ul>
13
-<li>duckduckgo definitions</li>
14
-<li>duckduckgo</li>
15
-<li>startpage</li>
16
-<li>wikipedia</li>
17
-</ul>
18
-
19
-<h3>Images Category</h3>
20
-<ul>
21
-<li>flickr</li>
22
-<li>gimages</li>
23
-<li>deviantart</li>
24
-</ul>
11
+{% for (categ,search_engines) in categs %}
12
+    <h3>{{ categ.capitalize() }} category</h3>
13
+    <ul>
14
+        {% for search_engine in search_engines %}
15
+        <li>{{ search_engine.name }}</li>
16
+        {% endfor %}
17
+    </ul>
18
+{% endfor %}
25 19
 
26
-<h3>Sound Category</h3>
27
-<ul>
28
-<li>soundcloud</li>
29
-</ul>
30
-
31
-<h3>Video Category</h3>
32
-<ul>
33
-<li>youtube</li>
34
-</ul>
35
-
36
-<h3>IT Category</h3>
37
-<ul>
38
-<li>stackoverflow</li>
39
-<li>github</li>
40
-</ul>
20
+<h2>FAQ</h2>
21
+<h3>Trust</h3>
22
+<p>It's ok if you don't trust us regarding the logs, <a href="https://github.com/asciimoo/searx">take the code</a> and run it yourself for your friends! decentralize!</p>
41 23
 
42
-<h3>Social media Category</h3>
43
-<ul>
44
-<li>twitter</li>
45
-</ul>
46 24
 
47 25
 <p>please add more engines to this list, pull request are welcome!</p>
26
+</div>
27
+{% endblock %}

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

@@ -1,10 +1,11 @@
1 1
 {% extends "base.html" %}
2 2
 {% block content %}
3
+{% include 'header.html' %}
3 4
 <a href="https://github.com/asciimoo/searx" class="github">
4 5
     <img style="position: absolute; top: 0; right: 0; border: 0;" src="/static/img/github_ribbon.png" alt="Fork me on GitHub"  class="github"/>
5 6
 </a>
6 7
 <div class="center">
7
-    <h1>searx</h1>
8
+    <h1 class="title">searx</h1>
8 9
     {% include 'search.html' %}
9 10
 </div>
10 11
 {% endblock %}

+ 7
- 1
searx/webapp.py 查看文件

@@ -22,7 +22,7 @@ if __name__ == "__main__":
22 22
     from os.path import realpath, dirname
23 23
     path.append(realpath(dirname(realpath(__file__))+'/../'))
24 24
 
25
-from flask import Flask, request, flash, render_template, url_for, Response, make_response
25
+from flask import Flask, request, render_template, url_for, Response, make_response
26 26
 from searx.engines import search, categories
27 27
 from searx import settings
28 28
 import json
@@ -102,10 +102,16 @@ def index():
102 102
 def fav():
103 103
     return ''
104 104
 
105
+@app.route('/about', methods=['GET'])
106
+def about():
107
+    global categories
108
+    return render('about.html', categs=categories.items())
109
+
105 110
 @app.route('/opensearch.xml', methods=['GET'])
106 111
 def opensearch():
107 112
     global opensearch_xml
108 113
     method = 'post'
114
+    # chrome/chromium only supports HTTP GET....
109 115
     if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
110 116
         method = 'get'
111 117
     ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))