diff options
Diffstat (limited to 'searx/templates')
39 files changed, 347 insertions, 106 deletions
diff --git a/searx/templates/__common__/about.html b/searx/templates/__common__/about.html index 9741b51..649e661 100644 --- a/searx/templates/__common__/about.html +++ b/searx/templates/__common__/about.html @@ -7,10 +7,10 @@ while not storing information about its users. </p> - <p>More about searx ...</p> + <p>More about searx...</p> <ul> - <li><a href="https://github.com/asciimoo/searx">github</a></li> + <li><a href="https://github.com/searx/searx">github</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> @@ -31,7 +31,7 @@ </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>. + better. See more on <a href="https://github.com/searx/searx">github</a>. </li> </ul> @@ -49,10 +49,11 @@ 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. - + on every browser (except Chromium-based browsers*). Therefore they show up + in neither our logs, nor your url history. In the case of Chromium-based + browser users there is an exception: searx uses the search bar to perform GET + requests. + Searx can be added to your browser's search bar; moreover, it can be set as the default search engine. </p> @@ -66,8 +67,8 @@ <ul> <li><a href="https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox">Firefox</a></li> - <li><a href="https://support.microsoft.com/en-us/help/4028574/microsoft-edge-change-the-default-search-engine" >Microsoft Egde</a></li> - <li>Chrome based browsers <a href="https://www.chromium.org/tab-to-search">only add websites that the user navigates to without a path.</a> + <li><a href="https://support.microsoft.com/en-us/help/4028574/microsoft-edge-change-the-default-search-engine">Microsoft Edge</a></li> + <li>Chromium-based browsers <a href="https://www.chromium.org/tab-to-search">only add websites that the user navigates to without a path.</a> </ul> <h2>Where to find anonymous usage statistics of this instance ?</h2> @@ -80,13 +81,13 @@ <p> Searx appreciates your concern regarding logs, so take the - code from the <a href="https://github.com/asciimoo/searx">original searx project</a> and + code from the <a href="https://github.com/searx/searx">original searx project</a> and run it yourself! </p> <p> Add your searx instance to this <a href="{{ brand.PUBLIC_INSTANCES }}"> list of public searx instances</a> to help other people reclaim their privacy and - make the Internet freer! The more decentralized the Internet is, the more + make the Internet freer! The more decentralized the Internet is, the more freedom we have! </p> diff --git a/searx/templates/__common__/opensearch.xml b/searx/templates/__common__/opensearch.xml index 2763424..2476258 100644 --- a/searx/templates/__common__/opensearch.xml +++ b/searx/templates/__common__/opensearch.xml @@ -6,13 +6,17 @@ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image> <LongName>searx metasearch</LongName> {% if opensearch_method == 'get' %} - <Url rel="results" type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/> + <Url rel="results" type="text/html" method="get" template="{{ url_for('search', _external=True) }}?q={searchTerms}"/> {% else %} - <Url rel="results" type="text/html" method="post" template="{{ host }}"> + <Url rel="results" type="text/html" method="post" template="{{ url_for('search', _external=True) }}"> <Param name="q" value="{searchTerms}" /> </Url> {% endif %} {% if autocomplete %} - <Url rel="suggestions" type="application/json" template="{{ host }}autocompleter"/> + <Url rel="suggestions" type="application/x-suggestions+json" template="{{ host }}autocompleter?q={searchTerms}"/> {% endif %} + + <Url type="application/opensearchdescription+xml" + rel="self" + template="{{ opensearch_url }}" /> </OpenSearchDescription> diff --git a/searx/templates/__common__/opensearch_response_rss.xml b/searx/templates/__common__/opensearch_response_rss.xml index 3781dd8..82d3f7c 100644 --- a/searx/templates/__common__/opensearch_response_rss.xml +++ b/searx/templates/__common__/opensearch_response_rss.xml @@ -4,12 +4,12 @@ xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Searx search: {{ q|e }}</title> - <link>{{ base_url }}?q={{ q|e }}</link> + <link>{{ url_for('search', _external=True) }}?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"/> + <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ opensearch_url }}"/> <opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" /> {% if error_message %} <item> diff --git a/searx/templates/courgette/404.html b/searx/templates/courgette/404.html index 9e3b8ac..7a317f0 100644 --- a/searx/templates/courgette/404.html +++ b/searx/templates/courgette/404.html @@ -3,7 +3,7 @@ <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> + <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> {% endautoescape %} </div> {% endblock %} diff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.html index f4c61da..468b817 100644 --- a/searx/templates/courgette/base.html +++ b/searx/templates/courgette/base.html @@ -22,7 +22,7 @@ {% endblock %} {% block meta %}{% endblock %} {% block head %} - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> {% endblock %} <script type="text/javascript"> searx = {}; diff --git a/searx/templates/courgette/github_ribbon.html b/searx/templates/courgette/github_ribbon.html index bdd9cf1..fb38a20 100644 --- a/searx/templates/courgette/github_ribbon.html +++ b/searx/templates/courgette/github_ribbon.html @@ -1,3 +1,3 @@ -<a href="https://github.com/asciimoo/searx" class="github"> +<a href="https://github.com/searx/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/courgette/preferences.html b/searx/templates/courgette/preferences.html index c67f766..6480694 100644 --- a/searx/templates/courgette/preferences.html +++ b/searx/templates/courgette/preferences.html @@ -5,10 +5,13 @@ <h2>{{ _('Preferences') }}</h2> <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + {% if 'categories' not in locked_preferences %} <fieldset> <legend>{{ _('Default categories') }}</legend> {% include 'courgette/categories.html' %} </fieldset> + {% endif %} + {% if 'language' not in locked_preferences %} <fieldset> <legend>{{ _('Search language') }}</legend> <p> @@ -20,6 +23,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'locale' not in locked_preferences %} <fieldset> <legend>{{ _('Interface language') }}</legend> <p> @@ -30,6 +35,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'autocomplete' not in locked_preferences %} <fieldset> <legend>{{ _('Autocomplete') }}</legend> <p> @@ -41,6 +48,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'image_proxy' not in locked_preferences %} <fieldset> <legend>{{ _('Image proxy') }}</legend> <p> @@ -50,6 +59,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'method' not in locked_preferences %} <fieldset> <legend>{{ _('Method') }}</legend> <p> @@ -59,6 +70,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'safesearch' not in locked_preferences %} <fieldset> <legend>{{ _('SafeSearch') }}</legend> <p> @@ -69,6 +82,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'theme' not in locked_preferences %} <fieldset> <legend>{{ _('Themes') }}</legend> <p> @@ -92,6 +107,7 @@ </select> </p> </fieldset> + {% endif %} <fieldset> <legend>{{ _('Currently used search engines') }}</legend> diff --git a/searx/templates/courgette/results.html b/searx/templates/courgette/results.html index aa983e6..716ea4d 100644 --- a/searx/templates/courgette/results.html +++ b/searx/templates/courgette/results.html @@ -1,6 +1,6 @@ {% 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 meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?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"> @@ -10,12 +10,12 @@ <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 /> + <input type="text" value="{{ url_for('search', _external=True) }}?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') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="left"> <input type="hidden" name="q" value="{{ q|e }}" /> <input type="hidden" name="format" value="{{ output_type }}" /> @@ -41,7 +41,7 @@ {% if suggestions %} <div id="suggestions"><span>{{ _('Suggestions') }}</span> {% for suggestion in suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion.url }}"> <input type="submit" value="{{ suggestion.title }}" /> </form> @@ -60,7 +60,7 @@ {% if paging %} <div id="pagination"> {% if pageno > 1 %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="left"> <input type="hidden" name="q" value="{{ q|e }}" /> {% for category in selected_categories %} @@ -71,7 +71,7 @@ </div> </form> {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="left"> {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1"/> diff --git a/searx/templates/courgette/search.html b/searx/templates/courgette/search.html index fe70fde..89daead 100644 --- a/searx/templates/courgette/search.html +++ b/searx/templates/courgette/search.html @@ -1,7 +1,7 @@ -<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> +<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" id="search_form"> <div id="search_wrapper"> <input type="text" autofocus 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 +</form> diff --git a/searx/templates/legacy/404.html b/searx/templates/legacy/404.html index 3e889dd..c0fa62b 100644 --- a/searx/templates/legacy/404.html +++ b/searx/templates/legacy/404.html @@ -3,7 +3,7 @@ <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> + <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> {% endautoescape %} </div> {% endblock %} diff --git a/searx/templates/legacy/base.html b/searx/templates/legacy/base.html index 21fe42e..1e52322 100644 --- a/searx/templates/legacy/base.html +++ b/searx/templates/legacy/base.html @@ -2,7 +2,7 @@ <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="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"> @@ -17,7 +17,7 @@ {% endblock %} {% block meta %}{% endblock %} {% block head %} - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> {% endblock %} </head> <body class="{{ endpoint }}_endpoint" > diff --git a/searx/templates/legacy/github_ribbon.html b/searx/templates/legacy/github_ribbon.html index bdd9cf1..fb38a20 100644 --- a/searx/templates/legacy/github_ribbon.html +++ b/searx/templates/legacy/github_ribbon.html @@ -1,3 +1,3 @@ -<a href="https://github.com/asciimoo/searx" class="github"> +<a href="https://github.com/searx/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/infobox.html b/searx/templates/legacy/infobox.html index 4dd25fa..70f3b12 100644 --- a/searx/templates/legacy/infobox.html +++ b/searx/templates/legacy/infobox.html @@ -36,7 +36,7 @@ <div> <h3><bdi>{{ topic.name }}</bdi></h3> {% for suggestion in topic.suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion }}"> <input type="submit" value="{{ suggestion }}" /> </form> diff --git a/searx/templates/legacy/preferences.html b/searx/templates/legacy/preferences.html index 414b3f6..23b3875 100644 --- a/searx/templates/legacy/preferences.html +++ b/searx/templates/legacy/preferences.html @@ -10,6 +10,7 @@ {% set display_tooltip = false %} {% include 'legacy/categories.html' %} </fieldset> + {% if 'language' not in locked_preferences %} <fieldset> <legend>{{ _('Search language') }}</legend> <p> @@ -21,6 +22,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'locale' not in locked_preferences %} <fieldset> <legend>{{ _('Interface language') }}</legend> <p> @@ -31,6 +34,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'autocomplete' not in locked_preferences %} <fieldset> <legend>{{ _('Autocomplete') }}</legend> <p> @@ -42,6 +47,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'image_proxy' not in locked_preferences %} <fieldset> <legend>{{ _('Image proxy') }}</legend> <p> @@ -51,6 +58,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'method' not in locked_preferences %} <fieldset> <legend>{{ _('Method') }}</legend> <p> @@ -60,6 +69,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'safesearch' not in locked_preferences %} <fieldset> <legend>{{ _('SafeSearch') }}</legend> <p> @@ -70,6 +81,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'theme' not in locked_preferences %} <fieldset> <legend>{{ _('Themes') }}</legend> <p> @@ -80,6 +93,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'results_on_new_tab' not in locked_preferences %} <fieldset> <legend>{{ _('Results on new tabs') }}</legend> <p> @@ -89,6 +104,7 @@ </select> </p> </fieldset> + {% endif %} <fieldset> <legend>{{ _('Currently used search engines') }}</legend> diff --git a/searx/templates/legacy/result_templates/default.html b/searx/templates/legacy/result_templates/default.html index 13e2d29..78bf031 100644 --- a/searx/templates/legacy/result_templates/default.html +++ b/searx/templates/legacy/result_templates/default.html @@ -1,6 +1,11 @@ <div class="result {{ result.class }}{% for e in result.engines %} {{ e }}{% endfor %}"> <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> + <p class="url">{{ result.pretty_url }}‎ + {% if result.cached_url %} + <a class="cache_link" href="{{ result.cached_url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('cached') }}</a> + {% elif not result.is_onion %} + <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> + {% endif %} {% 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/results.html b/searx/templates/legacy/results.html index fd95657..efff066 100644 --- a/searx/templates/legacy/results.html +++ b/searx/templates/legacy/results.html @@ -1,6 +1,6 @@ {% 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 meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?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"> @@ -11,12 +11,12 @@ <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 /> + <input type="text" value="{{ url_for('search', _external=True) }}?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') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="left"> <input type="hidden" name="q" value="{{ q|e }}" /> <input type="hidden" name="format" value="{{ output_type }}" /> @@ -47,7 +47,7 @@ <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') }}"> + {% if not first %} • {% endif %}<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion.url }}"> <input type="submit" class="suggestion" value="{{ suggestion.title }}" /> </form> @@ -75,7 +75,7 @@ {% if paging %} <div id="pagination"> {% if pageno > 1 %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}right{% else %}left{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" /> {% for category in selected_categories %} @@ -86,7 +86,7 @@ </div> </form> {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}left{% else %}right{% endif %}"> {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1"/> diff --git a/searx/templates/legacy/search.html b/searx/templates/legacy/search.html index fcd08d6..88cf3d3 100644 --- a/searx/templates/legacy/search.html +++ b/searx/templates/legacy/search.html @@ -1,4 +1,4 @@ -<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> +<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" id="search_form"> <div id="search_wrapper"> <input type="text" autofocus 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" /> diff --git a/searx/templates/oscar/404.html b/searx/templates/oscar/404.html index 5a50880..cdb31db 100644 --- a/searx/templates/oscar/404.html +++ b/searx/templates/oscar/404.html @@ -3,7 +3,7 @@ <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> + <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> {% endautoescape %} </div> {% endblock %} diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index a3bfa52..7b3d33f 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -37,7 +37,7 @@ {% block head %} {% endblock %} - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> <noscript> <style type="text/css"> .tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;} diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html index 6ae7965..8a12b80 100644 --- a/searx/templates/oscar/infobox.html +++ b/searx/templates/oscar/infobox.html @@ -1,10 +1,18 @@ {% 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>{{- "" -}} - {% for u in infobox.urls %}{% if u.official %} <a href="{{ u.url }}">{{ u.domain }}</a>{% endif %}{% endfor %} + <div class="infobox_part"> + <div class="{% if not rtl %}pull-right{% endif %}"> + {% for engine in infobox.engines %} + <span class="label label-default">{{ engine }}</span> + {% endfor %} + </div> + <h4 class="panel-title"><bdi>{{ infobox.infobox }}</bdi></h4>{{- "" -}} + {% for u in infobox.urls %}{% if u.official %} <a class="header_url" href="{{ u.url }}">{{ u.url }}</a>{% endif %}{% endfor %} + </div> </div> - <div class="panel-body"> + <input type="checkbox" class="infobox_checkbox" id="expand_infobox_{{ infobox.engine }}" hidden> + <div class="panel-body infobox_body"> {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" />{% endif %} {% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content | safe }}</p></bdi>{% endif %} @@ -17,11 +25,7 @@ {%- if attribute.image -%} <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td> {%- else -%} - {% if attribute.label == 'Instance of' %} - <td><bdi><a href="https://wikidata.org/wiki/{{ attribute.value.id }}">{{ attribute.value.id }}</a></bdi></td> - {% else %} - <td><bdi>{{ attribute.value }}</bdi></td> - {%- endif -%} + <td><bdi>{{ attribute.value }}</bdi></td> {%- endif -%} </tr> {% endfor -%} @@ -38,4 +42,8 @@ </div> {% endif %} </div> + <label for="expand_infobox_{{ infobox.engine }}" class="infobox_toggle panel-footer"> + <span class="infobox_label_down glyphicon glyphicon-chevron-down"></span> + <span class="infobox_label_up glyphicon glyphicon-chevron-up"></span> + </label> </div> diff --git a/searx/templates/oscar/languages.html b/searx/templates/oscar/languages.html index 9c00c9c..0846caa 100644 --- a/searx/templates/oscar/languages.html +++ b/searx/templates/oscar/languages.html @@ -1,5 +1,6 @@ +{% from 'oscar/macros.html' import custom_select_class %} <label class="visually-hidden" for="language">{{ _('Language') }}</label> -<select class="language custom-select form-control" id="language" name="language" accesskey="l"> +<select class="language form-control {{ custom_select_class(rtl) }}" id="language" name="language" accesskey="l"> <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 %}> diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index 58f9669..f40eebd 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -1,6 +1,6 @@ <!-- Draw glyphicon icon from bootstrap-theme --> -{% macro icon(action) -%} - <span class="glyphicon glyphicon-{{ action }}"></span> +{% macro icon(action, alt) -%} + <span title="{{ alt }}" class="glyphicon glyphicon-{{ action }}"></span> {%- endmacro %} <!-- Draw favicon --> @@ -32,7 +32,11 @@ <span class="label label-default">{{ engine }}</span> {%- endfor -%} {%- if result.url -%} - <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% if result.cached_url %} + <small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small> + {% elif not result.is_onion %} + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% endif %} {%- endif -%} {%- if proxify -%} <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> @@ -43,6 +47,20 @@ {%- endif -%} {%- endmacro %} +<!-- Draw result footer without cache link --> +{% macro result_footer_nocache(result) -%} + <div class="clearfix"></div> + <div class="pull-right"> + {% for engine in result.engines %} + <span class="label label-default">{{ engine }}</span> + {% endfor %} + {% 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, id) -%} <div class="clearfix"></div>{{- "" -}} @@ -50,7 +68,11 @@ <span class="label label-default">{{ engine }}</span> {%- endfor %} {%- if result.url -%} - <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% if result.cached_url %} + <small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small> + {% elif not result.is_onion %} + <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% endif %} {%- endif -%} {% if proxify -%} <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> @@ -60,6 +82,18 @@ {%- endif %} {%- endmacro %} +<!-- Draw result footer without cache link --> +{% macro result_footer_nocache_rtl(result) -%} + <div class="clearfix"></div> + {% for engine in result.engines %} + <span class="label label-default">{{ engine }}</span> + {% endfor %} + {% 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, id) -%} {% if rtl %} <div class="row form-group"> @@ -84,6 +118,10 @@ {% endif %} {%- endmacro %} +{% macro custom_select_class(rtl) -%} +custom-select{% if rtl %}-rtl{% 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"> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index ab71b06..fc20b8c 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -1,4 +1,4 @@ -{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle %} +{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle, custom_select_class %} {% extends "oscar/base.html" %} {% block title %}{{ _('preferences') }} - {% endblock %} {% block content %} @@ -25,6 +25,7 @@ <div class="tab-pane active" id="tab_general"> <fieldset> <div class="container-fluid"> + {% if 'categories' not in locked_preferences %} <div class="row form-group"> {% if rtl %} <div class="col-sm-11 col-md-10"> @@ -38,92 +39,121 @@ </div> {% endif %} </div> + {% endif %} + {% if 'language' not in locked_preferences %} {% set language_label = _('Search language') %} {% set language_info = _('What language do you prefer for search?') %} {{ preferences_item_header(language_info, language_label, rtl, 'language') }} {% include 'oscar/languages.html' %} {{ preferences_item_footer(language_info, language_label, rtl) }} + {% endif %} + {% if 'locale' not in locked_preferences %} {% set locale_label = _('Interface language') %} {% set locale_info = _('Change the language of the layout') %} {{ preferences_item_header(locale_info, locale_label, rtl, 'locale') }} - <select class="form-control" name="locale" id="locale"> + <select class="form-control {{ custom_select_class(rtl)}}" name="locale" id="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) }} + {% endif %} + {% if 'autocomplete' not in locked_preferences %} {% set autocomplete_label = _('Autocomplete') %} {% set autocomplete_info = _('Find stuff as you type') %} {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl, 'autocomplete') }} - <select class="form-control" name="autocomplete" id="autocomplete"> + <select class="form-control {{ custom_select_class(rtl) }}" name="autocomplete" id="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) }} + {% endif %} + {% if 'image_proxy' not in locked_preferences %} {% 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, 'image_proxy') }} - <select class="form-control" name="image_proxy" id="image_proxy"> + <select class="form-control {{ custom_select_class(rtl) }}" name="image_proxy" id="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) }} + {% endif %} + {% if 'method' not in locked_preferences %} {% 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, 'method') }} - <select class="form-control" name="method" id="method"> + <select class="form-control {{ custom_select_class(rtl) }}" name="method" id="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) }} + {% endif %} + {% if 'safesearch' not in locked_preferences %} {% set safesearch_label = _('SafeSearch') %} {% set safesearch_info = _('Filter content') %} {{ preferences_item_header(safesearch_info, safesearch_label, rtl, 'safesearch') }} - <select class="form-control" name="safesearch" id="safesearch"> + <select class="form-control {{ custom_select_class(rtl) }}" name="safesearch" id="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) }} + {% endif %} + {% if 'theme' not in locked_preferences %} {% set theme_label = _('Themes') %} {% set theme_info = _('Change searx layout') %} {{ preferences_item_header(theme_info, theme_label, rtl, 'theme') }} - <select class="form-control" name="theme" id="theme"> + <select class="form-control {{ custom_select_class(rtl) }}" name="theme" id="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) }} + {% endif %} + {% if 'oscar-style' not in locked_preferences %} {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl, 'oscar_style') }} - <select class="form-control" name="oscar-style" id="oscar_style"> + <select class="form-control {{ custom_select_class(rtl) }}" name="oscar-style" id="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) }} + {% endif %} + {% if 'results_on_new_tab' not in locked_preferences %} {% set label = _('Results on new tabs') %} {% set info = _('Open result links on new browser tabs') %} {{ preferences_item_header(info, label, rtl, 'results_on_new_tab') }} - <select class="form-control" name="results_on_new_tab" id="results_on_new_tab"> + <select class="form-control {{ custom_select_class(rtl) }}" name="results_on_new_tab" id="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) }} + {% endif %} + {% set label = _('Show advanced settings') %} + {% set info = _('Show advanced settings panel in the home page by default') %} + {{ preferences_item_header(info, label, rtl, 'advanced_search') }} + <select class="form-control {{ custom_select_class(rtl) }}" name="advanced_search" id="advanced_search"> + <option value="1" {% if preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + {{ preferences_item_footer(info, label, rtl) }} + + {% if 'doi_resolver' not in locked_preferences %} {% 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, 'doi_resolver') }} - <select class="form-control" name="doi_resolver" id="doi_resolver"> + <select class="form-control {{ custom_select_class(rtl) }}" name="doi_resolver" id="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 }} @@ -131,6 +161,7 @@ {% endfor %} </select> {{ preferences_item_footer(info, label, rtl) }} + {% endif %} {% set label = _('Engine tokens') %} {% set info = _('Access tokens for private engines') %} @@ -199,8 +230,8 @@ <td class="onoff-checkbox"> {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} </td> - <th scope="row">{{ search_engine.name }}</th> - <td class="name">{{ shortcuts[search_engine.name] }}</td> + <th scope="row">{% if not search_engine.https_support %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %} {{ search_engine.name }}</td></th> + <td class="name">{{ shortcuts[search_engine.name] }} <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> @@ -236,6 +267,7 @@ <fieldset> <div class="container-fluid"> {% for plugin in plugins %} + {% if plugin.preference_section != 'onions' %} <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">{{ _(plugin.name) }}</h3> @@ -249,6 +281,7 @@ </div> </div> </div> + {% endif %} {% endfor %} </div> </fieldset> @@ -321,7 +354,7 @@ </p> <div class="tab-pane"> - <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 %}"> + <input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ base_url }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}"> <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> diff --git a/searx/templates/oscar/result_templates/files.html b/searx/templates/oscar/result_templates/files.html new file mode 100644 index 0000000..5e3894e --- /dev/null +++ b/searx/templates/oscar/result_templates/files.html @@ -0,0 +1,55 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer_nocache, result_footer_nocache_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') }}">
+ {% if result.mtype == 'audio' %}{{ icon('music') }}
+ {% elif result.mtype == 'video' %} {{ icon('film') }}
+ {% endif %} {{ _('show media') }}</a></small>
+{% endif %}
+
+{% if result.embedded %}
+<div id="result-media-{{ index }}" class="collapse">
+ {{ result.embedded|safe }}
+</div>
+{% endif %}
+
+{% if result.abstract %}<p class="result-content result-abstract">{{ result.abstract|safe }}</p>{% 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 %}
+
+<table class="result-metadata result-content">
+{% if result.author %}<tr><td>{{ _('Author') }}</td><td>{{ result.author|safe }}</td></tr>{% endif %}
+
+{% if result.filename %}<tr><td>{{ _('Filename') }}</td><td>{{ result.filename|safe }}</td></tr>{% endif %}
+
+{% if result.size %}<tr><td>{{ _('Filesize') }}</td><td>
+ {% if result.size < 1024 %}{{ result.size }} {{ _('Bytes') }}
+ {% elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') }}
+ {% elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') }}
+ {% elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') }}
+ {% else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
+ </td></tr>
+{% endif %}
+
+{% if result.time %}<tr><td>{{ _('Date') }}</td><td>{{ result.time|safe }}</td></tr>{% endif %}
+
+{% if result.mtype %}<tr><td>{{ _('Type') }}</td><td>{{ result.mtype|safe }}/{{ result.subtype|safe }}</td></tr>{% endif %}
+</table>
+
+{% if rtl %}
+{{ result_footer_nocache_rtl(result) }}
+{% else %}
+{{ result_footer_nocache(result) }}
+{% endif %}
diff --git a/searx/templates/oscar/result_templates/key-value.html b/searx/templates/oscar/result_templates/key-value.html index 67c748e..d5c56a1 100644 --- a/searx/templates/oscar/result_templates/key-value.html +++ b/searx/templates/oscar/result_templates/key-value.html @@ -6,7 +6,7 @@ {% continue %} {% endif %} <tr> - <td><b>{{ key|upper }}</b>: {{ value }}</td> + <td><b>{{ key|upper }}</b>: {{ value|truncate }}</td> </tr> {% endfor %} </table> diff --git a/searx/templates/oscar/result_templates/products.html b/searx/templates/oscar/result_templates/products.html new file mode 100644 index 0000000..590db0e --- /dev/null +++ b/searx/templates/oscar/result_templates/products.html @@ -0,0 +1,22 @@ +{% from 'oscar/macros.html' import draw_favicon, result_header, result_sub_header, result_footer_rtl, result_footer %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +<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-3 col-md-3 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a> + <p class="col-xs-12 col-sm-9 col-md-9 result-content"> + {% if result.price %}<big>{{ result.price|safe }}</big></br>{% endif %} + {% if result.shipping %}<small>{{ result.shipping|safe }}</small></br>{% endif %} + {% if result.source_country %}<small>{{ result.source_country|safe }}</small></br>{% endif %} + {% if result.content %}{{ result.content|safe }}{% endif %} + </p> + </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 index 7a444d1..7f60713 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -7,7 +7,7 @@ <input type="hidden" name="language" value="{{ current_language }}" />{{- "" -}} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif -%} {%- 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 -%} +{%- macro search_url() %}{{ url_for('search', _external=True) }}?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 %} @@ -42,7 +42,13 @@ </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"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item"> + {% if current_language != 'all' %} + <input type="hidden" name="language" value="{{ current_language }}"> + {% endif %} + {% if time_range %} + <input type="hidden" name="time_range" value="{{ time_range }}"> + {% endif %} <input type="hidden" name="q" value="{{ suggestion.url }}"> <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button> </form> @@ -65,7 +71,7 @@ <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"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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>{{- "" -}} @@ -83,13 +89,21 @@ {% 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.url }}">{{- "" -}} - <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>{{- "" -}} - </form> - {% endfor %} + <div class="clearfix"> + <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('search') }}" role="navigation" class="form-inline pull-left suggestion_item">{{- "" -}} + {% if current_language != 'all' %} + <input type="hidden" name="language" value="{{ current_language }}"> + {% endif %} + {% if time_range %} + <input type="hidden" name="time_range" value="{{ time_range }}"> + {% endif %} + <input type="hidden" name="q" value="{{ correction.url }}">{{- "" -}} + <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>{{- "" -}} + </form> + {% endfor %} + </div> </div> {%- endif %} @@ -126,13 +140,13 @@ {% if rtl %} <div id="pagination"> <div class="pull-left">{{- "" -}} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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>{{- "" -}} @@ -142,13 +156,13 @@ {% else %} <div id="pagination"> <div class="pull-left">{{- "" -}} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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>{{- "" -}} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index 666a4df..2b3758e 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -1,12 +1,12 @@ {% from 'oscar/macros.html' import icon %} -<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search"> +<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" 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" autofocus name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}" accesskey="s"> <span class="input-group-btn"> <button type="submit" class="btn btn-default" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> - <button type="reset" class="btn btn-default" aria-label="{{ _('Clear search') }}"><span class="hide_if_nojs">{{ icon('remove') }}</span><span class="hidden active_if_nojs">{{ _('Clear') }}</span></button> + <button type="button" id="clear_search" class="btn btn-default hide_if_nojs" aria-label="{{ _('Clear search') }}">{{ icon('remove') }}</button> </span> </div> </div> diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index 1f1c50e..d398230 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -1,6 +1,6 @@ {% from 'oscar/macros.html' import icon %} -<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search"> +<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" id="search_form" role="search"> {% if rtl %} <div class="input-group"> {% else %} diff --git a/searx/templates/oscar/time-range.html b/searx/templates/oscar/time-range.html index 181b576..6087dd4 100644 --- a/searx/templates/oscar/time-range.html +++ b/searx/templates/oscar/time-range.html @@ -1,5 +1,6 @@ +{% from 'oscar/macros.html' import custom_select_class %} <label class="visually-hidden" for="time-range">{{ _('Time range') }}</label> -<select name="time_range" id="time-range" class="custom-select form-control" accesskey="t">{{- "" -}} +<select name="time_range" id="time-range" class="{{ custom_select_class(rtl) }} form-control" accesskey="t">{{- "" -}} <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}> {{- _('Anytime') -}} </option>{{- "" -}} diff --git a/searx/templates/pix-art/preferences.html b/searx/templates/pix-art/preferences.html index 05876de..ee41543 100644 --- a/searx/templates/pix-art/preferences.html +++ b/searx/templates/pix-art/preferences.html @@ -5,6 +5,7 @@ <h2>{{ _('Preferences') }}</h2> <form method="post" action="{{ url_for('preferences') }}" id="search_form"> + {% if 'language' not in locked_preferences %} <fieldset> <legend>{{ _('Search language') }}</legend> <p> @@ -16,6 +17,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'locale' not in locked_preferences %} <fieldset> <legend>{{ _('Interface language') }}</legend> <p> @@ -26,6 +29,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'method' not in locked_preferences %} <fieldset> <legend>{{ _('Method') }}</legend> <p> @@ -35,6 +40,8 @@ </select> </p> </fieldset> + {% endif %} + {% if 'theme' not in locked_preferences %} <fieldset> <legend>{{ _('Themes') }}</legend> <p> @@ -45,6 +52,7 @@ </select> </p> </fieldset> + {% endif %} <fieldset> <legend>{{ _('Currently used search engines') }}</legend> diff --git a/searx/templates/pix-art/search.html b/searx/templates/pix-art/search.html index bb40559..210913e 100644 --- a/searx/templates/pix-art/search.html +++ b/searx/templates/pix-art/search.html @@ -1,4 +1,4 @@ -<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> +<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" id="search_form"> <div id="search_wrapper"> <input type="text" autofocus 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" /> diff --git a/searx/templates/simple/404.html b/searx/templates/simple/404.html index 11d6043..1a10514 100644 --- a/searx/templates/simple/404.html +++ b/searx/templates/simple/404.html @@ -3,7 +3,7 @@ <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> + <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> {% endautoescape %} </div> {% endblock %} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 5cb1e17..10fb424 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -2,7 +2,7 @@ <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="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"> @@ -29,7 +29,7 @@ data-no-item-found="{{ _('No item found') }}"></script> <!--<![endif]--> {% block head %} - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> {% endblock %} <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" /> </head> @@ -51,7 +51,7 @@ </main> <footer> <p> - {{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> + {{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} — {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> <a href="{{ brand.GIT_URL }}">{{ _('Source code') }}</a> | <a href="{{ brand.ISSUE_URL }}">{{ _('Issue tracker') }}</a> | <a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a> diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html index 50b5689..56c51af 100644 --- a/searx/templates/simple/infobox.html +++ b/searx/templates/simple/infobox.html @@ -1,7 +1,6 @@ <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"> @@ -34,7 +33,7 @@ <div> <h3><bdi>{{ topic.name }}</bdi></h3> {% for suggestion in topic.suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index cacbbec..1eb4266 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -1,6 +1,6 @@ <!-- Draw glyphicon icon from bootstrap-theme --> -{% macro icon(action) -%} - <span class="ion-icon-big ion-{{ action }}"></span> +{% macro icon(action, alt) -%} + <span title="{{ alt }}" class="ion-icon-big ion-{{ action }}"></span> {%- endmacro %} {% macro icon_small(action) -%} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 7437ed4..f091a97 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -1,4 +1,4 @@ -{% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} +{% from 'simple/macros.html' import icon, tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} {% extends "simple/base.html" %} @@ -30,11 +30,14 @@ {{ tabs_open() }} {{ tab_header('maintab', 'general', _('General')) }} + {% if 'categories' not in locked_preferences %} <fieldset> <legend>{{ _('Default categories') }}</legend> {% set display_tooltip = false %} {% include 'simple/categories.html' %} </fieldset> + {% endif %} + {% if 'language' not in locked_preferences %} <fieldset> <legend>{{ _('Search language') }}</legend> <p class="value">{{- '' -}} @@ -47,6 +50,8 @@ </p> <div class="description">{{ _('What language do you prefer for search?') }}</div> </fieldset> + {% endif %} + {% if 'autocomplete' not in locked_preferences %} <fieldset> <legend>{{ _('Autocomplete') }}</legend> <p class="value"> @@ -59,6 +64,8 @@ </p> <div class="description">{{ _('Find stuff as you type') }}</div> </fieldset> + {% endif %} + {% if 'safesearch' not in locked_preferences %} <fieldset> <legend>{{ _('SafeSearch') }}</legend> <p class="value"> @@ -70,7 +77,9 @@ </p> <p class="description">{{ _('Filter content') }}</p> </fieldset> + {% endif %} {{ plugin_preferences('general') }} + {% if 'doi_resolver' not in locked_preferences %} <fieldset> <legend>{{ _('Open Access DOI resolver') }}</legend> <p class="value"> @@ -84,6 +93,7 @@ </p> <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div> </fieldset> + {% endif %} {{ tab_footer() }} {{ tab_header('maintab', 'engines', _('Engines')) }} @@ -111,7 +121,7 @@ {% 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> + <th class="name">{% if not search_engine.https_support %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ 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> @@ -129,6 +139,7 @@ {{ tab_footer() }} {{ tab_header('maintab', 'ui', _('User interface')) }} + {% if 'locale' not in locked_preferences %} <fieldset> <legend>{{ _('Interface language') }}</legend> <p class="value"> @@ -140,6 +151,8 @@ </p> <div class="description">{{ _('Change the language of the layout') }}</div> </fieldset> + {% endif %} + {% if 'theme' not in locked_preferences %} <fieldset> <legend>{{ _('Themes') }}</legend> <p class="value"> @@ -151,6 +164,8 @@ </p> <div class="description">{{ _('Change searx layout') }}</div> </fieldset> + {% endif %} + {% if 'results_on_new_tab' not in locked_preferences %} <fieldset> <legend>{{ _('Results on new tabs') }}</legend> <p class="value"> @@ -161,6 +176,7 @@ </p> <div class="description">{{_('Open result links on new browser tabs') }}</div> </fieldset> + {% endif %} {{ plugin_preferences('ui') }} {{ tab_footer() }} @@ -197,6 +213,7 @@ {{ tab_footer() }} {{ tab_header('maintab', 'privacy', _('Privacy')) }} + {% if 'method' not in locked_preferences %} <fieldset> <legend>{{ _('Method') }}</legend> <p class="value"> @@ -207,6 +224,8 @@ </p> <div class="description">{{ _('Search language') }}</div> </fieldset> + {% endif %} + {% if 'image_proxy' not in locked_preferences %} <fieldset> <legend>{{ _('Image proxy') }}</legend> <p class="value"> @@ -217,6 +236,7 @@ </p> <div class="description">{{ _('Proxying image results through searx') }}</div> </fieldset> + {% endif %} {{ plugin_preferences('privacy') }} {{ tab_footer() }} diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 2e39319..936de88 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -1,7 +1,7 @@ {% 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 meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?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' %} @@ -55,7 +55,7 @@ <h4 class="title">{{ _('Suggestions') }} : </h4> <div class="wrapper"> {% for suggestion in suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion.url }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> @@ -71,13 +71,13 @@ <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 %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div> + <div class="selectable_url"><pre>{{ url_for('search', _external=True) }}?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 %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% 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') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ q|e }}"> {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1"> @@ -100,7 +100,7 @@ <h4>{{ _('Try searching for:') }}</h4> {% for correction in corrections %} <div class="left"> - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation"> <input type="hidden" name="q" value="{{ correction.url }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> @@ -133,7 +133,7 @@ {% if paging %} <nav id="pagination"> {% if pageno > 1 %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}right{% else %}left{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > {% for category in selected_categories %} @@ -149,7 +149,7 @@ </div> </form> {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}left{% else %}right{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > {% for category in selected_categories %} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 61d52db..176e790 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -1,4 +1,4 @@ -<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> +<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div id="search_wrapper"> <div class="search_box"> <input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} > |