diff options
Diffstat (limited to 'searx/templates')
96 files changed, 3262 insertions, 0 deletions
diff --git a/searx/templates/__common__/about.html b/searx/templates/__common__/about.html new file mode 100644 index 0000000..bf17333 --- /dev/null +++ b/searx/templates/__common__/about.html @@ -0,0 +1,63 @@ +<div{% if rtl %} dir="ltr"{% endif %}> + <h1>About <a href="{{ url_for('index') }}">searx</a></h1> + + <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users. + </p> + <h2>Why use searx?</h2> + <ul> + <li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li> + <li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li> + <li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li> + </ul> + <p>If you do care about privacy, want to be a conscious user, or otherwise believe + in digital freedom, make searx your default search engine or run it on your own server</p> + +<h2>Technical details - How does it work?</h2> + +<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, +inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br /> +It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.<br /> +Searx can be added to your browser's search bar; moreover, it can be set as the default search engine. +</p> + +<h2>How can I make it my own?</h2> + +<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer! +<br />The more decentralized the Internet is, the more freedom we have!</p> + + +<h2>More about searx</h2> + +<ul> + <li><a href="https://github.com/asciimoo/searx">github</a></li> + <li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li> + <li><a href="https://twitter.com/Searx_engine">twitter</a></li> + <li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li> + <li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li> +</ul> + + +<hr /> + +<h2 id="faq">FAQ</h2> + +<h3>How to add to firefox?</h3> +<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p> + +<h2 id="dev_faq">Developer FAQ</h2> + +<h3>New engines?</h3> +<ul> + <li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li> + <li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li> +</ul> +<p>Don't forget to restart searx after config edit!</p> + +<h3>Installation/WSGI support?</h3> +<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p> + +<h3>How to debug engines?</h3> +<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p> + +</div> +{% include "__common__/aboutextend.html" ignore missing %} diff --git a/searx/templates/__common__/opensearch.xml b/searx/templates/__common__/opensearch.xml new file mode 100644 index 0000000..15d3eb7 --- /dev/null +++ b/searx/templates/__common__/opensearch.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> + <ShortName>{{ instance_name }}</ShortName> + <Description>a privacy-respecting, hackable metasearch engine</Description> + <InputEncoding>UTF-8</InputEncoding> + <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image> + <LongName>searx metasearch</LongName> + {% if opensearch_method == 'get' %} + <Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/> + {% if autocomplete %} + <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter"> + <Param name="format" value="x-suggestions" /> + <Param name="q" value="{searchTerms}" /> + </Url> + {% endif %} + {% else %} + <Url type="text/html" method="post" template="{{ host }}"> + <Param name="q" value="{searchTerms}" /> + </Url> + {% if autocomplete %} + <!-- TODO, POST REQUEST doesn't work --> + <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter"> + <Param name="format" value="x-suggestions" /> + <Param name="q" value="{searchTerms}" /> + </Url> + {% endif %} + {% endif %} +</OpenSearchDescription> diff --git a/searx/templates/__common__/opensearch_response_rss.xml b/searx/templates/__common__/opensearch_response_rss.xml new file mode 100644 index 0000000..32c42e7 --- /dev/null +++ b/searx/templates/__common__/opensearch_response_rss.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<rss version="2.0" + xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" + xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>Searx search: {{ q|e }}</title> + <link>{{ base_url }}?q={{ q|e }}</link> + <description>Search results for "{{ q|e }}" - searx</description> + <opensearch:totalResults>{{ number_of_results }}</opensearch:totalResults> + <opensearch:startIndex>1</opensearch:startIndex> + <opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage> + <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ base_url }}opensearch.xml"/> + <opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" /> + {% if error_message %} + <item> + <title>Error</title> + <description>{{ error_message|e }}</description> + </item> + {% endif %} + {% for r in results %} + <item> + <title>{{ r.title }}</title> + <link>{{ r.url }}</link> + <description>{{ r.content }}</description> + {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %} + </item> + {% endfor %} + </channel> +</rss> diff --git a/searx/templates/courgette/404.html b/searx/templates/courgette/404.html new file mode 100644 index 0000000..9e3b8ac --- /dev/null +++ b/searx/templates/courgette/404.html @@ -0,0 +1,9 @@ +{% extends "courgette/base.html" %} +{% block content %} +<div class="center"> + <h1>{{ _('Page not found') }}</h1> + {% autoescape false %} + <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + {% endautoescape %} +</div> +{% endblock %} diff --git a/searx/templates/courgette/about.html b/searx/templates/courgette/about.html new file mode 100644 index 0000000..08948ee --- /dev/null +++ b/searx/templates/courgette/about.html @@ -0,0 +1,5 @@ +{% extends 'courgette/base.html' %} +{% block content %} +{% include 'courgette/github_ribbon.html' %} +{% include '__common__/about.html' %} +{% endblock %} diff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.html new file mode 100644 index 0000000..8e27258 --- /dev/null +++ b/searx/templates/courgette/base.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}> + <head> + <meta charset="UTF-8" /> + <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" /> + <meta name="keywords" content="searx, search, search engine, metasearch, meta search" /> + <meta name="generator" content="searx/{{ searx_version }}"> + <meta name="referrer" content="no-referrer"> + <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" /> + <title>{% block title %}{% endblock %}searx</title> + <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" /> + {% if rtl %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/style-rtl.css') }}" type="text/css" media="screen" /> + {% endif %} + {% if cookies['courgette-color'] %} + <style type="text/css"> + {% include 'courgette/color.css' %} + </style> + {% endif %} + <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" /> + {% block styles %} + {% endblock %} + {% block meta %}{% endblock %} + {% block head %} + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + {% endblock %} + <script type="text/javascript"> + searx = {}; + searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %}; + </script> + </head> + <body> + <div id="container"> + {% block content %} + {% endblock %} + {% if autocomplete %} + <script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script> + <script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script> + {% endif %} + <script src="{{ url_for('static', filename='js/searx.js') }}" ></script> + </div> + </body> +</html> diff --git a/searx/templates/courgette/categories.html b/searx/templates/courgette/categories.html new file mode 100644 index 0000000..b8d6a75 --- /dev/null +++ b/searx/templates/courgette/categories.html @@ -0,0 +1,9 @@ +<div id="categories"> + <div id="categories_container"> + {% for category in categories %} + <div class="checkbox_container"> + <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> + </div> + {% endfor %} + </div> +</div>
\ No newline at end of file diff --git a/searx/templates/courgette/color.css b/searx/templates/courgette/color.css new file mode 100644 index 0000000..3e0d730 --- /dev/null +++ b/searx/templates/courgette/color.css @@ -0,0 +1,34 @@ + .autocompleter-choices li:hover, +.checkbox_container label:hover, +.checkbox_container input[type="checkbox"]:checked + label, +#sidebar, +#suggestions input[type="submit"]:hover, +#suggestions input[type="submit"]:focus, +input[type="submit"], +.engine_checkbox label, +.engine_checkbox .deny, +#search_submit{ + background-color: {{ cookies['courgette-color'].split()[0] }}; +} + +.result_title a, +.row a, +.title h1{ + color: {{ cookies['courgette-color'].split()[0] }}; +} + +#answers { + border-color: {{ cookies['courgette-color'].split()[0] }}; +} + +#search_submit:hover, +#search_submit:focus, +#sidebar input[type="submit"]:hover, +#sidebar input[type="submit"]:focus { + background-color: {{ cookies['courgette-color'].split()[1] }}; +} + +input[type="submit"]:hover, +input[type="submit"]:focus { + background: {{ cookies['courgette-color'].split()[1] }}; +}
\ No newline at end of file diff --git a/searx/templates/courgette/github_ribbon.html b/searx/templates/courgette/github_ribbon.html new file mode 100644 index 0000000..67c6e67 --- /dev/null +++ b/searx/templates/courgette/github_ribbon.html @@ -0,0 +1,3 @@ +<a href="https://github.com/asciimoo/searx" class="github"> + <img style="position: absolute; top: 0; right: 0; border: 0;" src="{{ url_for('static', filename='img/github_ribbon.png') }}" alt="Fork me on GitHub" class="github"/> +</a>
\ No newline at end of file diff --git a/searx/templates/courgette/index.html b/searx/templates/courgette/index.html new file mode 100644 index 0000000..0d34e1c --- /dev/null +++ b/searx/templates/courgette/index.html @@ -0,0 +1,17 @@ +{% extends "courgette/base.html" %} +{% block content %} +{% include 'courgette/github_ribbon.html' %} +<div class="center"> + <div class="title"><h1>searx</h1></div> + {% include 'courgette/search.html' %} + <p class="top_margin"> + {% if rtl %} + <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> + {% endif %} + <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a> + {% if not rtl %} + <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> + {% endif %} + </p> +</div> +{% endblock %}
\ No newline at end of file diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html new file mode 100644 index 0000000..61f5214 --- /dev/null +++ b/searx/templates/courgette/preferences.html @@ -0,0 +1,131 @@ +{% extends "courgette/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<div class="row"> + <h2>{{ _('Preferences') }}</h2> + + <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + <fieldset> + <legend>{{ _('Default categories') }}</legend> + {% include 'courgette/categories.html' %} + </fieldset> + <fieldset> + <legend>{{ _('Search language') }}</legend> + <p> + <select name='language'> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Interface language') }}</legend> + <p> + <select name='locale'> + {% for locale_id,locale_name in locales.items() | sort %} + <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Autocomplete') }}</legend> + <p> + <select name="autocomplete"> + <option value=""> - </option> + {% for backend in autocomplete_backends %} + <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Image proxy') }}</legend> + <p> + <select name='image_proxy'> + <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option> + <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Method') }}</legend> + <p> + <select name='method'> + <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option> + <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('SafeSearch') }}</legend> + <p> + <select name='safesearch'> + <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option> + <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option> + <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Themes') }}</legend> + <p> + <select name="theme"> + {% for name in themes %} + <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Color') }}</legend> + <p> + <select name="courgette-color"> + <option value="#3498DB #0665A2" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#3498DB #0665A2' %}selected="selected"{% endif %}>{{ _('Blue (default)') }}</option> + <option value="#6F5499 #563D7C" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#6F5499 #563D7C' %}selected="selected"{% endif %}>{{ _('Violet') }}</option> + <option value="#5CB85C #449D44" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#5CB85C #449D44' %}selected="selected"{% endif %}>{{ _('Green') }}</option> + <option value="#5BC0DE #31B0D5" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#5BC0DE #31B0D5' %}selected="selected"{% endif %}>{{ _('Cyan') }}</option> + <option value="#F0AD4E #EC971F" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#F0AD4E #EC971F' %}selected="selected"{% endif %}>{{ _('Orange') }}</option> + <option value="#D9534F #C9302C" {% if cookies['courgette-color'] and cookies['courgette-color'] == '#D9534F #C9302C' %}selected="selected"{% endif %}>{{ _('Red') }}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Currently used search engines') }}</legend> + + <table class="engine-table"> + <tr> + <th>{{ _('Engine name') }}</th> + <th>{{ _('Category') }}</th> + <th>{{ _('Allow') }} / {{ _('Block') }}</th> + </tr> + {% for categ in all_categories %} + {% for search_engine in engines_by_category[categ] %} + + {% if not search_engine.private %} + <tr> + <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})‎</td> + <td>{{ _(categ) }}</td> + <td class="engine_checkbox"> + <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in disabled_engines %} checked="checked"{% endif %} /> + <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label> + <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label> + </td> + </tr> + {% endif %} + {% endfor %} + {% endfor %} + </table> + </fieldset> + <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + <br /> + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} + </p> + + <input type="submit" value="{{ _('save') }}" /> + <div class="right preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div> + <div class="right preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div> + </form> +</div> +{% endblock %} diff --git a/searx/templates/courgette/result_templates/code.html b/searx/templates/courgette/result_templates/code.html new file mode 100644 index 0000000..d6dbd5e --- /dev/null +++ b/searx/templates/courgette/result_templates/code.html @@ -0,0 +1,11 @@ +<div class="result {{ result.class }}"> + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %} + <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> + {% if result.repository %}<p class="content"><a href="{{ result.repository|safe }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %} + <div dir="ltr"> + {{ result.codelines|code_highlighter(result.code_language)|safe }} + </div> + + <p class="url">{{ result.pretty_url }}‎</p> +</div> diff --git a/searx/templates/courgette/result_templates/default.html b/searx/templates/courgette/result_templates/default.html new file mode 100644 index 0000000..5f2ead6 --- /dev/null +++ b/searx/templates/courgette/result_templates/default.html @@ -0,0 +1,13 @@ +<div class="result {{ result.class }}"> + + {% 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 %} + + <div> + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %} + <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p> + <p class="url">{{ result.pretty_url }}‎</p> + </div> +</div> diff --git a/searx/templates/courgette/result_templates/images.html b/searx/templates/courgette/result_templates/images.html new file mode 100644 index 0000000..49acb3b --- /dev/null +++ b/searx/templates/courgette/result_templates/images.html @@ -0,0 +1,6 @@ +<div class="image_result"> + <p> + <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a> + <span class="url"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="small_font">{{ _('original context') }}</a></span> + </p> +</div> diff --git a/searx/templates/courgette/result_templates/map.html b/searx/templates/courgette/result_templates/map.html new file mode 100644 index 0000000..5f2ead6 --- /dev/null +++ b/searx/templates/courgette/result_templates/map.html @@ -0,0 +1,13 @@ +<div class="result {{ result.class }}"> + + {% 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 %} + + <div> + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %} + <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p> + <p class="url">{{ result.pretty_url }}‎</p> + </div> +</div> diff --git a/searx/templates/courgette/result_templates/torrent.html b/searx/templates/courgette/result_templates/torrent.html new file mode 100644 index 0000000..2fd8395 --- /dev/null +++ b/searx/templates/courgette/result_templates/torrent.html @@ -0,0 +1,13 @@ +<div class="result torrent_result"> + {% 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 %} + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.content %}<span class="content">{{ result.content|safe }}</span><br />{% endif %} + <span class="stats">{{ _('Seeder') }} : {{ result.seed }}, {{ _('Leecher') }} : {{ result.leech }}</span><br /> + <span> + {% if result.magnetlink %}<a href="{{ result.magnetlink }}" class="magnetlink">{{ _('magnet link') }}</a>{% endif %} + {% if result.torrentfile %}<a href="{{ result.torrentfile }}" class="torrentfile" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('torrent file') }}</a>{% endif %} + </span> + <p class="url">{{ result.pretty_url }}‎</p> +</div> diff --git a/searx/templates/courgette/result_templates/videos.html b/searx/templates/courgette/result_templates/videos.html new file mode 100644 index 0000000..b3e19e0 --- /dev/null +++ b/searx/templates/courgette/result_templates/videos.html @@ -0,0 +1,10 @@ +<div class="result"> + {% 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 %} + + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span><br />{% endif %} + <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img width="400" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a> + <p class="url">{{ result.pretty_url }}‎</p> +</div> diff --git a/searx/templates/courgette/results.html b/searx/templates/courgette/results.html new file mode 100644 index 0000000..c72b7c3 --- /dev/null +++ b/searx/templates/courgette/results.html @@ -0,0 +1,87 @@ +{% extends "courgette/base.html" %} +{% block title %}{{ q|e }} - {% endblock %} +{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno }}">{% endblock %} +{% block content %} +<div class="right"><a href="{{ url_for('preferences') }}" id="preferences"><span>{{ _('preferences') }}</span></a></div> +<div class="small search center"> + {% include 'courgette/search.html' %} +</div> +<div id="results"> + <div id="sidebar"> + <div id="search_url"> + {{ _('Search URL') }}: + <input type="text" value="{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}" readonly /> + </div> + <div id="apis"> + {{ _('Download results') }}<br /> + {% for output_type in ('csv', 'json', 'rss') %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="left"> + <input type="hidden" name="q" value="{{ q|e }}" /> + <input type="hidden" name="format" value="{{ output_type }}" /> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno }}" /> + <input type="submit" value="{{ output_type }}" /> + </div> + </form> + {% endfor %} + </div> + </div> + + {% if answers %} + <div id="answers" class=""><span>{{ _('Answers') }}</span> + {% for answer in answers %} + <span>{{ answer }}</span> + {% endfor %} + </div> + {% endif %} + + {% if suggestions %} + <div id="suggestions"><span>{{ _('Suggestions') }}</span> + {% for suggestion in suggestions %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="submit" value="{{ suggestion }}" /> + </form> + {% endfor %} + </div> + {% endif %} + + {% for result in results %} + {% if result['template'] %} + {% include get_result_template('courgette', result['template']) %} + {% else %} + {% include 'courgette/result_templates/default.html' %} + {% endif %} + {% endfor %} + + {% if paging %} + <div id="pagination"> + {% if pageno > 1 %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="left"> + <input type="hidden" name="q" value="{{ q|e }}" /> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno-1 }}" /> + <input type="submit" value="<< {{ _('previous page') }}" /> + </div> + </form> + {% endif %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="left"> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="q" value="{{ q|e }}" /> + <input type="hidden" name="pageno" value="{{ pageno+1 }}" /> + <input type="submit" value="{{ _('next page') }} >>" /> + </div> + </form> + </div> + {% endif %} +</div> +{% endblock %} diff --git a/searx/templates/courgette/search.html b/searx/templates/courgette/search.html new file mode 100644 index 0000000..bd4efd4 --- /dev/null +++ b/searx/templates/courgette/search.html @@ -0,0 +1,7 @@ +<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> + <div id="search_wrapper"> + <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/> + <input type="submit" value="search" id="search_submit" /> + </div> + {% include 'courgette/categories.html' %} +</form>
\ No newline at end of file diff --git a/searx/templates/courgette/stats.html b/searx/templates/courgette/stats.html new file mode 100644 index 0000000..b9aafbb --- /dev/null +++ b/searx/templates/courgette/stats.html @@ -0,0 +1,22 @@ +{% extends "courgette/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<h2>{{ _('Engine stats') }}</h2> + +{% for stat_name,stat_category in stats %} +<div class="left"> + <table> + <tr> + <th colspan="3">{{ stat_name }}</th> + </tr> + {% for engine in stat_category %} + <tr> + <td>{{ engine.name }}</td> + <td>{{ '%.02f'|format(engine.avg) }}</td> + <td class="percentage"><div style="width: {{ engine.percentage }}%"> </div></td> + </tr> + {% endfor %} + </table> +</div> +{% endfor %} +{% endblock %}
\ No newline at end of file diff --git a/searx/templates/legacy/404.html b/searx/templates/legacy/404.html new file mode 100644 index 0000000..3e889dd --- /dev/null +++ b/searx/templates/legacy/404.html @@ -0,0 +1,9 @@ +{% extends "legacy/base.html" %} +{% block content %} +<div class="center"> + <h1>{{ _('Page not found') }}</h1> + {% autoescape false %} + <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + {% endautoescape %} +</div> +{% endblock %} diff --git a/searx/templates/legacy/about.html b/searx/templates/legacy/about.html new file mode 100644 index 0000000..f773e3a --- /dev/null +++ b/searx/templates/legacy/about.html @@ -0,0 +1,5 @@ +{% extends 'legacy/base.html' %} +{% block content %} +{% include 'legacy/github_ribbon.html' %} +{% include '__common__/about.html' %} +{% endblock %} diff --git a/searx/templates/legacy/base.html b/searx/templates/legacy/base.html new file mode 100644 index 0000000..da19741 --- /dev/null +++ b/searx/templates/legacy/base.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}> + <head> + <meta charset="UTF-8" /> + <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" /> + <meta name="keywords" content="searx, search, search engine, metasearch, meta search" /> + <meta name="generator" content="searx/{{ searx_version }}"> + <meta name="referrer" content="no-referrer"> + <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" /> + <title>{% block title %}{% endblock %}searx</title> + <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" /> + {% if rtl %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/style-rtl.css') }}" type="text/css" media="screen" /> + {% endif %} + <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" /> + {% block styles %} + {% endblock %} + {% block meta %}{% endblock %} + {% block head %} + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + {% endblock %} + </head> + <body> + <div id="container"> + {% block content %} + {% endblock %} + {% if autocomplete %} + <script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script> + <script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script> + {% endif %} + <script type="text/javascript"> + searx = {}; + searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %}; + </script> + <script src="{{ url_for('static', filename='js/searx.js') }}" ></script> + </div> + </body> +</html> diff --git a/searx/templates/legacy/categories.html b/searx/templates/legacy/categories.html new file mode 100644 index 0000000..1c46678 --- /dev/null +++ b/searx/templates/legacy/categories.html @@ -0,0 +1,10 @@ +<div id="categories"> + <div id="categories_container"> + {% for category in categories %} + <div class="checkbox_container"> + <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> + </div> + {% endfor %} + {% if display_tooltip %}<div class="hidden">{{ _('Click on the magnifier to perform search') }}</div>{% endif %} + </div> +</div> diff --git a/searx/templates/legacy/github_ribbon.html b/searx/templates/legacy/github_ribbon.html new file mode 100644 index 0000000..bdd9cf1 --- /dev/null +++ b/searx/templates/legacy/github_ribbon.html @@ -0,0 +1,3 @@ +<a href="https://github.com/asciimoo/searx" class="github"> + <img style="position: absolute; top: 0; right: 0; border: 0;" src="{{ url_for('static', filename='img/github_ribbon.png') }}" alt="Fork me on GitHub" class="github"/> +</a> diff --git a/searx/templates/legacy/index.html b/searx/templates/legacy/index.html new file mode 100644 index 0000000..de956d5 --- /dev/null +++ b/searx/templates/legacy/index.html @@ -0,0 +1,18 @@ +{% extends "legacy/base.html" %} +{% block content %} +<div class="center"> + <div class="title"><h1>searx</h1></div> + {% include 'legacy/search.html' %} + <p class="top_margin"> + {% if rtl %} + <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> + {% endif %} + <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a> + {% if not rtl %} + <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> + {% endif %} + </p> +</div> +{% include 'legacy/github_ribbon.html' %} +{% endblock %} + diff --git a/searx/templates/legacy/infobox.html b/searx/templates/legacy/infobox.html new file mode 100644 index 0000000..4dd25fa --- /dev/null +++ b/searx/templates/legacy/infobox.html @@ -0,0 +1,51 @@ +<div class="infobox"> +<h2><bdi>{{ infobox.infobox }}</bdi></h2> + {% if infobox.img_src %}<img src="{{ image_proxify(infobox.img_src) }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %} + <p><bdi>{{ infobox.entity }}</bdi></p> + <p><bdi>{{ infobox.content | safe }}</bdi></p> + {% if infobox.attributes %} + <div class="attributes"> + <table> + {% for attribute in infobox.attributes %} + <tr> + <td><bdi>{{ attribute.label }}</bdi></td> + {% if attribute.image %} + <td><img src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td> + {% else %} + <td><bdi>{{ attribute.value }}</bdi></td> + {% endif %} + </tr> + {% endfor %} + </table> + </div> + {% endif %} + + {% if infobox.urls %} + <div class="urls"> + <ul> + {% for url in infobox.urls %} + <li class="url"><bdi><a href="{{ url.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ url.title }}</a></bdi></li> + {% endfor %} + </ul> + </div> + {% endif %} + + {% if infobox.relatedTopics %} + <div class="relatedTopics"> + {% for topic in infobox.relatedTopics %} + <div> + <h3><bdi>{{ topic.name }}</bdi></h3> + {% for suggestion in topic.suggestions %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="submit" value="{{ suggestion }}" /> + </form> + {% endfor %} + </div> + {% endfor %} + </div> + {% endif %} + + <br /> + +</div> diff --git a/searx/templates/legacy/preferences.html b/searx/templates/legacy/preferences.html new file mode 100644 index 0000000..fb70832 --- /dev/null +++ b/searx/templates/legacy/preferences.html @@ -0,0 +1,128 @@ +{% extends "legacy/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<div class="row"> + <h2>{{ _('Preferences') }}</h2> + + <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + <fieldset> + <legend>{{ _('Default categories') }}</legend> + {% set display_tooltip = false %} + {% include 'legacy/categories.html' %} + </fieldset> + <fieldset> + <legend>{{ _('Search language') }}</legend> + <p> + <select name='language'> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Interface language') }}</legend> + <p> + <select name='locale'> + {% for locale_id,locale_name in locales.items() | sort %} + <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Autocomplete') }}</legend> + <p> + <select name="autocomplete"> + <option value=""> - </option> + {% for backend in autocomplete_backends %} + <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Image proxy') }}</legend> + <p> + <select name='image_proxy'> + <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option> + <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Method') }}</legend> + <p> + <select name='method'> + <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option> + <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('SafeSearch') }}</legend> + <p> + <select name='safesearch'> + <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option> + <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option> + <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Themes') }}</legend> + <p> + <select name="theme"> + {% for name in themes %} + <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Results on new tabs') }}</legend> + <p> + <select name='results_on_new_tab'> + <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Currently used search engines') }}</legend> + + <table> + <tr> + <th>{{ _('Engine name') }}</th> + <th>{{ _('Category') }}</th> + <th>{{ _('Allow') }} / {{ _('Block') }}</th> + </tr> + {% for categ in all_categories %} + {% for search_engine in engines_by_category[categ] %} + + {% if not search_engine.private %} + <tr> + <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})‎</td> + <td>{{ _(categ) }}</td> + <td class="engine_checkbox"> + <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in disabled_engines %} checked="checked"{% endif %} /> + <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label> + <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label> + </td> + </tr> + {% endif %} + {% endfor %} + {% endfor %} + </table> + </fieldset> + <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + <br /> + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} + </p> + + <input type="submit" value="{{ _('save') }}" /> + <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div> + <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div> + </form> +</div> +{% endblock %} diff --git a/searx/templates/legacy/result_templates/code.html b/searx/templates/legacy/result_templates/code.html new file mode 100644 index 0000000..fee6c82 --- /dev/null +++ b/searx/templates/legacy/result_templates/code.html @@ -0,0 +1,11 @@ +<div class="result {{ result.class }}"> + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + <p class="url">{{ result.pretty_url }}‎ <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a></p> + {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %} + <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> + {% if result.repository %}<p class="result-content"><a href="{{ result.repository|safe }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %} + + <div dir="ltr"> + {{ result.codelines|code_highlighter(result.code_language)|safe }} + </div> +</div> diff --git a/searx/templates/legacy/result_templates/default.html b/searx/templates/legacy/result_templates/default.html new file mode 100644 index 0000000..da09117 --- /dev/null +++ b/searx/templates/legacy/result_templates/default.html @@ -0,0 +1,6 @@ +<div class="result {{ result.class }}"> + <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 }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + <p class="url">{{ result.pretty_url }}‎ <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p> + <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> +</div> diff --git a/searx/templates/legacy/result_templates/images.html b/searx/templates/legacy/result_templates/images.html new file mode 100644 index 0000000..00f62ab --- /dev/null +++ b/searx/templates/legacy/result_templates/images.html @@ -0,0 +1,6 @@ +<div class="image_result"> + <p> + <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a> + <span class="url"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="small_font">{{ _('original context') }}</a></span> + </p> +</div> diff --git a/searx/templates/legacy/result_templates/map.html b/searx/templates/legacy/result_templates/map.html new file mode 100644 index 0000000..0200e0f --- /dev/null +++ b/searx/templates/legacy/result_templates/map.html @@ -0,0 +1,13 @@ +<div class="result {{ result.class }}"> + + {% 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 %} + + <div> + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + <p class="url">{{ result.pretty_url }}‎ <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p> + <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> + </div> +</div> diff --git a/searx/templates/legacy/result_templates/torrent.html b/searx/templates/legacy/result_templates/torrent.html new file mode 100644 index 0000000..67e058a --- /dev/null +++ b/searx/templates/legacy/result_templates/torrent.html @@ -0,0 +1,13 @@ +<div class="result torrent_result"> + {% 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 %} + <h3 class="result_title"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + <p class="url">{{ result.pretty_url }}‎</p> + {% if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif %} + <p> + {% if result.magnetlink %}<a href="{{ result.magnetlink }}" class="magnetlink">{{ _('magnet link') }}</a>{% endif %} + {% if result.torrentfile %}<a href="{{ result.torrentfile }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="torrentfile">{{ _('torrent file') }}</a>{% endif %} - + <span class="stats">{{ _('Seeder') }} : {{ result.seed }}, {{ _('Leecher') }} : {{ result.leech }}</span> + </p> +</div> diff --git a/searx/templates/legacy/result_templates/videos.html b/searx/templates/legacy/result_templates/videos.html new file mode 100644 index 0000000..727f44c --- /dev/null +++ b/searx/templates/legacy/result_templates/videos.html @@ -0,0 +1,6 @@ +<div class="result"> + <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 }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span><br />{% endif %} + <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a> + <p class="url">{{ result.url }}‎</p> +</div> diff --git a/searx/templates/legacy/results.html b/searx/templates/legacy/results.html new file mode 100644 index 0000000..f0d7839 --- /dev/null +++ b/searx/templates/legacy/results.html @@ -0,0 +1,100 @@ +{% extends "legacy/base.html" %} +{% block title %}{{ q|e }} - {% endblock %} +{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno }}">{% endblock %} +{% block content %} +<div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div> +<div class="small search center"> + {% include 'legacy/search.html' %} +</div> +<div id="results"> + <div id="sidebar"> + + <div id="search_url"> + {{ _('Search URL') }}: + <input type="text" value="{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}" readonly /> + </div> + <div id="apis"> + {{ _('Download results') }} + {% for output_type in ('csv', 'json', 'rss') %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="left"> + <input type="hidden" name="q" value="{{ q|e }}" /> + <input type="hidden" name="format" value="{{ output_type }}" /> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno }}" /> + <input type="submit" value="{{ output_type }}" /> + </div> + </form> + {% endfor %} + </div> + </div> + + {% if answers %} + <div id="answers"><span>{{ _('Answers') }}</span> + {% for answer in answers %} + <span>{{ answer }}</span> + {% endfor %} + </div> + {% endif %} + + {% if suggestions %} + <div id="suggestions"><span id="suggestions-title">{{ _('Suggestions') }} : </span> + {% set first = true %} + {% for suggestion in suggestions %} + {% if not first %} • {% endif %}<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="submit" class="suggestion" value="{{ suggestion }}" /> + </form> + {% set first = false %} + {% endfor %} + </div> + {% endif %} + + {% if infoboxes %} + <div id="infoboxes"> + {% for infobox in infoboxes %} + {% include 'legacy/infobox.html' %} + {% endfor %} + </div> + {% endif %} + + {% for result in results %} + {% if result['template'] %} + {% include get_result_template('legacy', result['template']) %} + {% else %} + {% include 'legacy/result_templates/default.html' %} + {% endif %} + {% endfor %} + + {% if paging %} + <div id="pagination"> + {% if pageno > 1 %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="{% if rtl %}right{% else %}left{% endif %}"> + <input type="hidden" name="q" value="{{ q|e }}" /> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno-1 }}" /> + <input type="submit" value="<< {{ _('previous page') }}" /> + </div> + </form> + {% endif %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="{% if rtl %}left{% else %}right{% endif %}"> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + <input type="hidden" name="q" value="{{ q|e }}" /> + <input type="hidden" name="pageno" value="{{ pageno+1 }}" /> + <input type="submit" value="{{ _('next page') }} >>" /> + </div> + </form> + + <br /> + </div> + {% endif %} +</div> +{% endblock %} diff --git a/searx/templates/legacy/search.html b/searx/templates/legacy/search.html new file mode 100644 index 0000000..4d37f9b --- /dev/null +++ b/searx/templates/legacy/search.html @@ -0,0 +1,8 @@ +<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> + <div id="search_wrapper"> + <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" size="100" {% if q %}value="{{ q }}"{% endif %}/> + <input type="submit" value="search" id="search_submit" /> + </div> + {% set display_tooltip = true %} + {% include 'legacy/categories.html' %} +</form> diff --git a/searx/templates/legacy/stats.html b/searx/templates/legacy/stats.html new file mode 100644 index 0000000..372447e --- /dev/null +++ b/searx/templates/legacy/stats.html @@ -0,0 +1,22 @@ +{% extends "legacy/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<h2>{{ _('Engine stats') }}</h2> + +{% for stat_name,stat_category in stats %} +<div class="left"> + <table> + <tr colspan="3"> + <th>{{ stat_name }}</th> + </tr> + {% for engine in stat_category %} + <tr> + <td>{{ engine.name }}</td> + <td>{{ '%.02f'|format(engine.avg) }}</td> + <td class="percentage"><div style="width: {{ engine.percentage }}%"> </div></td> + </tr> + {% endfor %} + </table> +</div> +{% endfor %} +{% endblock %} diff --git a/searx/templates/oscar/404.html b/searx/templates/oscar/404.html new file mode 100644 index 0000000..5a50880 --- /dev/null +++ b/searx/templates/oscar/404.html @@ -0,0 +1,9 @@ +{% extends "oscar/base.html" %} +{% block content %} +<div class="text-center"> + <h1>{{ _('Page not found') }}</h1> + {% autoescape false %} + <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + {% endautoescape %} +</div> +{% endblock %} diff --git a/searx/templates/oscar/about.html b/searx/templates/oscar/about.html new file mode 100644 index 0000000..bc7fed8 --- /dev/null +++ b/searx/templates/oscar/about.html @@ -0,0 +1,5 @@ +{% extends "oscar/base.html" %} +{% block title %}{{ _('about') }} - {% endblock %} +{% block content %} +{% include '__common__/about.html' %} +{% endblock %} diff --git a/searx/templates/oscar/advanced.html b/searx/templates/oscar/advanced.html new file mode 100644 index 0000000..95d99ba --- /dev/null +++ b/searx/templates/oscar/advanced.html @@ -0,0 +1,16 @@ +<input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}> +<label for="check-advanced"> + <span class="glyphicon glyphicon-cog"></span> + {{ _('Advanced settings') }} +</label> +<div id="advanced-search-container"> + {% include 'oscar/categories.html' %} + <div class="row"> + <div class="col-xs-6"> + {% include 'oscar/time-range.html' %} + </div> + <div class="col-xs-6"> + {% include 'oscar/languages.html' %} + </div> + </div> +</div> diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html new file mode 100644 index 0000000..243e8b3 --- /dev/null +++ b/searx/templates/oscar/base.html @@ -0,0 +1,114 @@ +{% from 'oscar/macros.html' import icon %} +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}> +<head> + <meta charset="UTF-8" /> + <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" /> + <meta name="keywords" content="searx, search, search engine, metasearch, meta search" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="generator" content="searx/{{ searx_version }}"> + <meta name="referrer" content="no-referrer"> + <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" /> + {% block meta %}{% endblock %} + <title>{% block title %}{% endblock %}{{ instance_name }}</title> + + <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" /> + {% if preferences.get_value('oscar-style') %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/'+preferences.get_value('oscar-style')+'.min.css') }}" type="text/css" /> + {% else %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/logicodev.min.css') }}" type="text/css" /> + {% endif %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.min.css') }}" type="text/css" /> + {% for css in styles %} + <link rel="stylesheet" href="{{ url_for('static', filename=css) }}" type="text/css" /> + {% endfor %} + + <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> + <!--[if lt IE 9]> + <script src="{{ url_for('static', filename='js/html5shiv.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/respond.min.js') }}"></script> + <![endif]--> + + <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" /> + + {% block styles %} + {% endblock %} + {% block head %} + {% endblock %} + + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + + <script type="text/javascript"> + searx = {}; + searx.method = "{{ method or 'POST' }}"; + searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %}; + </script> + <noscript> + <style type="text/css"> + .tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;} + .margin_top_if_nojs {margin-top: 20px;} + .hide_if_nojs {display: none !important;overflow:none !important;} + .disabled_if_nojs {pointer-events: none; cursor: default; text-decoration: line-through;} + </style> + </noscript> +</head> +<body> + {% include 'oscar/navbar.html' %} + <div class="container"> + {% if errors %} + <div class="alert alert-danger fade in" role="alert"> + <button class="close" data-dismiss="alert" type="button"> + <span aria-hidden="true">×</span> + <span class="sr-only">{{ _('Close') }}</span> + </button> + <strong class="lead">{{ icon('info-sign') }} {{ _('Error!') }}</strong> + <ul> + {% for message in errors %} + <li>{{ message }}</li> + {% endfor %} + </ul> + </div> + {% endif %} + + {% block site_alert_error %} + {% endblock %} + {% block site_alert_warning %} + {% endblock %} + {% block site_alert_info %} + {% endblock %} + {% block site_alert_success %} + {% endblock %} + + {% block content %} + {% endblock %} + + </div> + <div class="footer"> + <div class="container"> + {% block footer %} + {% endblock %} + <p class="text-muted"> + <small> + {{ _('Powered by') }} <a href="https://asciimoo.github.io/searx/">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> + <a href="https://github.com/asciimoo/searx">{{ _('Source code') }}</a> | + <a href="https://github.com/asciimoo/searx/issues">{{ _('Issue tracker') }}</a> | + <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">{{ _('Public instances') }}</a> + </small> + </p> + </div> + </div> + <script src="{{ url_for('static', filename='js/jquery-1.11.1.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> + {% if autocomplete %}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{% endif %} + <script src="{{ url_for('static', filename='js/require-2.1.15.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/searx.min.js') }}"></script> + {% for script in scripts %} + <script src="{{ url_for('static', filename=script) }}"></script> + {% endfor %} + <noscript> + <style> + .glyphicon { display: none; } + </style> + </noscript> +</body> +</html> diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html new file mode 100644 index 0000000..1ace10f --- /dev/null +++ b/searx/templates/oscar/categories.html @@ -0,0 +1,13 @@ +<div id="categories"> +{% if rtl %} + {% for category in categories | reverse %} + <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> + <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> + {% endfor %} +{% else %} + {% for category in categories %} + <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> + <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> + {% endfor %} +{% endif %} +</div> diff --git a/searx/templates/oscar/index.html b/searx/templates/oscar/index.html new file mode 100644 index 0000000..b941f5f --- /dev/null +++ b/searx/templates/oscar/index.html @@ -0,0 +1,22 @@ +{% extends "oscar/base.html" %} +{% block content %} +<div class="container-fluid"> + <div class="row"> + <div class="text-center col-sm-12 col-md-12"> + {% if cookies['oscar-style'] == 'pointhi' %} + <h1 class="text-hide center-block"><img class="center-block img-responsive" src="{{ url_for('static', filename='img/searx_logo.png') }}" alt="searx logo"/>searx</h1> + {% else %} + <h1 class="text-hide center-block" id="main-logo"> + <img class="center-block img-responsive" src="{{ url_for('static', filename='img/logo_searx_a.png') }}" alt="searx logo" /> + searx + </h1> + {% endif %} + </div> + </div> + <div class="row"> + <div class="text-center col-sm-12 col-md-12"> + {% include 'oscar/search_full.html' %} + </div> + </div> +</div> +{% endblock %} diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html new file mode 100644 index 0000000..c98fb0e --- /dev/null +++ b/searx/templates/oscar/infobox.html @@ -0,0 +1,35 @@ +{% from 'oscar/macros.html' import result_link with context %} +<div class="panel panel-default infobox"> + <div class="panel-heading"> + <h4 class="panel-title infobox_part"><bdi>{{ infobox.infobox }}</bdi></h4> + </div> + <div class="panel-body"> + {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" alt="{{ infobox.infobox }}" />{% endif %} + {% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content }}</bdi></p>{% endif %} + + {% if infobox.attributes %} + <table class="table table-striped infobox_part"> + {% for attribute in infobox.attributes %} + <tr> + <td><bdi>{{ attribute.label }}</bdi></td> + {% if attribute.image %} + <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td> + {% else %} + <td><bdi>{{ attribute.value }}</bdi></td> + {% endif %} + </tr> + {% endfor %} + </table> + {% endif %} + + {% if infobox.urls %} + <div class="infobox_part"> + <bdi> + {% for url in infobox.urls %} + <p class="btn btn-default btn-xs">{{ result_link(url.url, url.title) }}</a></p> + {% endfor %} + </bdi> + </div> + {% endif %} + </div> +</div> diff --git a/searx/templates/oscar/languages.html b/searx/templates/oscar/languages.html new file mode 100644 index 0000000..369abca --- /dev/null +++ b/searx/templates/oscar/languages.html @@ -0,0 +1,11 @@ +{% if preferences %} +<select class="custom-select form-control" name='language'> +{% else %} +<select class="time_range custom-select form-control" id='language' name='language'> +{% endif %} + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}> + {{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }} + </option> + {% endfor %} +</select> diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html new file mode 100644 index 0000000..0ff9575 --- /dev/null +++ b/searx/templates/oscar/macros.html @@ -0,0 +1,99 @@ +<!-- Draw glyphicon icon from bootstrap-theme --> +{% macro icon(action) -%} + <span class="glyphicon glyphicon-{{ action }}"></span> +{%- endmacro %} + +<!-- Draw favicon --> +{% macro draw_favicon(favicon) -%} + <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" /> +{%- endmacro %} + +{%- macro result_link(url, title, classes='') -%} +<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a> +{%- endmacro -%} + +<!-- Draw result header --> +{% macro result_header(result, favicons) -%} +<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4> +{%- endmacro %} + +<!-- Draw result sub header --> +{% macro result_sub_header(result) -%} + {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %} + {% if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %} + {% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %} +{%- endmacro %} + +<!-- Draw result footer --> +{% macro result_footer(result) -%} + <div class="clearfix"></div> + <div class="pull-right"> + {% for engine in result.engines %} + <span class="label label-default">{{ engine }}</span> + {% endfor %} + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small> + {% if proxify %} + <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small> + {% endif %} +</div> +<div class="external-link">{{ result.pretty_url }}</div> +{%- endmacro %} + +<!-- Draw result footer --> +{% macro result_footer_rtl(result) -%} + <div class="clearfix"></div> + {% for engine in result.engines %} + <span class="label label-default">{{ engine }}</span> + {% endfor %} + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small> + {% if proxify %} + <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small> + {% endif %} + <div class="external-link">{{ result.pretty_url }}</div> +{%- endmacro %} + +{% macro preferences_item_header(info, label, rtl) -%} + {% if rtl %} + <div class="row form-group"> + <label class="col-sm-3 col-md-2 pull-right">{{ label }}</label> + <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span> + <div class="col-sm-4 col-md-4"> + {% else %} + <div class="row form-group"> + <label class="col-sm-3 col-md-2">{{ label }}</label> + <div class="col-sm-4 col-md-4"> + {% endif %} +{%- endmacro %} + +{% macro preferences_item_footer(info, label, rtl) -%} + {% if rtl %} + </div> + </div> + {% else %} + </div> + <span class="col-sm-5 col-md-6 help-block">{{ info }}</span> + </div> + {% endif %} +{%- endmacro %} + +{% macro checkbox_toggle(id, blocked) -%} + <div class="onoffswitch"> + <input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox"> + <label class="onoffswitch-label" for="{{ id }}"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> +{%- endmacro %} + +{% macro support_toggle(supports) -%} + {% if supports %} + <span class="label label-success"> + {{ _("supported") }} + </span> + {% else %} + <span class="label label-danger"> + {{ _("not supported") }} + </span> + {% endif %} +{%- endmacro %} diff --git a/searx/templates/oscar/messages/first_time.html b/searx/templates/oscar/messages/first_time.html new file mode 100644 index 0000000..38db62b --- /dev/null +++ b/searx/templates/oscar/messages/first_time.html @@ -0,0 +1,8 @@ +<div class="alert alert-info fade in" role="alert"> + <button class="close" data-dismiss="alert" type="button"> + <span aria-hidden="true">×</span> + <span class="sr-only">{{ _('Close') }}</span> + </button> + <strong class="lead">{{ icon('info-sign') }} {{ _('Heads up!') }}</strong> + {{ _('It look like you are using searx first time.') }} +</div> diff --git a/searx/templates/oscar/messages/no_cookies.html b/searx/templates/oscar/messages/no_cookies.html new file mode 100644 index 0000000..9bebc8a --- /dev/null +++ b/searx/templates/oscar/messages/no_cookies.html @@ -0,0 +1,5 @@ +{% from 'oscar/macros.html' import icon %} +<div class="alert alert-info fade in" role="alert"> + <strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong> + {{ _('currently, there are no cookies defined.') }} +</div> diff --git a/searx/templates/oscar/messages/no_data_available.html b/searx/templates/oscar/messages/no_data_available.html new file mode 100644 index 0000000..aee7917 --- /dev/null +++ b/searx/templates/oscar/messages/no_data_available.html @@ -0,0 +1,5 @@ +{% from 'oscar/macros.html' import icon %} +<div class="alert alert-info fade in" role="alert"> + <strong class="lead">{{ icon('info-sign') }} {{ _('Heads up!') }}</strong> + {{ _('There is currently no data available. ') }} +</div> diff --git a/searx/templates/oscar/messages/no_results.html b/searx/templates/oscar/messages/no_results.html new file mode 100644 index 0000000..16b5984 --- /dev/null +++ b/searx/templates/oscar/messages/no_results.html @@ -0,0 +1,17 @@ +{% from 'oscar/macros.html' import icon %} +{% if unresponsive_engines %} +<div class="alert alert-danger fade in" role="alert"> + <p><strong class="lead">{{ icon('remove-sign') }} {{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p> + <p> + {% for engine_name, error_type in unresponsive_engines %} + {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %} + {% endfor %} + </p> + <p><small>{{ _('Please, try again later or find another searx instance.') }}</small></p> +</div> +{% else %} +<div class="alert alert-info fade in" role="alert"> + <strong class="lead">{{ icon('info-sign') }} {{ _('Sorry!') }}</strong> + {{ _('we didn\'t find any results. Please use another query or search in more categories.') }} +</div> +{% endif %} diff --git a/searx/templates/oscar/messages/save_settings_successfull.html b/searx/templates/oscar/messages/save_settings_successfull.html new file mode 100644 index 0000000..63e578c --- /dev/null +++ b/searx/templates/oscar/messages/save_settings_successfull.html @@ -0,0 +1,9 @@ +{% from 'oscar/macros.html' import icon %} +<div class="alert alert-success fade in" role="alert"> + <button class="close" data-dismiss="alert" type="button"> + <span aria-hidden="true">×</span> + <span class="sr-only">{{ _('Close') }}</span> + </button> + <strong class="lead">{{ icon('ok-sign') }} {{ _('Well done!') }}</strong> + {{ _('Settings saved successfully.') }} +</div> diff --git a/searx/templates/oscar/messages/unknow_error.html b/searx/templates/oscar/messages/unknow_error.html new file mode 100644 index 0000000..3c4c9c1 --- /dev/null +++ b/searx/templates/oscar/messages/unknow_error.html @@ -0,0 +1,9 @@ +{% from 'oscar/macros.html' import icon %} +<div class="alert alert-danger fade in" role="alert"> + <button class="close" data-dismiss="alert" type="button"> + <span aria-hidden="true">×</span> + <span class="sr-only">{{ _('Close') }}</span> + </button> + <strong class="lead">{{ icon('exclamation-sign') }} {{ _('Oh snap!') }}</strong> + {{ _('Something went wrong.') }} +</div> diff --git a/searx/templates/oscar/navbar.html b/searx/templates/oscar/navbar.html new file mode 100644 index 0000000..12bf14f --- /dev/null +++ b/searx/templates/oscar/navbar.html @@ -0,0 +1,9 @@ +<div class="searx-navbar"> + <span class="instance {% if rtl %}pull-right{% else %}pull-left{% endif%}"> + <a href="{{ url_for('index') }}">{{ instance_name }}</a> + </span> + <span class="{% if rtl %}pull-left{% else %}pull-right{% endif %}"> + <a href="{{ url_for('about') }}">{{ _('about') }}</a> + <a href="{{ url_for('preferences') }}">{{ _('preferences') }}</a> + </span> +</div> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html new file mode 100644 index 0000000..b64d72d --- /dev/null +++ b/searx/templates/oscar/preferences.html @@ -0,0 +1,311 @@ +{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle %} +{% extends "oscar/base.html" %} +{% block title %}{{ _('preferences') }} - {% endblock %} +{% block content %} + +<div> + + <h1>{{ _('Preferences') }}</h1> + <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + + <!-- Nav tabs --> + <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;"> + <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li> + <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li> + <li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li> + {% if answerers %}<li><a href="#tab_answerers" role="tab" data-toggle="tab">{{ _('Answerers') }}</a></li>{% endif %} + <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li> + </ul> + + <!-- Tab panes --> + <noscript> + <h3>{{ _('General') }}</h3> + </noscript> + <div class="tab-content"> + <div class="tab-pane active" id="tab_general"> + <fieldset> + <div class="container-fluid"> + <div class="row form-group"> + {% if rtl %} + <div class="col-sm-11 col-md-10"> + {% include 'oscar/categories.html' %} + </div> + <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label> + {% else %} + <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label> + <div class="col-sm-11 col-md-10 search-categories"> + {% include 'oscar/categories.html' %} + </div> + {% endif %} + </div> + {% set language_label = _('Search language') %} + {% set language_info = _('What language do you prefer for search?') %} + {{ preferences_item_header(language_info, language_label, rtl) }} + {% include 'oscar/languages.html' %} + {{ preferences_item_footer(language_info, language_label, rtl) }} + + {% set locale_label = _('Interface language') %} + {% set locale_info = _('Change the language of the layout') %} + {{ preferences_item_header(locale_info, locale_label, rtl) }} + <select class="form-control" name='locale'> + {% for locale_id,locale_name in locales.items() | sort %} + <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option> + {% endfor %} + </select> + {{ preferences_item_footer(locale_info, locale_label, rtl) }} + + {% set autocomplete_label = _('Autocomplete') %} + {% set autocomplete_info = _('Find stuff as you type') %} + {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }} + <select class="form-control" name="autocomplete"> + <option value=""> - </option> + {% for backend in autocomplete_backends %} + <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option> + {% endfor %} + </select> + {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }} + + {% set image_proxy_label = _('Image proxy') %} + {% set image_proxy_info = _('Proxying image results through searx') %} + {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }} + <select class="form-control" name='image_proxy'> + <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option> + <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option> + </select> + {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }} + + {% set method_label = _('Method') %} + {% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %} + {{ preferences_item_header(method_info, method_label, rtl) }} + <select class="form-control" name='method'> + <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option> + <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option> + </select> + {{ preferences_item_footer(method_info, method_label, rtl) }} + + {% set safesearch_label = _('SafeSearch') %} + {% set safesearch_info = _('Filter content') %} + {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }} + <select class="form-control" name='safesearch'> + <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option> + <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option> + <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option> + </select> + {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }} + + {% set theme_label = _('Themes') %} + {% set theme_info = _('Change searx layout') %} + {{ preferences_item_header(theme_info, theme_label, rtl) }} + <select class="form-control" name="theme"> + {% for name in themes %} + <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option> + {% endfor %} + </select> + {{ preferences_item_footer(theme_info, theme_label, rtl) }} + + {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl) }} + <select class="form-control" name='oscar-style'> + <option value="logicodev" >Logicodev</option> + <option value="pointhi" {% if preferences.get_value('oscar-style') == 'pointhi' %}selected="selected"{% endif %}>Pointhi</option> + <option value="logicodev-dark" {% if preferences.get_value('oscar-style') == 'logicodev-dark' %}selected="selected"{% endif %}>Logicodev dark</option> + </select> + {{ preferences_item_footer(_('Choose style for this theme'), _('Style'), rtl) }} + + {% set label = _('Results on new tabs') %} + {% set info = _('Open result links on new browser tabs') %} + {{ preferences_item_header(info, label, rtl) }} + <select class="form-control" name='results_on_new_tab'> + <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + {{ preferences_item_footer(info, label, rtl) }} + + {% set label = _('Open Access DOI resolver') %} + {% set info = _('Redirect to open-access versions of publications when available (plugin required)') %} + {{ preferences_item_header(info, label, rtl) }} + <select class="form-control" id='doi_resolver' name='doi_resolver'> + {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %} + <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}> + {{ doi_resolver_name }} - {{ doi_resolver_url }} + </option> + {% endfor %} + </select> + {{ preferences_item_footer(info, label, rtl) }} + </div> + </fieldset> + </div> + <div class="tab-pane active_if_nojs" id="tab_engine"> + + <!-- Nav tabs --> + <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;"> + {% for categ in all_categories %} + <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li> + {% endfor %} + </ul> + + <noscript> + <h3>{{ _('Engines') }}</h3> + </noscript> + + <!-- Tab panes --> + <div class="tab-content"> + {% for categ in all_categories %} + <noscript><label>{{ _(categ) }}</label> + </noscript> + <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}"> + <div class="container-fluid"> + <fieldset> + <div class="table-responsive"> + <table class="table table-hover table-condensed table-striped"> + <tr> + {% if not rtl %} + <th>{{ _("Allow") }}</th> + <th>{{ _("Engine name") }}</th> + <th>{{ _("Shortcut") }}</th> + <th>{{ _("Selected language") }}</th> + <th>{{ _("SafeSearch") }}</th> + <th>{{ _("Time range") }}</th> + <th>{{ _("Avg. time") }}</th> + <th>{{ _("Max time") }}</th> + {% else %} + <th>{{ _("Max time") }}</th> + <th>{{ _("Avg. time") }}</th> + <th>{{ _("Time range") }}</th> + <th>{{ _("SafeSearch") }}</th> + <th>{{ _("Selected language") }}</th> + <th>{{ _("Shortcut") }}</th> + <th>{{ _("Engine name") }}</th> + <th>{{ _("Allow") }}</th> + {% endif %} + </tr> + {% for search_engine in engines_by_category[categ] %} + {% if not search_engine.private %} + <tr> + {% if not rtl %} + <td class="onoff-checkbox"> + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + </td> + <th>{{ search_engine.name }}</th> + <td class="name">{{ shortcuts[search_engine.name] }}</td> + <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td> + <td>{{ support_toggle(search_engine.safesearch==True) }}</td> + <td>{{ support_toggle(search_engine.time_range_support==True) }}</td> + <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> + <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td> + {% else %} + <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td> + <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> + <td>{{ support_toggle(search_engine.time_range_support==True) }}</td> + <td>{{ support_toggle(search_engine.safesearch==True) }}</td> + <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td> + <td>{{ shortcuts[search_engine.name] }}</td> + <th>{{ search_engine.name }}</th> + <td class="onoff-checkbox"> + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} + </td> + {% endif %} + </tr> + {% endif %} + {% endfor %} + </table> + </div> + </fieldset> + </div> + </div> + {% endfor %} + </div> + </div> + <div class="tab-pane active_if_nojs" id="tab_plugins"> + <noscript> + <h3>{{ _('Plugins') }}</h3> + </noscript> + <fieldset> + <div class="container-fluid"> + {% for plugin in plugins %} + <div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title">{{ _(plugin.name) }}</h3> + </div> + <div class="panel-body"> + <div class="col-xs-6 col-sm-4 col-md-6">{{ _(plugin.description) }}</div> + <div class="col-xs-6 col-sm-4 col-md-6"> + <div class="onoff-checkbox"> + {{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }} + </div> + </div> + </div> + </div> + {% endfor %} + </div> + </fieldset> + </div> + + {% if answerers %} + <div class="tab-pane active_if_nojs" id="tab_answerers"> + <noscript> + <h3>{{ _('Answerers') }}</h3> + </noscript> + <p class="text-muted" style="margin:20px 0;"> + {{ _('This is the list of searx\'s instant answering modules.') }} + </p> + <table class="table table-striped"> + <tr> + <th class="text-muted">{{ _('Name') }}</th> + <th class="text-muted">{{ _('Keywords') }}</th> + <th class="text-muted">{{ _('Description') }}</th> + <th class="text-muted">{{ _('Examples') }}</th> + </tr> + + {% for answerer in answerers %} + <tr> + <td class="text-muted">{{ answerer.info.name }}</td> + <td class="text-muted">{{ answerer.keywords|join(', ') }}</td> + <td class="text-muted">{{ answerer.info.description }}</td> + <td class="text-muted">{{ answerer.info.examples|join(', ') }}</td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} + + <div class="tab-pane active_if_nojs" id="tab_cookies"> + <noscript> + <h3>{{ _('Cookies') }}</h3> + </noscript> + <p class="text-muted" style="margin:20px 0;"> + {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br /> + {{ _('With that list, you can assess searx transparency.') }}<br /> + </p> + {% if cookies %} + <table class="table table-striped"> + <tr> + <th class="text-muted" style="padding-right:40px;">{{ _('Cookie name') }}</th> + <th class="text-muted">{{ _('Value') }}</th> + </tr> + + {% for cookie in cookies %} + <tr> + <td class="text-muted" style="padding-right:40px;">{{ cookie }}</td> + <td class="text-muted">{{ cookies[cookie] }}</td> + </tr> + {% endfor %} + </table> + {% else %} + {% include 'oscar/messages/no_cookies.html' %} + {% endif %} + </div> + </div> + <p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + <br /> + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} + </p> + <p style="margin:20px 0;">{{ _('Search URL of the currently saved preferences') }} <small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:<br/> + <input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}"> + </p> + + <input type="submit" class="btn btn-primary" value="{{ _('save') }}" /> + <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a> + <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a> + </form> +</div> +{% endblock %} diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html new file mode 100644 index 0000000..ba74d03 --- /dev/null +++ b/searx/templates/oscar/result_templates/code.html @@ -0,0 +1,18 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
+
+{{ result_header(result, favicons) }}
+{{ result_sub_header(result) }}
+
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
+
+{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %}
+
+<div dir="ltr">
+{{ result.codelines|code_highlighter(result.code_language)|safe }}
+</div>
+
+{% if rtl %}
+{{ result_footer_rtl(result) }}
+{% else %}
+{{ result_footer(result) }}
+{% endif %}
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html new file mode 100644 index 0000000..3ed0f31 --- /dev/null +++ b/searx/templates/oscar/result_templates/default.html @@ -0,0 +1,31 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
+
+{{ result_header(result, favicons) }}
+{{ result_sub_header(result) }}
+
+{% if result.embedded %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>
+{% endif %}
+
+{% if result.embedded %}
+<div id="result-media-{{ index }}" class="collapse">
+ {{ result.embedded|safe }}
+</div>
+{% endif %}
+
+{% if result.img_src %}
+<div class="container-fluid">
+ <div class="row">
+<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
+{% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %}
+ </div>
+</div>
+{% else %}
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
+{% endif %}
+
+{% if rtl %}
+{{ result_footer_rtl(result) }}
+{% else %}
+{{ result_footer(result) }}
+{% endif %}
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html new file mode 100644 index 0000000..b23f349 --- /dev/null +++ b/searx/templates/oscar/result_templates/images.html @@ -0,0 +1,39 @@ +{% from 'oscar/macros.html' import draw_favicon %}
+
+<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}">
+ <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">
+</a>
+
+<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-wrapper">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
+ <h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4>
+ </div>
+ <div class="modal-body">
+ <img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}">
+ {% if result.author %}<span class="photo-author">{{ result.author }}</span><br />{% endif %}
+ {% if result.content %}
+ <p class="result-content">
+ {{ result.content }}
+ </p>
+ {% endif %}
+ </div>
+ <div class="modal-footer">
+ <div class="clearfix"></div>
+ <span class="label label-default pull-right">{{ result.engine }}</span>
+ <p class="text-muted pull-left">{{ result.pretty_url }}</p>
+ <div class="clearfix"></div>
+ <div class="row">
+ <div class="col-md-6">
+ <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('Get image') }}</a>
+ </div>
+ <div class="col-md-6">
+ <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('View source') }}</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html new file mode 100644 index 0000000..822c7cd --- /dev/null +++ b/searx/templates/oscar/result_templates/map.html @@ -0,0 +1,72 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
+
+{{ result_header(result, favicons) }}
+{{ result_sub_header(result) }}
+
+{% if (result.latitude and result.longitude) or result.boundingbox %}
+ <small> • <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
+{% endif %}
+
+{% if result.osm and (result.osm.type and result.osm.id) %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request disabled_if_nojs" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small>
+{% endif %}
+
+{# {% if (result.latitude and result.longitude) %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small>
+{% endif %} #}
+
+<div class="container-fluid">
+
+{% if result.address %}
+<p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress">
+ {% if result.address.name %}
+ <strong itemprop="name">{{ result.address.name }}</strong><br/>
+ {% endif %}
+ {% if result.address.road %}
+ <span itemprop="streetAddress">
+ {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
+ {{ result.address.road }}
+ </span><br/>
+ {% endif %}
+ {% if result.address.locality %}
+ <span itemprop="addressLocality">{{ result.address.locality }}</span>
+ {% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
+ <br/>
+ {% endif %}
+ {% if result.address.country %}
+ <span itemprop="addressCountry">{{ result.address.country }}</span>
+ {% endif %}
+</p>
+{% endif %}
+
+{% if result.osm and (result.osm.type and result.osm.id) %}
+ <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}>
+ <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
+ <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
+ <tr><th>key</th><th>value</th></tr>
+ </table>
+ </div>
+{% endif %}
+
+{# {% if (result.latitude and result.longitude) %}
+ <div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
+ <strong>Longitude:</strong> {{ result.longitude }} <br/>
+ <strong>Latitude:</strong> {{ result.latitude }}
+ </div>
+{% endif %} #}
+
+{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
+
+</div>
+
+{% if (result.latitude and result.longitude) or result.boundingbox %}
+ <div class="collapse" id="result-map-{{ index }}">
+ <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
+ </div>
+{% endif %}
+
+{% if rtl %}
+{{ result_footer_rtl(result) }}
+{% else %}
+{{ result_footer(result) }}
+{% endif %}
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html new file mode 100644 index 0000000..bc2b30f --- /dev/null +++ b/searx/templates/oscar/result_templates/torrent.html @@ -0,0 +1,25 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span> +{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }} + <span class="badge"> + {% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} + {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }} + {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }} + {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} + {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %} + </span>{% endif %} +{% if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %} + +{% if result.content %}<br />{{ result.content|safe }}{% endif %} + +</p> + +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html new file mode 100644 index 0000000..36fb262 --- /dev/null +++ b/searx/templates/oscar/result_templates/videos.html @@ -0,0 +1,27 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
+
+{{ result_header(result, favicons) }}
+{{ result_sub_header(result) }}
+
+{% if result.embedded %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>
+{% endif %}
+
+{% if result.embedded %}
+<div id="result-video-{{ index }}" class="collapse">
+ {{ result.embedded|safe }}
+</div>
+{% endif %}
+
+<div class="container-fluid">
+ <div class="row">
+ <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
+ {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
+ </div>
+</div>
+
+{% if rtl %}
+{{ result_footer_rtl(result) }}
+{% else %}
+{{ result_footer(result) }}
+{% endif %}
diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html new file mode 100644 index 0000000..ee1052d --- /dev/null +++ b/searx/templates/oscar/results.html @@ -0,0 +1,155 @@ +{% extends "oscar/base.html" %}
+{% macro search_form_attrs(pageno) -%}
+ {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
+ <input type="hidden" name="q" value="{{ q|e }}" />
+ <input type="hidden" name="pageno" value="{{ pageno }}" />
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
+ <input type="hidden" name="language" value="{{ current_language }}" />
+{%- endmacro %}
+{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%}
+
+{% block title %}{{ q|e }} - {% endblock %}
+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&format=rss">{% endblock %}
+{% block content %}
+ {% include 'oscar/search.html' %}
+ <div class="row">
+ <div class="col-sm-8" id="main_results">
+ <h1 class="sr-only">{{ _('Search results') }}</h1>
+
+ {% if corrections %}
+ <div class="result">
+ <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
+ {% for correction in corrections %}
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
+ <input type="hidden" name="q" value="{{ correction }}">
+ <button type="submit" class="btn btn-default btn-xs">{{ correction }}</button>
+ </form>
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ {% if answers %}
+ {% for answer in answers %}
+ <div class="result well">
+ <span>{{ answer }}</span>
+ </div>
+ {% endfor %}
+ {% endif %}
+
+ {% for result in results %}
+ <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
+ {% set index = loop.index %}
+ {% if result.template %}
+ {% include get_result_template('oscar', result['template']) %}
+ {% else %}
+ {% include 'oscar/result_templates/default.html' %}
+ {% endif %}
+ </div>
+ {% endfor %}
+
+ {% if not results and not answers %}
+ {% include 'oscar/messages/no_results.html' %}
+ {% endif %}
+
+ <div class="clearfix"></div>
+
+ {% if paging %}
+ {% if rtl %}
+ <div id="pagination">
+ <div class="pull-left">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
+ {{ search_form_attrs(pageno+1) }}
+ <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
+ </form>
+ </div>
+ <div class="pull-right">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
+ {{ search_form_attrs(pageno-1) }}
+ <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
+ </form>
+ </div>
+ </div><!-- /#pagination -->
+ <div class="clearfix"></div>
+ {% else %}
+ <div id="pagination">
+ <div class="pull-left">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
+ {{ search_form_attrs(pageno-1) }}
+ <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
+ </form>
+ </div>
+ <div class="pull-right">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
+ {{ search_form_attrs(pageno+1) }}
+ <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
+ </form>
+ </div>
+ </div><!-- /#pagination -->
+ <div class="clearfix"></div>
+ {% endif %}
+ {% endif %}
+ </div><!-- /#main_results -->
+
+ <div class="col-sm-4" id="sidebar_results">
+ {% if number_of_results != '0' %}
+ <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
+ {% endif %}
+
+ {% if unresponsive_engines and results|length >= 1 %}
+ <div class="alert alert-danger fade in" role="alert">
+ <p>{{ _('Engines cannot retrieve results') }}:</p>
+ {% for engine_name, error_type in unresponsive_engines %}
+ {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
+ {% endfor %}
+ </div>
+ {% endif %}
+
+ {% if infoboxes %}
+ {% for infobox in infoboxes %}
+ {% include 'oscar/infobox.html' %}
+ {% endfor %}
+ {% endif %}
+
+ {% if suggestions %}
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">{{ _('Suggestions') }}</h4>
+ </div>
+ <div class="panel-body">
+ {% for suggestion in suggestions %}
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
+ <input type="hidden" name="q" value="{{ suggestion }}">
+ <button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
+ </form>
+ {% endfor %}
+ </div>
+ </div>
+ {% endif %}
+
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">{{ _('Links') }}</h4>
+ </div>
+ <div class="panel-body">
+ <form role="form">
+ <div class="form-group">
+ <label for="search_url">{{ _('Search URL') }}</label>
+ <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>
+ </div>
+ </form>
+
+ <label>{{ _('Download results') }}</label>
+ <div class="clearfix"></div>
+ {% for output_type in ('csv', 'json', 'rss') %}
+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
+ {{ search_form_attrs(pageno) }}
+ <input type="hidden" name="format" value="{{ output_type }}">
+ <button type="submit" class="btn btn-default">{{ output_type }}</button>
+ </form>
+ {% endfor %}
+ <div class="clearfix"></div>
+ </div>
+ </div>
+ </div><!-- /#sidebar_results -->
+ </div>
+{% endblock %}
diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html new file mode 100644 index 0000000..59ee468 --- /dev/null +++ b/searx/templates/oscar/search.html @@ -0,0 +1,24 @@ +{% from 'oscar/macros.html' import icon %}
+<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
+ <div class="row">
+ <div class="col-xs-12 col-md-8">
+ <div class="input-group search-margin">
+ <input type="search" name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
+ <span class="input-group-btn">
+ <button type="submit" class="btn btn-default"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
+ </span>
+ </div>
+ </div>
+ <div class="col-xs-6 col-md-2 search-margin">
+ {% include 'oscar/time-range.html' %}
+ </div>
+ <div class="col-xs-6 col-md-2 search-margin">
+ {% include 'oscar/languages.html' %}
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-12">
+ {% include 'oscar/categories.html' %}
+ </div>
+ </div>
+</form><!-- / #search_form_full -->
diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html new file mode 100644 index 0000000..6fdae40 --- /dev/null +++ b/searx/templates/oscar/search_full.html @@ -0,0 +1,18 @@ +{% from 'oscar/macros.html' import icon %}
+
+<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
+ {% if rtl %}
+ <div class="input-group">
+ {% else %}
+ <div class="input-group col-md-8 col-md-offset-2">
+ {% endif %}
+ <input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
+ <span class="input-group-btn">
+ <button type="submit" class="btn btn-default input-lg"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
+ </span>
+ </div>
+ <div class="col-md-8 col-md-offset-2 advanced">
+ {% include 'oscar/advanced.html' %}
+ </div>
+
+</form><!-- / #search_form_full -->
diff --git a/searx/templates/oscar/stats.html b/searx/templates/oscar/stats.html new file mode 100644 index 0000000..0fb1042 --- /dev/null +++ b/searx/templates/oscar/stats.html @@ -0,0 +1,33 @@ +{% extends "oscar/base.html" %} +{% block title %}{{ _('stats') }} - {% endblock %} +{% block content %} +<div class="container-fluid"> + <h1>{{ _('Engine stats') }}</h1> + <div class="row"> + {% for stat_name,stat_category in stats %} + <div class="col-xs-12 col-sm-12 col-md-6"> + <h3>{{ stat_name }}</h3> + <div class="container-fluid"> + {% for engine in stat_category %} + <div class="row"> + <div class="col-sm-4 col-md-4">{{ engine.name }}</div> + <div class="col-sm-8 col-md-8"> + <div class="progress"> + <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{ '%i'|format(engine.avg) }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ engine.percentage }}%;"> + {{ '%.02f'|format(engine.avg) }} + </div> + </div> + </div> + </div> + {% endfor %} + {% if not stat_category %} + <div class="col-sm-12 col-md-12"> + {% include 'oscar/messages/no_data_available.html' %} + </div> + {% endif %} + </div> + </div> + {% endfor %} + </div> +</div> +{% endblock %} diff --git a/searx/templates/oscar/time-range.html b/searx/templates/oscar/time-range.html new file mode 100644 index 0000000..d5efe91 --- /dev/null +++ b/searx/templates/oscar/time-range.html @@ -0,0 +1,17 @@ +<select name="time_range" id="time-range" class="custom-select form-control"> + <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}> + {{ _('Anytime') }} + </option> + <option id="time-range-day" value="day" {{ "selected" if time_range=="day" else ""}}> + {{ _('Last day') }} + </option> + <option id="time-range-week" value="week" {{ "selected" if time_range=="week" else ""}}> + {{ _('Last week') }} + </option> + <option id="time-range-month" value="month" {{ "selected" if time_range=="month" else ""}}> + {{ _('Last month') }} + </option> + <option id="time-range-year" value="year" {{ "selected" if time_range=="year" else ""}}> + {{ _('Last year') }} + </option> +</select> diff --git a/searx/templates/pix-art/404.html b/searx/templates/pix-art/404.html new file mode 100644 index 0000000..389bb5e --- /dev/null +++ b/searx/templates/pix-art/404.html @@ -0,0 +1,9 @@ +{% extends "pix-art/base.html" %} +{% block content %} +<div class="center"> + <h1>{{ _('Page not found') }}</h1> + {% autoescape false %} + <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + {% endautoescape %} +</div> +{% endblock %} diff --git a/searx/templates/pix-art/about.html b/searx/templates/pix-art/about.html new file mode 100644 index 0000000..f76a689 --- /dev/null +++ b/searx/templates/pix-art/about.html @@ -0,0 +1,4 @@ +{% extends 'pix-art/base.html' %} +{% block content %} +{% include '__common__/about.html' %} +{% endblock %} diff --git a/searx/templates/pix-art/base.html b/searx/templates/pix-art/base.html new file mode 100644 index 0000000..6af8823 --- /dev/null +++ b/searx/templates/pix-art/base.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}> + <head> + <meta charset="UTF-8" /> + <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" /> + <meta name="keywords" content="searx, search, search engine, metasearch, meta search" /> + <meta name="generator" content="searx/{{ searx_version }}"> + <meta name="referrer" content="no-referrer"> + <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" /> + <title>{% block title %}{% endblock %}searx</title> + <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" /> + <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" /> + {% block styles %} + {% endblock %} + {% block meta %}{% endblock %} + {% block head %} + {% endblock %} + <script type="text/javascript"> + var favicons = [[]]; + </script> + </head> + <body> + <div id="container"> + {% block content %} + {% endblock %} + <script type="text/javascript"> + searx = {}; + </script> + <script src="{{ url_for('static', filename='js/searx.js') }}" ></script> + <script type="text/javascript"> + load_images(1); + </script> + </div> + </body> +</html> diff --git a/searx/templates/pix-art/index.html b/searx/templates/pix-art/index.html new file mode 100644 index 0000000..a0c61f9 --- /dev/null +++ b/searx/templates/pix-art/index.html @@ -0,0 +1,12 @@ +{% extends "pix-art/base.html" %} +{% block content %} +<div class="center"> + <div class="title"><h1><img src="{{ url_for('static', filename='img/searx-pixel.png') }}" alt="searx Logo"/></h1></div> + {% include 'pix-art/search.html' %} + <p class="top_margin"> + <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a> + <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> + </p> +</div> +{% endblock %} + diff --git a/searx/templates/pix-art/preferences.html b/searx/templates/pix-art/preferences.html new file mode 100644 index 0000000..0b2bb67 --- /dev/null +++ b/searx/templates/pix-art/preferences.html @@ -0,0 +1,81 @@ +{% extends "legacy/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<div class="row"> + <h2>{{ _('Preferences') }}</h2> + + <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + <fieldset> + <legend>{{ _('Search language') }}</legend> + <p> + <select name='language'> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Interface language') }}</legend> + <p> + <select name='locale'> + {% for locale_id,locale_name in locales.items() | sort %} + <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Method') }}</legend> + <p> + <select name='method'> + <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option> + <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option> + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Themes') }}</legend> + <p> + <select name="theme"> + {% for name in themes %} + <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option> + {% endfor %} + </select> + </p> + </fieldset> + <fieldset> + <legend>{{ _('Currently used search engines') }}</legend> + + <table> + <tr> + <th>{{ _('Engine name') }}</th> + <th>{{ _('Allow') }} / {{ _('Block') }}</th> + </tr> + {% for categ in all_categories %} + {% for search_engine in engines_by_category[categ] %} + + {% if not search_engine.private %} + <tr> + <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})‎</td> + <td class="engine_checkbox"> + <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in disabled_engines %} checked="checked"{% endif %} /> + <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label> + <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label> + </td> + </tr> + {% endif %} + {% endfor %} + {% endfor %} + </table> + </fieldset> + <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + <br /> + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} + </p> + + <input type="submit" value="{{ _('save') }}" /> + <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div> + </form> +</div> +{% endblock %} diff --git a/searx/templates/pix-art/result_templates/default.html b/searx/templates/pix-art/result_templates/default.html new file mode 100644 index 0000000..ada81e5 --- /dev/null +++ b/searx/templates/pix-art/result_templates/default.html @@ -0,0 +1,7 @@ +<a href="{{ result.url }}" title="{{ result.title | striptags }}" rel="noreferrer"> + <canvas id="canvas-{{ pageno }}-{{ index }}" class="icon" width="16" height="16"></canvas> +</a> +<script type="text/javascript"> +favicons[{{ pageno }}][{{ index }}] = 'http://{{ result.url | extract_domain }}/favicon.ico'; +</script> + diff --git a/searx/templates/pix-art/result_templates/images.html b/searx/templates/pix-art/result_templates/images.html new file mode 100644 index 0000000..d85f841 --- /dev/null +++ b/searx/templates/pix-art/result_templates/images.html @@ -0,0 +1,6 @@ +<div class="image_result"> + <p> + <a href="{{ result.img_src }}" rel="noreferrer"><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a> + <span class="url"><a href="{{ result.url }}" rel="noreferrer" class="small_font">{{ _('original context') }}</a></span> + </p> +</div> diff --git a/searx/templates/pix-art/results.html b/searx/templates/pix-art/results.html new file mode 100644 index 0000000..8999e05 --- /dev/null +++ b/searx/templates/pix-art/results.html @@ -0,0 +1,32 @@ +{% if pageno > 1 %} + {% for result in results %} + {% set index = loop.index %} + {% include 'pix-art/result_templates/default.html' %} + {% endfor %} +{% else %} +{% extends "pix-art/base.html" %} +{% block title %}{{ q|e }} - {% endblock %} +{% block meta %}{% endblock %} +{% block content %} +<div id="logo"><a href="./"><img src="{{ url_for('static', filename='img/searx-pixel-small.png') }}" alt="searx Logo"/></a></div> +<div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div> +<div class="small search center"> + {% include 'pix-art/search.html' %} +</div> +<script type="text/javascript"> + favicons[{{ pageno }}] = []; +</script> +<div id="results"> + <span id="results_list"> + {% for result in results %} + {% set index = loop.index %} + {% include 'pix-art/result_templates/default.html' %} + {% endfor %} + </span> + <div id="pagination"> + <br /> + <input type="button" onclick="load_more('{{ q|e }}', {{ pageno+1 }})" id="load_more" value="{{ _('Load more...') }}" /> + </div> +</div> +{% endblock %} +{% endif %} diff --git a/searx/templates/pix-art/search.html b/searx/templates/pix-art/search.html new file mode 100644 index 0000000..4d129ec --- /dev/null +++ b/searx/templates/pix-art/search.html @@ -0,0 +1,9 @@ +<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> + <div id="search_wrapper"> + <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" size="100" {% if q %}value="{{ q }}"{% endif %}/> + <input type="submit" value="" id="search_submit" /> + {% for category in categories %} + <input type="hidden" name="category_{{ category }}" value="1"/> + {% endfor %} + </div> +</form> diff --git a/searx/templates/pix-art/stats.html b/searx/templates/pix-art/stats.html new file mode 100644 index 0000000..372447e --- /dev/null +++ b/searx/templates/pix-art/stats.html @@ -0,0 +1,22 @@ +{% extends "legacy/base.html" %} +{% block head %} {% endblock %} +{% block content %} +<h2>{{ _('Engine stats') }}</h2> + +{% for stat_name,stat_category in stats %} +<div class="left"> + <table> + <tr colspan="3"> + <th>{{ stat_name }}</th> + </tr> + {% for engine in stat_category %} + <tr> + <td>{{ engine.name }}</td> + <td>{{ '%.02f'|format(engine.avg) }}</td> + <td class="percentage"><div style="width: {{ engine.percentage }}%"> </div></td> + </tr> + {% endfor %} + </table> +</div> +{% endfor %} +{% endblock %} diff --git a/searx/templates/simple/404.html b/searx/templates/simple/404.html new file mode 100644 index 0000000..11d6043 --- /dev/null +++ b/searx/templates/simple/404.html @@ -0,0 +1,9 @@ +{% extends "simple/base.html" %} +{% block content %} +<div class="center"> + <h1>{{ _('Page not found') }}</h1> + {% autoescape false %} + <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + {% endautoescape %} +</div> +{% endblock %} diff --git a/searx/templates/simple/about.html b/searx/templates/simple/about.html new file mode 100644 index 0000000..1913879 --- /dev/null +++ b/searx/templates/simple/about.html @@ -0,0 +1,4 @@ +{% extends 'simple/base.html' %} +{% block content %} +{% include '__common__/about.html' %} +{% endblock %} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html new file mode 100644 index 0000000..f0dea57 --- /dev/null +++ b/searx/templates/simple/base.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html class="no-js" lang="en" {% if rtl %} dir="rtl"{% endif %}> +<head> + <meta charset="UTF-8" /> + <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine"> + <meta name="keywords" content="searx, search, search engine, metasearch, meta search"> + <meta name="generator" content="searx/{{ searx_version }}"> + <meta name="referrer" content="no-referrer"> + <meta name="robots" content="noarchive"> + <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1"> + <meta name="HandheldFriendly" content="True"> + <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"> + <title>{% block title %}{% endblock %}searx</title> + {% if rtl %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/searx-rtl.min.css') }}" type="text/css" media="screen" /> + {% else %} + <link rel="stylesheet" href="{{ url_for('static', filename='css/searx.min.css') }}" type="text/css" media="screen" /> + {% endif %} + {% block styles %}{% endblock %} + {% block meta %}{% endblock %} + {% block head %} + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + {% endblock %} + <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" /> + <script type="text/javascript"> + var searx = { + autocompleter: {% if autocomplete %}true{% else %}false{% endif %}, + method: "{{ method or 'POST' }}", + touch: (("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch) || false, + staticPath: "{{ url_for('static', filename='themes/simple') }}/", + noItemFound: "{{ _('No item found') }}", + search_on_category_select: {{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}}, + infinite_scroll: {{ 'true' if 'plugins/js/infinite_scroll.js' in scripts else 'false' }} + }; + document.getElementsByTagName("html")[0].className = (searx.touch)?"js touch":"js"; + </script> +</head> +<body> + <main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}"> + {% if errors %} + <div class="dialog-error" role="alert"> + <a href="#" class="close" aria-label="close" title="close">×</a> + <ul> + {% for message in errors %} + <li>{{ message }}</li> + {% endfor %} + </ul> + </div> + {% endif %} + + {% block content %} + {% endblock %} + </main> + <footer> + <p> + {{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> + <a href="https://github.com/asciimoo/searx">{{ _('Source code') }}</a> | + <a href="https://github.com/asciimoo/searx/issues">{{ _('Issue tracker') }}</a> | + <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">{{ _('Public instances') }}</a> + </p> + </footer> + <!--[if gte IE 9]>--> + <script src="{{ url_for('static', filename='js/searx.min.js') }}" ></script> + <!--<![endif]--> +</body> +</html> diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html new file mode 100644 index 0000000..127d55b --- /dev/null +++ b/searx/templates/simple/categories.html @@ -0,0 +1,8 @@ +<div id="categories">{{- '' -}} + <div id="categories_container"> + {%- for category in categories -%} + <div class="category"><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></div> + {%- endfor -%} + {%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%} + </div>{{- '' -}} +</div> diff --git a/searx/templates/simple/index.html b/searx/templates/simple/index.html new file mode 100644 index 0000000..4e8e76c --- /dev/null +++ b/searx/templates/simple/index.html @@ -0,0 +1,12 @@ +{% extends "simple/base.html" %} +{% from 'simple/macros.html' import icon %} +{% block meta %} + <link rel="preload" href="{{ url_for('static', filename='img/searx.png') }}" as="image" /> +{% endblock %} +{% block content %} +<nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav> +<div class="index"> + <div class="title"><h1>searx</h1></div> + {% include 'simple/search.html' %} +</div> +{% endblock %} diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html new file mode 100644 index 0000000..d99806a --- /dev/null +++ b/searx/templates/simple/infobox.html @@ -0,0 +1,46 @@ +<aside class="infobox"> + <h2><bdi>{{ infobox.infobox }}</bdi></h2> + {% if infobox.img_src %}<img src="{{ image_proxify(infobox.img_src) }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %} + <p><bdi>{{ infobox.entity }}</bdi></p> + <p><bdi>{{ infobox.content | safe }}</bdi></p> + {% if infobox.attributes %} + <div class="attributes"> + {% for attribute in infobox.attributes %} + <dl> + <dt><bdi>{{ attribute.label }} :</bdi></dt> + {%- if attribute.image -%} + <dd><img src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></dd> + {%- else -%} + <dd><bdi>{{ attribute.value }}</bdi></dd> + {%- endif -%} + </dl> + {% endfor %} + </div> + {% endif %} + + {% if infobox.urls %} + <div class="urls"> + <ul> + {%- for url in infobox.urls -%} + <li class="url"><bdi><a href="{{ url.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ url.title }}</a></bdi></li> + {%- endfor -%} + </ul> + </div> + {% endif %} + + {% if infobox.relatedTopics %} + <div class="relatedTopics"> + {% for topic in infobox.relatedTopics %} + <div> + <h3><bdi>{{ topic.name }}</bdi></h3> + {% for suggestion in topic.suggestions %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="submit" value="{{ suggestion }}" /> + </form> + {% endfor %} + </div> + {% endfor %} + </div> + {% endif %} +</aside> diff --git a/searx/templates/simple/languages.html b/searx/templates/simple/languages.html new file mode 100644 index 0000000..dd928ff --- /dev/null +++ b/searx/templates/simple/languages.html @@ -0,0 +1,8 @@ +<select class="language" id="language" name="language" tabindex="2">{{- '' -}} + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}> + {{- lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id -}} + </option> + {%- endfor -%} +</select> diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html new file mode 100644 index 0000000..f0b3627 --- /dev/null +++ b/searx/templates/simple/macros.html @@ -0,0 +1,85 @@ +<!-- Draw glyphicon icon from bootstrap-theme --> +{% macro icon(action) -%} + <span class="ion-icon-big ion-{{ action }}"></span> +{%- endmacro %} + +{% macro icon_small(action) -%} + <span class="ion-icon ion-{{ action }}"></span> +{%- endmacro %} + +<!-- Draw favicon --> +{% macro draw_favicon(favicon) -%} + <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='themes/simple/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" /> +{%- endmacro %} + +{% macro result_open_link(url, classes='') -%} + <a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}> +{%- endmacro %} + +{%- macro result_close_link() -%} + </a> +{%- endmacro %} + +{%- macro result_link(url, title, classes='') -%} + {{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }} +{%- endmacro -%} + +<!-- Draw result header --> +{% macro result_header(result, favicons, image_proxify) -%} +<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}"> + {%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="image" />{{ result_close_link() }}{% endif -%} + {%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/>{{ result_close_link() }}{% endif -%} + <h3>{{ result_link(result.url, result.title|safe) }}</h3> +{%- endmacro -%} + +<!-- Draw result sub header --> +{%- macro result_sub_header(result) -%} + {% if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %} +{%- endmacro -%} + +<!-- Draw result sub footer --> +{%- macro result_sub_footer(result, proxify) -%} +<div class="engines">{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}</div>{{- '' -}} +<p class="url"><span class="url">{{ result.pretty_url }}</span>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "cache_link") }}‎ {% if proxify %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %}</p>{{- '' -}} +<div class="break"></div>{{- '' -}} +{%- endmacro -%} + +<!-- Draw result footer --> +{%- macro result_footer(result) -%} +</article> +{%- endmacro -%} + +<!-- --> +{%- macro tabs_open() -%} +<div class="tabs" role="tablist"> +{%- endmacro -%} + +{%- macro tab_header(name, id, label) -%} +<input type="radio" name="{{ name }}" id="tab_{{ id }}"/> +<label for="tab_{{ id }}" role="tab" + aria-controls="panel{{ id }}">{{ label }}</label> +<section id="tab-content{{ id }}" role="tabpanel" + aria-labelledby="{{ label }}" aria-hidden="false"> +{%- endmacro -%} + +{%- macro tab_footer() -%} +</section> +{%- endmacro -%} + +{%- macro tabs_close() -%} +</div> +{%- endmacro -%} + +{%- macro checkbox_onoff(name, checked) -%} +<div class="checkbox-onoff">{{- '' -}} + <input type="checkbox" value="None" id="{{ name }}" name="{{ name }}" {% if checked %}checked{% endif %}/>{{- '' -}} + <label for="{{ name }}"></label>{{- '' -}} +</div> +{%- endmacro -%} + +{%- macro checkbox(name, checked, readonly, disabled) -%} +<div class="checkbox">{{- '' -}} + <input type="checkbox" value="None" id="{{ name }}" name="{{ name }}" {% if checked %}checked{% endif %}{% if readonly %} readonly="readonly" {% endif %}{% if disabled %} disabled="disabled" {% endif %}/>{{- '' -}} + <label for="{{ name }}"></label>{{- '' -}} +</div> +{%- endmacro -%} diff --git a/searx/templates/simple/messages/no_results.html b/searx/templates/simple/messages/no_results.html new file mode 100644 index 0000000..fa984b0 --- /dev/null +++ b/searx/templates/simple/messages/no_results.html @@ -0,0 +1,17 @@ +{% from 'simple/macros.html' import icon %} +{% if unresponsive_engines %} +<div class="dialog-error" role="alert"> + <p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p> + <p> + {% for engine_name, error_type in unresponsive_engines %} + {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %} + {% endfor %} + </p> + <p><small>{{ _('Please, try again later or find another searx instance.') }}</small></p> +</div> +{% else %} +<div class="dialog-error" role="alert"> + <p><strong>{{ _('Sorry!') }}</strong></p> + <p>{{ _('we didn\'t find any results. Please use another query or search in more categories.') }}</p> +</div> +{% endif %} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html new file mode 100644 index 0000000..049af5e --- /dev/null +++ b/searx/templates/simple/preferences.html @@ -0,0 +1,236 @@ +{% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} + +{% extends "simple/base.html" %} + +{%- macro plugin_preferences(section) -%} +{%- for plugin in plugins -%} +{%- if plugin.preference_section == section -%} +<fieldset>{{- '' -}} + <legend>{{ _(plugin.name) }}</legend>{{- '' -}} + <div class="value"> + {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}} + </div>{{- '' -}} + <div class="description"> + {{- _(plugin.description) -}} + </div>{{- '' -}} +</fieldset> +{%- endif -%} +{%- endfor -%} +{%- endmacro -%} + +{% block head %} {% endblock %} +{% block content %} + +<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a> + +<h2>{{ _('Preferences') }}</h2> + +<form id="search_form" method="post" action="{{ url_for('preferences') }}"> + +{{ tabs_open() }} + +{{ tab_header('maintab', 'general', _('General')) }} + <fieldset> + <legend>{{ _('Default categories') }}</legend> + {% set display_tooltip = false %} + {% include 'simple/categories.html' %} + </fieldset> + <fieldset> + <legend>{{ _('Search language') }}</legend> + <p class="value">{{- '' -}} + <select name='language'>{{- '' -}} + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> + {%- endfor -%} + </select>{{- '' -}} + </p> + <div class="description">{{ _('What language do you prefer for search?') }}</div> + </fieldset> + <fieldset> + <legend>{{ _('Autocomplete') }}</legend> + <p class="value"> + <select name="autocomplete"> + <option value=""> - </option> + {%- for backend in autocomplete_backends -%} + <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option> + {%- endfor -%} + </select> + </p> + <div class="description">{{ _('Find stuff as you type') }}</div> + </fieldset> + <fieldset> + <legend>{{ _('SafeSearch') }}</legend> + <p class="value"> + <select name='safesearch'> + <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option> + <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option> + <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option> + </select> + </p> + <div class="description">{{ _('Filter content') }}</p> + </fieldset> + {{ plugin_preferences('general') }} + <fieldset> + <legend>{{ _('Open Access DOI resolver') }}</legend> + <p class="value"> + <select id='doi_resolver' name='doi_resolver'> + {%- for doi_resolver_name,doi_resolver_url in doi_resolvers.items() -%} + <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}> + {{- doi_resolver_name }} - {{ doi_resolver_url -}} + </option> + {%- endfor -%} + </select> + </p> + <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div> + </fieldset> + {{ tab_footer() }} + + {{ tab_header('maintab', 'engines', _('Engines')) }} + <p>{{ _('Currently used search engines') }}</p> + + {{ tabs_open() }} + {% for categ in all_categories %} + + {{ tab_header('enginetab', 'category' + categ, _(categ)) }} + <div class="scrollx"> + <table class="striped"> + <tr> + <th class="engine_checkbox">{{ _("Allow") }}</th> + <th class="name">{{ _("Engine name") }}</th> + <th class="shortcut">{{ _("Shortcut") }}</th> + <th>{{ _("Supports selected language") }}</th> + <th>{{ _("SafeSearch") }}</th> + <th>{{ _("Time range") }}</th> + <th>{{ _("Avg. time") }}</th> + <th>{{ _("Max time") }}</th> + </tr> + {% for search_engine in engines_by_category[categ] %} + + {% if not search_engine.private %} + {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %} + <tr> + <td class="engine_checkbox">{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}</td> + <th class="name">{{ search_engine.name }}</th> + <td class="shortcut">{{ shortcuts[search_engine.name] }}</td> + <td>{{ checkbox(engine_id + '_supported_languages', current_language == 'all' or current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages, true, true) }}</td> + <td>{{ checkbox(engine_id + '_safesearch', search_engine.safesearch==True, true, true) }}</td> + <td>{{ checkbox(engine_id + '_time_range_support', search_engine.time_range_support==True, true, true) }}</td> + <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> + <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td> + </tr> + {% endif %} + {% endfor %} + </table> + <div> + {{ tab_footer() }} + {% endfor %} + {{ tabs_close() }} + {{ tab_footer() }} + + {{ tab_header('maintab', 'ui', _('User interface')) }} + <fieldset> + <legend>{{ _('Interface language') }}</legend> + <p class="value"> + <select name='locale'> + {% for locale_id,locale_name in locales.items() | sort %} + <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option> + {% endfor %} + </select> + </p> + <div class="description">{{ _('Change the language of the layout') }}</div> + </fieldset> + <fieldset> + <legend>{{ _('Themes') }}</legend> + <p class="value"> + <select name="theme"> + {%- for name in themes -%} + <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option> + {%- endfor -%} + </select> + </p> + <div class="description">{{ _('Change searx layout') }}</div> + </fieldset> + <fieldset> + <legend>{{ _('Results on new tabs') }}</legend> + <p class="value"> + <select name='results_on_new_tab'> + <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + </p> + <div class="description">{{_('Open result links on new browser tabs') }}</div> + </fieldset> + {{ plugin_preferences('ui') }} + {{ tab_footer() }} + + {{ tab_header('maintab', 'cookies', _('Cookies')) }} + + <p class="text-muted" style="margin:20px 0;"> + {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br /> + {{ _('With that list, you can assess searx transparency.') }}<br /> + </p> + + {% if cookies %} + <table class="cookies"> + <tr> + <th>{{ _('Cookie name') }}</th> + <th>{{ _('Value') }}</th> + </tr> + {% for cookie in cookies %} + <tr> + <td>{{ cookie }}</td> + <td>{{ cookies[cookie] }}</td> + </tr> + {% endfor %} + </table> + {% else %} + {% include 'oscar/messages/no_cookies.html' %} + {% endif %} + + <h4>{{ _('Search URL of the currently saved preferences') }} :</h4> + <div class="selectable_url"> + <pre>{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}</pre> + </div> + <p class="small_font">{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}</p> + + {{ tab_footer() }} + + {{ tab_header('maintab', 'privacy', _('Privacy')) }} + <fieldset> + <legend>{{ _('Method') }}</legend> + <p class="value"> + <select name='method'> + <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option> + <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option> + </select> + </p> + <div class="description">{{ _('Search language') }}</div> + </fieldset> + <fieldset> + <legend>{{ _('Image proxy') }}</legend> + <p class="value"> + <select name='image_proxy'> + <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option> + <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option> + </select> + </p> + <div class="description">{{ _('Proxying image results through searx') }}</div> + </fieldset> + {{ plugin_preferences('privacy') }} + + {{ tab_footer() }} + + {{ tabs_close() }} + + <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + <br /> + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} + </p> + + <input type="submit" value="{{ _('save') }}" /> + <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div> + <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div> + +</form> +{% endblock %} diff --git a/searx/templates/simple/result_templates/code.html b/searx/templates/simple/result_templates/code.html new file mode 100644 index 0000000..9db0531 --- /dev/null +++ b/searx/templates/simple/result_templates/code.html @@ -0,0 +1,13 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} +{%- if result.content %}{{ result.content|safe }}{% endif %}</p> +{%- if result.repository -%} +<p class="content"><a href="{{ result.repository|safe }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p> +{%- endif -%} +<div dir="ltr" class="codelines"> + {{- result.codelines|code_highlighter(result.code_language)|safe -}} +</div>{{- '' -}} +{{- result_sub_footer(result, proxify) -}} +{{ result_footer(result) }} diff --git a/searx/templates/simple/result_templates/default.html b/searx/templates/simple/result_templates/default.html new file mode 100644 index 0000000..b29ca55 --- /dev/null +++ b/searx/templates/simple/result_templates/default.html @@ -0,0 +1,17 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} +{% if result.embedded -%} +<p class="altlink"> • <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p> +{%- endif %} +<p class="content"> + {%- if result.content %}{{ result.content|safe }}{% endif -%} +</p> +{{- result_sub_footer(result, proxify) -}} +{% if result.embedded -%} +<div id="result-media-{{ index }}" class="invisible"> + {{- result.embedded|safe -}} +</div> +{%- endif %} +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/images.html b/searx/templates/simple/result_templates/images.html new file mode 100644 index 0000000..f756acb --- /dev/null +++ b/searx/templates/simple/result_templates/images.html @@ -0,0 +1,4 @@ +<article class="result result-images {% if result['category'] %}category-{{ result['category'] }}{% endif %}"> + <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="image_thumbnail" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a> + <span class="url"><a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="small_font">{{ result.parsed_url[0] }}://{{ result.parsed_url[1] }}</a></span> +</article> diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html new file mode 100644 index 0000000..2de4451 --- /dev/null +++ b/searx/templates/simple/result_templates/map.html @@ -0,0 +1,68 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} + +{%- if (result.latitude and result.longitude) or result.boundingbox -%} + <small> • <a class="btn-collapse collapsed searx_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small> +{%- endif -%} + +{%- if result.osm and (result.osm.type and result.osm.id) -%} + <small> • <a class="btn-collapse collapsed hide_if_nojs searx_overpass_request" data-target="#result-overpass-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}">{{ icon('location') }} {{ _('show details') }}</a></small> +{%- endif -%} +{#- +{% if (result.latitude and result.longitude) %} + <small> • <a class="btn-collapse disabled_if_nojs" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('location') }} {{ _('show geodata') }}</a></small> +{% endif %} +-#} + +{%- if result.address -%} +<p itemscope itemtype="http://schema.org/PostalAddress" class="content"> + {%- if result.address.name -%} + <strong itemprop="name">{{ result.address.name }}</strong><br/> + {%- endif -%} + {% if result.address.road -%} + <span itemprop="streetAddress"> + {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %} + {{- result.address.road -}} + </span><br/> + {%- endif %} + {%- if result.address.locality -%} + <span itemprop="addressLocality">{{- result.address.locality -}}</span> + {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %} + <br/> + {%- endif -%} + {%- if result.address.country -%} + <span itemprop="addressCountry">{{- result.address.country -}}</span> + {%- endif -%} +</p> +{%- endif -%} + +{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} + +{{- result_sub_footer(result, proxify) -}} + +{% if result.osm and (result.osm.type and result.osm.id) -%} + <div class="result-content invisible" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}> + <div id="result-overpass-table-loading-{{ index }}"><div class="loader">{{ _('Loading...') }}</div></div> + <table id="result-overpass-table-{{ index }}"> + <tbody> + </tbody> + </table> + </div> +{%- endif %} + +{#- +{% if (result.latitude and result.longitude) -%} + <div id="result-geodata-{{ index }}" class="invisible"> + <strong>Longitude:</strong> {{ result.longitude }} <br/> + <strong>Latitude:</strong> {{ result.latitude }} + </div> +{%- endif %} +-#} + +{% if (result.latitude and result.longitude) or result.boundingbox -%} + <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div> +{%- endif %} + +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/torrent.html b/searx/templates/simple/result_templates/torrent.html new file mode 100644 index 0000000..3c7fd15 --- /dev/null +++ b/searx/templates/simple/result_templates/torrent.html @@ -0,0 +1,24 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, result_link %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} + +{% if result.magnetlink %}<p class="altlink"> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</p>{% endif %} +{% if result.torrentfile %}<p class="altlink"> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</p>{% endif %} + +{% if result.seed %}<p class="stat"> • {{ icon('arrow-swap') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>{% endif %} + +{%- if result.filesize %}<p class="stat">{{ icon('floppy-disk') }} {{ _('Filesize') }}<span class="badge"> + {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} + {%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }} + {%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }} + {%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} + {%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} + </span></p> +{%- endif -%} + +{%- if result.files %}<p class="stat">{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span></p>{% endif -%} + +{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} +{{- result_sub_footer(result, proxify) -}} +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html new file mode 100644 index 0000000..be270e9 --- /dev/null +++ b/searx/templates/simple/result_templates/videos.html @@ -0,0 +1,15 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) }} +{{ result_sub_header(result) }} +{% if result.embedded -%} +<p class="altlink"> • <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p> +{%- endif %} +{% if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif %} +{{- result_sub_footer(result, proxify) -}} +{% if result.embedded -%} +<div id="result-video-{{ index }}" class="invisible"> + {{- result.embedded|safe -}} +</div> +{%- endif %} +{{ result_footer(result) }} diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html new file mode 100644 index 0000000..195c478 --- /dev/null +++ b/searx/templates/simple/results.html @@ -0,0 +1,158 @@ +{% extends "simple/base.html" %} +{% from 'simple/macros.html' import icon, icon_small %} +{% block title %}{% if method == 'GET' %}{{- q|e -}} -{% endif %}{% endblock %} +{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&categories={{ selected_categories|join(",") | replace(' ','+') }}&pageno={{ pageno }}&time_range={{ time_range }}&language={{ current_language }}&safesearch={{ safesearch }}&format=rss">{% endblock %} +{% block content %} +<nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav> +{% include 'simple/search.html' %} + +{% if results and results|map(attribute='template')|unique|list|count == 1 %} + {% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %} +{% else %} + {% set unique_template = '' %} +{% endif %} + +<div id="results" class="{{ only_template }}"> + {% if answers -%} + <div id="answers"><h4 class="title">{{ _('Answers') }} : </h4> + {%- for answer in answers -%} + <div class="answer">{{- answer -}}</div> + {%- endfor -%} + </div> + {%- endif %} + + <div id="sidebar"> + + {% if number_of_results != '0' -%} + <p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p> + {%- endif %} + + {% if unresponsive_engines and results|length >= 1 %} + <div class="dialog-error" role="alert"> + <p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p> + <p>{% for engine_name, error_type in unresponsive_engines %} + {{- engine_name }} ({{- error_type -}}){% if not loop.last %}, {% endif %} + {% endfor %}</p> + </div> + {% endif %} + + {% if infoboxes %} + <div id="infoboxes"> + {% for infobox in infoboxes -%} + {% include 'simple/infobox.html' %} + {%- endfor %} + </div> + {% endif %} + + {% if suggestions %} + <div id="suggestions"> + <h4 class="title">{{ _('Suggestions') }} : </h4> + <div class="wrapper"> + {% for suggestion in suggestions %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="safesearch" value="{{ safesearch }}"> + <input type="hidden" name="theme" value="{{ theme }}"> + <input type="submit" class="suggestion" value="• {{ suggestion }}"> + </form> + {% endfor %} + </div> + </div> + {% endif %} + + <div id="search_url"> + <h4 class="title">{{ _('Search URL') }} :</h4> + <div class="selectable_url"><pre>{{ base_url }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}</pre></div> + </div> + <div id="apis"> + <h4 class="title">{{ _('Download results') }}</h4> + {% for output_type in ('csv', 'json', 'rss') %} + <div class="left"> + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <input type="hidden" name="q" value="{{ q|e }}"> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"> + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> + <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="safesearch" value="{{ safesearch }}"> + <input type="hidden" name="format" value="{{ output_type }}"> + <input type="submit" value="{{ output_type }}"> + </form> + </div> + {% endfor %} + </div> + </div> + + {% if corrections %} + <div id="corrections"> + <h4>{{ _('Try searching for:') }}</h4> + {% for correction in corrections %} + <div class="left"> + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation"> + <input type="hidden" name="q" value="{{ correction }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> + <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="safesearch" value="{{ safesearch }}"> + <input type="hidden" name="theme" value="{{ theme }}"> + <input type="submit" value="{{ correction }}"> + </form> + </div> + {% endfor %} + </div> + {% endif %} + + <div id="urls"> + {% for result in results %} + {% set index = loop.index %} + {% if result['template'] %} + {% include get_result_template('simple', result['template']) %} + {% else %} + {% include 'simple/result_templates/default.html' %} + {% endif %} + {% endfor %} + {% if not results and not answers %} + {% include 'simple/messages/no_results.html' %} + {% endif %} + </div> + <div id="backToTop"> + <a href="#">{{ icon_small('chevron-up') }}</a> + </div> + {% if paging %} + <nav id="pagination"> + {% if pageno > 1 %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="{% if rtl %}right{% else %}left{% endif %}"> + <input type="hidden" name="q" value="{{ q|e }}" > + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1" > + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno-1 }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > + <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="safesearch" value="{{ safesearch }}" > + <input type="hidden" name="theme" value="{{ theme }}" > + <button type="submit">{{ icon_small('chevron-left') }} {{ _('previous page') }}</button> + </div> + </form> + {% endif %} + <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div class="{% if rtl %}left{% else %}right{% endif %}"> + <input type="hidden" name="q" value="{{ q|e }}" > + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1" > + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno+1 }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > + <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="safesearch" value="{{ safesearch }}" > + <input type="hidden" name="theme" value="{{ theme }}" > + <button type="submit">{{ _('next page') }} {{ icon_small('chevron-right') }}</button> + </div> + </form> + </nav> + {% endif %} +</div> +{% endblock %} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html new file mode 100644 index 0000000..9c4a99b --- /dev/null +++ b/searx/templates/simple/search.html @@ -0,0 +1,17 @@ +<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <div id="search_wrapper"> + <div class="search_box"> + <input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} > + <button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon('close') }}</span><span class="show_if_nojs">{{ _('Clear search') }}</span></button> + <button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="show_if_nojs">{{ _('Start search') }}</span></button> + </div> + <div class="search_filters"> + {% include 'simple/languages.html' %} + {% include 'simple/time-range.html' %} + </div> + </div> + {% set display_tooltip = true %} + {% include 'simple/categories.html' %} + <input type="hidden" name="safesearch" value="{{ safesearch }}" > + <input type="hidden" name="theme" value="{{ theme }}" > +</form> diff --git a/searx/templates/simple/simple.spec.txt b/searx/templates/simple/simple.spec.txt new file mode 100644 index 0000000..a9724f8 --- /dev/null +++ b/searx/templates/simple/simple.spec.txt @@ -0,0 +1,40 @@ +#container + .search + #search_form + +#results + + #sidebar + #result-count + .title + .content + + .infobox + h2 + img + p + div#attributes + table + tbody + tr + td + td + div#urls + ul + li + + #suggestions + .title + .suggestion + + #search_url + .title + input + + #apis + .title + .api-link + + .result + + diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html new file mode 100644 index 0000000..462ab4a --- /dev/null +++ b/searx/templates/simple/stats.html @@ -0,0 +1,25 @@ +{% extends "simple/base.html" %} +{% block head %} {% endblock %} +{% block content %} + +<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a> + +<h2>{{ _('Engine stats') }}</h2> + +{% for stat_name,stat_category in stats %} +<div class="left"> + <table> + <tr colspan="3"> + <th>{{ stat_name }}</th> + </tr> + {% for engine in stat_category %} + <tr> + <td>{{ engine.name }}</td> + <td>{{ '%.02f'|format(engine.avg) }}</td> + <td class="percentage"><div style="width: {{ engine.percentage }}%"> </div></td> + </tr> + {% endfor %} + </table> +</div> +{% endfor %} +{% endblock %} diff --git a/searx/templates/simple/time-range.html b/searx/templates/simple/time-range.html new file mode 100644 index 0000000..a9fc9f1 --- /dev/null +++ b/searx/templates/simple/time-range.html @@ -0,0 +1,17 @@ +<select name="time_range" id="time_range" class="time_range" tabindex="3">{{- '' -}} + <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}> + {{- _('Anytime') -}} + </option>{{- '' -}} + <option id="time-range-day" value="day" {{ "selected" if time_range=="day" else ""}}> + {{- _('Last day') -}} + </option>{{- '' -}} + <option id="time-range-week" value="week" {{ "selected" if time_range=="week" else ""}}> + {{- _('Last week') -}} + </option>{{- '' -}} + <option id="time-range-month" value="month" {{ "selected" if time_range=="month" else ""}}> + {{- _('Last month') -}} + </option>{{- '' -}} + <option id="time-range-year" value="year" {{ "selected" if time_range=="year" else ""}}> + {{- _('Last year') -}} + </option>{{- '' -}} +</select> |