on master help sign in
Few fixes

- Whitespaces - Change a few <p> in <span> - Add RSS to allow browser detection - A few UIUX changes - Add a few more allowed translations

commit389fc3b8b27e52a0959c4008ad303337f1c3c827 authorCqoicebordel <Cqoicebordel@users.noreply.github.com> dateThu 15 Jan 2015, 01:48 (12 years ago) parent08df681
11 files changed+115−107
searx/templates/default/base.html+31−30 searx/templates/default/categories.html+3−3 searx/templates/default/infobox.html+38−38 searx/templates/default/preferences.html+5−6 searx/templates/default/result_templates/default.html+2−2 searx/templates/default/result_templates/images.html+1−1 searx/templates/default/result_templates/map.html+8−8 searx/templates/default/result_templates/torrent.html+5−1 searx/templates/default/result_templates/videos.html+3−3 searx/templates/default/results.html+13−10 searx/templates/default/search.html+6−5
searx/templates/default/base.html+31−30
@@ -1,33 +1,34 @@
11<!DOCTYPE html>
22<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3−<head>
4− <meta charset="UTF-8" />
5− <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
6− <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
7− <meta name="generator" content="searx/{{ searx_version }}">
8− <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
9− <title>{% block title %}{% endblock %}searx</title>
10− <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
11− <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
12− {% block styles %}
13− {% endblock %}
14− {% block head %}
15− <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
16− {% endblock %}
17−</head>
18−<body>
19−<div id="container">
20−{% block content %}
21−{% endblock %}
22−{% if autocomplete %}
23−<script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script>
24−<script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script>
25−{% endif %}
26−<script type="text/javascript">
27− searx = {};
28− searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
29−</script>
30−<script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
31−</div>
32−</body>
3+ <head>
4+ <meta charset="UTF-8" />
5+ <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
6+ <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
7+ <meta name="generator" content="searx/{{ searx_version }}">
8+ <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
9+ <title>{% block title %}{% endblock %}searx</title>
10+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
11+ <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
12+ {% block styles %}
13+ {% endblock %}
14+ {% block meta %}{% endblock %}
15+ {% block head %}
16+ <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
17+ {% endblock %}
18+ </head>
19+ <body>
20+ <div id="container">
21+ {% block content %}
22+ {% endblock %}
23+ {% if autocomplete %}
24+ <script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script>
25+ <script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script>
26+ {% endif %}
27+ <script type="text/javascript">
28+ searx = {};
29+ searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
30+ </script>
31+ <script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
32+ </div>
33+ </body>
3334</html>
searx/templates/default/categories.html+3−3
@@ -1,10 +1,10 @@
11<div id="categories">
22 <div id="categories_container">
3−{% for category in categories %}
3+ {% for category in categories %}
44 <div class="checkbox_container">
55 <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">{{ _(category) }}</label>
66 </div>
7−{% endfor %}
8− <div class="hidden">{{ _('Click on the magnifier to perform search') }}</div>
7+ {% endfor %}
8+ {% if display_tooltip %}<div class="hidden">{{ _('Click on the magnifier to perform search') }}</div>{% endif %}
99 </div>
1010</div>
searx/templates/default/infobox.html+38−38
@@ -1,44 +1,44 @@
11<div class="infobox">
2− <h2>{{ infobox.infobox }}</h2>
3− {% if infobox.img_src %}<img src="{{ infobox.img_src }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %}
4− <p>{{ infobox.entity }}</p>
5− <p>{{ infobox.content | safe }}</p>
6− {% if infobox.attributes %}
7− <div class="attributes">
8− <table>
9− {% for attribute in infobox.attributes %}
10− <tr><td>{{ attribute.label }}</td><td>{{ attribute.value }}</td></tr>
11− {% endfor %}
12− </table>
13− </div>
14− {% endif %}
2+ <h2>{{ infobox.infobox }}</h2>
3+ {% if infobox.img_src %}<img src="{{ infobox.img_src }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %}
4+ <p>{{ infobox.entity }}</p>
5+ <p>{{ infobox.content | safe }}</p>
6+ {% if infobox.attributes %}
7+ <div class="attributes">
8+ <table>
9+ {% for attribute in infobox.attributes %}
10+ <tr><td>{{ attribute.label }}</td><td>{{ attribute.value }}</td></tr>
11+ {% endfor %}
12+ </table>
13+ </div>
14+ {% endif %}
1515
16− {% if infobox.urls %}
17− <div class="urls">
18− <ul>
19− {% for url in infobox.urls %}
20− <li class="url"><a href="{{ url.url }}">{{ url.title }}</a></li>
21− {% endfor %}
22− </ul>
23− </div>
24− {% endif %}
16+ {% if infobox.urls %}
17+ <div class="urls">
18+ <ul>
19+ {% for url in infobox.urls %}
20+ <li class="url"><a href="{{ url.url }}">{{ url.title }}</a></li>
21+ {% endfor %}
22+ </ul>
23+ </div>
24+ {% endif %}
2525
26− {% if infobox.relatedTopics %}
27− <div class="relatedTopics">
28− {% for topic in infobox.relatedTopics %}
29− <div>
30− <h3>{{ topic.name }}</h3>
31− {% for suggestion in topic.suggestions %}
32− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
33− <input type="hidden" name="q" value="{{ suggestion }}">
34− <input type="submit" value="{{ suggestion }}" />
35− </form>
36− {% endfor %}
37− </div>
38− {% endfor %}
39− </div>
40− {% endif %}
26+ {% if infobox.relatedTopics %}
27+ <div class="relatedTopics">
28+ {% for topic in infobox.relatedTopics %}
29+ <div>
30+ <h3>{{ topic.name }}</h3>
31+ {% for suggestion in topic.suggestions %}
32+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
33+ <input type="hidden" name="q" value="{{ suggestion }}">
34+ <input type="submit" value="{{ suggestion }}" />
35+ </form>
36+ {% endfor %}
37+ </div>
38+ {% endfor %}
39+ </div>
40+ {% endif %}
4141
42− <br />
42+ <br />
4343
4444</div>
searx/templates/default/preferences.html+5−6
@@ -7,9 +7,8 @@
77 <form method="post" action="{{ url_for('preferences') }}" id="search_form">
88 <fieldset>
99 <legend>{{ _('Default categories') }}</legend>
10− <p>
10+ {% set display_tooltip = false %}
1111 {% include 'default/categories.html' %}
12− </p>
1312 </fieldset>
1413 <fieldset>
1514 <legend>{{ _('Search language') }}</legend>
@@ -79,9 +78,9 @@
7978 <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</td>
8079 <td>{{ _(categ) }}</td>
8180 <td class="engine_checkbox">
82− <input type="checkbox" id="engine_{{ categ }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}"{% if search_engine.name in blocked_engines %} checked="checked"{% endif %} />
83− <label class="allow" for="engine_{{ categ }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
84− <label class="deny" for="engine_{{ categ }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label>
81+ <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}"{% if search_engine.name in blocked_engines %} checked="checked"{% endif %} />
82+ <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
83+ <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label>
8584 </td>
8685 </tr>
8786 {% endif %}
@@ -95,7 +94,7 @@
9594 </p>
9695
9796 <input type="submit" value="{{ _('save') }}" />
98− <div class="right preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
97+ <div class="right preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
9998 </form>
10099</div>
101100{% endblock %}
searx/templates/default/result_templates/default.html+2−2
@@ -1,6 +1,6 @@
11<div class="result {{ result.class }}">
22 <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3− <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
4− {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
3+ <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a>
4+ {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
55 <p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
66</div>
searx/templates/default/result_templates/images.html+1−1
@@ -1,6 +1,6 @@
11<div class="image_result">
22 <p>
33 <a href="{{ result.img_src }}"><img src="{{ result.img_src }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a>
4− <span class="url"><a href="{{ result.url }}" class="small_font">original context</a></span>
4+ <span class="url"><a href="{{ result.url }}" class="small_font">{{ _('original context') }}</a></span>
55 </p>
66</div>
searx/templates/default/result_templates/map.html+8−8
@@ -1,13 +1,13 @@
11<div class="result {{ result.class }}">
22
3− {% if "icon_"~result.engine~".ico" in favicons %}
3+ {% if "icon_"~result.engine~".ico" in favicons %}
44 <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />
5− {% endif %}
5+ {% endif %}
66
7− <div>
8− <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
9− <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
10− {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
11− <p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
12− </div>
7+ <div>
8+ <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
9+ <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a>
10+ {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
11+ <p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
12+ </div>
1313</div>
searx/templates/default/result_templates/torrent.html+5−1
@@ -5,5 +5,9 @@
55 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
66 <p class="url">{{ result.pretty_url }}</p>
77 {% if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif %}
8− <p><a href="{{ result.magnetlink }}" class="magnetlink">magnet link</a> - <span class="stats">Seed: {{ result.seed }}, Leech: {{ result.leech }}</span></p>
8+ <p>
9+ {% if result.magnetlink %}<a href="{{ result.magnetlink }}" class="magnetlink">{{ _('magnet link') }}</a>{% endif %}
10+ {% if result.torrentfile %}<a href="{{ result.torrentfile }}" class="torrentfile">{{ _('torrent file') }}</a>{% endif %} -
11+ <span class="stats">{{ _('Seeder') }} : {{ result.seed }}, {{ _('Leecher') }} : {{ result.leech }}</span>
12+ </p>
913</div>
searx/templates/default/result_templates/videos.html+3−3
@@ -1,6 +1,6 @@
11<div class="result">
22 <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3− {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
4− <a href="{{ result.url }}"><img class="thumbnail" src="{{ result.thumbnail }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a>
5− <p class="url">{{ result.url }}</p>
3+ {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span><br />{% endif %}
4+ <a href="{{ result.url }}"><img class="thumbnail" src="{{ result.thumbnail }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a>
5+ <p class="url">{{ result.url }}</p>
66</div>
searx/templates/default/results.html+13−10
@@ -1,5 +1,6 @@
11{% extends "default/base.html" %}
22{% block title %}{{ q }} - {% endblock %}
3+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;format=rss&amp;{% for category in selected_categories %}category_{{ category }}=1&amp;{% endfor %}pageno={{ pageno }}">{% endblock %}
34{% block content %}
45<div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div>
56<div class="small search center">
@@ -39,12 +40,14 @@
3940 {% endif %}
4041
4142 {% if suggestions %}
42− <div id="suggestions"><span>{{ _('Suggestions') }}</span>
43+ <div id="suggestions"><span id="suggestions-title">{{ _('Suggestions') }} : </span>
44+ {% set first = true %}
4345 {% for suggestion in suggestions %}
44− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
46+ {% if not first %} &bull; {% endif %}<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
4547 <input type="hidden" name="q" value="{{ suggestion }}">
46− <input type="submit" value="{{ suggestion }}" />
48+ <input type="submit" class="suggestion" value="{{ suggestion }}" />
4749 </form>
50+ {% set first = false %}
4851 {% endfor %}
4952 </div>
5053 {% endif %}
@@ -55,7 +58,7 @@
5558 {% include 'default/infobox.html' %}
5659 {% endfor %}
5760 </div>
58− {% endif %}
61+ {% endif %}
5962
6063 {% for result in results %}
6164 {% if result['template'] %}
@@ -81,12 +84,12 @@
8184 {% endif %}
8285 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
8386 <div class="right">
84− {% for category in selected_categories %}
85− <input type="hidden" name="category_{{ category }}" value="1"/>
86− {% endfor %}
87− <input type="hidden" name="q" value="{{ q }}" />
88− <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
89− <input type="submit" value="{{ _('next page') }} >>" />
87+ {% for category in selected_categories %}
88+ <input type="hidden" name="category_{{ category }}" value="1"/>
89+ {% endfor %}
90+ <input type="hidden" name="q" value="{{ q }}" />
91+ <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
92+ <input type="submit" value="{{ _('next page') }} >>" />
9093 </div>
9194 </form>
9295
searx/templates/default/search.html+6−5
@@ -1,7 +1,8 @@
11<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form">
2− <div id="search_wrapper">
3− <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" size="100" {% if q %}value="{{ q }}"{% endif %}/>
4− <input type="submit" value="search" id="search_submit" />
5− </div>
6− {% include 'default/categories.html' %}
2+ <div id="search_wrapper">
3+ <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" size="100" {% if q %}value="{{ q }}"{% endif %}/>
4+ <input type="submit" value="search" id="search_submit" />
5+ </div>
6+ {% set display_tooltip = true %}
7+ {% include 'default/categories.html' %}
78</form>