Browse Source

[enh] about page added

asciimoo 11 years ago
parent
commit
9ead6546a4
4 changed files with 39 additions and 41 deletions
  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 {
       -ms-text-size-adjust: 100%;
       -ms-text-size-adjust: 100%;
   color: #444444;
   color: #444444;
 }
 }
+
+#header { position: absolute; top: 0; left: 0; width: 100%; padding: 0 16px; background: #444444; line-height: 40px; }
+#header a { color: #CCCCCC; padding: 0 8px; }
+#header a:hover { color: #FFFFFF; }
+
+.row { max-width: 800px; margin: auto; text-align: justify; }
+.row h1 { font-size: 3em; margin-top: 50px; }
+.row p { padding: 0 10px; }
+
+h1.title { margin-top: 80px; }
+
 .center { text-align: center; }
 .center { text-align: center; }
 
 
 h1 { font-size: 5em; }
 h1 { font-size: 5em; }

+ 19 - 39
searx/templates/about.html

@@ -1,47 +1,27 @@
-<h1>About searx</h1>
+{% extends 'base.html' %}
+{% block content %}
+{% include 'header.html' %}
+<div class="row">
+    <h1>About <a href="/">searx</a></h1>
 
 
-<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>
-
-<h2>FAQ</h2>
-<h3>Trust</h3>
-<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>
+    <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>
 
 
 <h2>Supported engines</h2>
 <h2>Supported engines</h2>
 
 
-<h3>General Category</h3>
-<ul>
-<li>duckduckgo definitions</li>
-<li>duckduckgo</li>
-<li>startpage</li>
-<li>wikipedia</li>
-</ul>
-
-<h3>Images Category</h3>
-<ul>
-<li>flickr</li>
-<li>gimages</li>
-<li>deviantart</li>
-</ul>
+{% for (categ,search_engines) in categs %}
+    <h3>{{ categ.capitalize() }} category</h3>
+    <ul>
+        {% for search_engine in search_engines %}
+        <li>{{ search_engine.name }}</li>
+        {% endfor %}
+    </ul>
+{% endfor %}
 
 
-<h3>Sound Category</h3>
-<ul>
-<li>soundcloud</li>
-</ul>
-
-<h3>Video Category</h3>
-<ul>
-<li>youtube</li>
-</ul>
-
-<h3>IT Category</h3>
-<ul>
-<li>stackoverflow</li>
-<li>github</li>
-</ul>
+<h2>FAQ</h2>
+<h3>Trust</h3>
+<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>
 
 
-<h3>Social media Category</h3>
-<ul>
-<li>twitter</li>
-</ul>
 
 
 <p>please add more engines to this list, pull request are welcome!</p>
 <p>please add more engines to this list, pull request are welcome!</p>
+</div>
+{% endblock %}

+ 2 - 1
searx/templates/index.html

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

+ 7 - 1
searx/webapp.py

@@ -22,7 +22,7 @@ if __name__ == "__main__":
     from os.path import realpath, dirname
     from os.path import realpath, dirname
     path.append(realpath(dirname(realpath(__file__))+'/../'))
     path.append(realpath(dirname(realpath(__file__))+'/../'))
 
 
-from flask import Flask, request, flash, render_template, url_for, Response, make_response
+from flask import Flask, request, render_template, url_for, Response, make_response
 from searx.engines import search, categories
 from searx.engines import search, categories
 from searx import settings
 from searx import settings
 import json
 import json
@@ -102,10 +102,16 @@ def index():
 def fav():
 def fav():
     return ''
     return ''
 
 
+@app.route('/about', methods=['GET'])
+def about():
+    global categories
+    return render('about.html', categs=categories.items())
+
 @app.route('/opensearch.xml', methods=['GET'])
 @app.route('/opensearch.xml', methods=['GET'])
 def opensearch():
 def opensearch():
     global opensearch_xml
     global opensearch_xml
     method = 'post'
     method = 'post'
+    # chrome/chromium only supports HTTP GET....
     if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
     if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
         method = 'get'
         method = 'get'
     ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
     ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))