diff --git a/searx/templates - 快捷方式.lnk b/searx/templates - 快捷方式.lnk new file mode 100644 index 000000000..59d6d4160 Binary files /dev/null and b/searx/templates - 快捷方式.lnk differ diff --git a/searx/templates/__common__/about.html b/searx/templates/__common__/about.html new file mode 100644 index 000000000..649e66163 --- /dev/null +++ b/searx/templates/__common__/about.html @@ -0,0 +1,102 @@ + +

About searx

+ +

+ Searx is a metasearch engine, + aggregating the results of other search engines + while not storing information about its users. +

+ +

More about searx...

+ + + +
+ +

Why use searx?

+ + + +

+ 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 +

+ +

Technical details - How does it work?

+ +

+ Searx is a metasearch engine, + inspired by the seeks project. + + 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 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. +

+ +

How to set as the default search engine?

+ +

+ Searx supports OpenSearch. + For more information on changing your default search engine, see your browser's documentation: +

+ + + +

Where to find anonymous usage statistics of this instance ?

+ +

+ Stats page contains some useful data about the engines used. +

+ +

How can I make it my own?

+ +

+ Searx appreciates your concern regarding logs, so take the + code from the original searx project and + run it yourself! +

+

+ Add your searx instance to this list + of public searx instances to help other people reclaim their privacy and + make the Internet freer! The more decentralized the Internet is, the more + freedom we have! +

+ +

Where are the docs & code of this instance?

+ +

+ See the {{ brand.DOCS_URL }} + and {{ brand.GIT_URL }} +

+ + +{% 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 000000000..230f327a5 --- /dev/null +++ b/searx/templates/__common__/opensearch.xml @@ -0,0 +1,22 @@ + + + {{ instance_name }} + a privacy-respecting, hackable metasearch engine + UTF-8 + {{ url_for('static', filename='img/favicon.png', _external=True) }} + searx metasearch + {% if opensearch_method == 'get' %} + + {% else %} + + + + {% endif %} + {% if autocomplete %} + + {% endif %} + + + diff --git a/searx/templates/__common__/opensearch_response_rss.xml b/searx/templates/__common__/opensearch_response_rss.xml new file mode 100644 index 000000000..82d3f7c4e --- /dev/null +++ b/searx/templates/__common__/opensearch_response_rss.xml @@ -0,0 +1,53 @@ + + + + Searx search: {{ q|e }} + {{ url_for('search', _external=True) }}?q={{ q|e }} + Search results for "{{ q|e }}" - searx + {{ number_of_results }} + 1 + {{ number_of_results }} + + diff --git a/searx/templates/oscar/404.html b/searx/templates/oscar/404.html new file mode 100644 index 000000000..cdb31db73 --- /dev/null +++ b/searx/templates/oscar/404.html @@ -0,0 +1,9 @@ +{% extends "oscar/base.html" %} +{% block content %} +
+

{{ _('Page not found') }}

+ {% autoescape false %} +

{{ _('Go to %(search_page)s.', search_page='{}'.format(url_for('index'), _('search page'))) }}

+ {% endautoescape %} +
+{% endblock %} diff --git a/searx/templates/oscar/about.html b/searx/templates/oscar/about.html new file mode 100644 index 000000000..bc7fed8e1 --- /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 000000000..0b13d50d6 --- /dev/null +++ b/searx/templates/oscar/advanced.html @@ -0,0 +1,17 @@ + + +
+ {% include 'oscar/categories.html' %} + +
+
+ {%- include 'oscar/time-range.html' -%} +
+
+ {%- include 'oscar/languages.html' -%} +
+
+
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html new file mode 100644 index 000000000..295e33d11 --- /dev/null +++ b/searx/templates/oscar/base.html @@ -0,0 +1,110 @@ +{% from 'oscar/macros.html' import icon %} + + + + + + + + + + {% block meta %}{% endblock %} + {% block title %}{% endblock %}{{ instance_name }} + + {% if preferences.get_value('oscar-style') -%} + {{' '}} + {%- else -%} + {{' '}} + {%- endif %} + + {% set templates = results|map(attribute='template')|unique|list -%} + {%- set load_leaflet = 'map.html' in templates -%} + {%- if load_leaflet -%} + {{' '}} + {%- endif %} + + {%- for css in styles %} + + {% endfor %} + + + + + {% block styles %} + {% endblock %} + {% block head %} + {% endblock %} + + + + + + {% include 'oscar/navbar.html' %} + +
+ {% if errors %} + + {% endif %} + + {% block site_alert_error %} + {% endblock %} + {% block site_alert_warning %} + {% endblock %} + {% block site_alert_info %} + {% endblock %} + {% block site_alert_success %} + {% endblock %} + + {% block content %} + {% endblock %} + +
+ + + + {% if load_leaflet %}{{" "}}{{ "\n" }}{% endif %} + {% if autocomplete %}{{" "}}{{ "\n" }}{% endif %} + + + {% for script in scripts %} + {{""}} + {% endfor %} + + + diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html new file mode 100644 index 000000000..afb389348 --- /dev/null +++ b/searx/templates/oscar/categories.html @@ -0,0 +1,17 @@ +
+{%- if rtl -%} + {% for category in categories | reverse -%} + + {{- '' -}} + + + {%- endfor %} +{%- else -%} + {% for category in categories -%} + + {{- '' -}} + + + {%- endfor %} +{%- endif -%} +
diff --git a/searx/templates/oscar/index.html b/searx/templates/oscar/index.html new file mode 100644 index 000000000..fd8625d17 --- /dev/null +++ b/searx/templates/oscar/index.html @@ -0,0 +1,21 @@ +{% extends "oscar/base.html" %} +{% block content %} +
+
{{- "" -}} +
+ {%- if cookies['oscar-style'] == 'pointhi' -%} +

searx logosearx

+ {%- else -%} + + {%- endif -%} +
{{- "" -}} +
+
+
+ {% include 'oscar/search_full.html' %} +
+
+
+{% endblock %} diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html new file mode 100644 index 000000000..8a12b8074 --- /dev/null +++ b/searx/templates/oscar/infobox.html @@ -0,0 +1,49 @@ +{% from 'oscar/macros.html' import result_link with context %} +
+
{{- "" -}} +
+
+ {% for engine in infobox.engines %} + {{ engine }} + {% endfor %} +
+

{{ infobox.infobox }}

{{- "" -}} + {% for u in infobox.urls %}{% if u.official %} {{ u.url }}{% endif %}{% endfor %} +
+
+ +
+ {% if infobox.img_src %}{% endif %} + + {% if infobox.content %}

{{ infobox.content | safe }}

{% endif %} + + {% if infobox.attributes -%} + + {% for attribute in infobox.attributes -%} + {{- "" -}} + + {%- if attribute.image -%} + + {%- else -%} + + {%- endif -%} + + {% endfor -%} +
{{ attribute.label }}{{ attribute.image.alt }}{{ attribute.value }}
+ {% endif %} + + {% if infobox.urls -%} +
{{- "\n" -}} + + {%- for url in infobox.urls -%} +

{{ result_link(url.url, url.title) }}

+ {% endfor -%} +
{{- "" -}} +
+ {% endif %} +
+ +
diff --git a/searx/templates/oscar/languages.html b/searx/templates/oscar/languages.html new file mode 100644 index 000000000..0846caa96 --- /dev/null +++ b/searx/templates/oscar/languages.html @@ -0,0 +1,10 @@ +{% from 'oscar/macros.html' import custom_select_class %} + + diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html new file mode 100644 index 000000000..06e7d4020 --- /dev/null +++ b/searx/templates/oscar/macros.html @@ -0,0 +1,152 @@ + +{% macro icon(action, alt) -%} + +{%- endmacro %} + + +{% macro draw_favicon(favicon) -%} + {{ favicon }} +{%- endmacro %} + +{%- macro result_link(url, title, classes='', id='') -%} +{{ title }} +{%- endmacro -%} + + +{% macro result_header(result, favicons, id) -%} +

{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }}{% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe, id=id) }}{% else %}{{ result.title|safe}}{% endif %}

+{%- endmacro %} + + +{% macro result_sub_header(result, id) -%} + {%- if result.publishedDate %}{% endif -%} + {%- if result.magnetlink %} • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}{% endif -%} + {%- if result.torrentfile %} • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}{% endif -%} +{%- endmacro %} + + +{% macro result_footer(result, id) -%} +
{{- "" -}} +
+ {%- for engine in result.engines -%} + {{ engine }} + {%- endfor -%} + {%- if result.url -%} + {%- if result.cached_url -%} + {{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }} + {%- elif not result.is_onion -%} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% if archive_today %} + {{ result_link("https://archive.today/" + result.url, icon('link') + _('archive'), "text-info", id) }} + {% endif %} + {%- endif -%} + {%- endif -%} + {%- if proxify -%} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} + {%- endif -%} +
+ {%- if result.pretty_url -%} + + {%- endif -%} +{%- endmacro %} + + +{% macro result_footer_nocache(result) -%} +
{{- "" -}} +
+ {%- for engine in result.engines -%} + {{ engine }} + {%- endfor -%} + {%- if proxify -%} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }} + {%- endif -%} +
{{- "" -}} + +{%- endmacro %} + + +{% macro result_footer_rtl(result, id) -%} +
+ {%- for engine in result.engines -%} + {{ engine }} + {%- endfor -%} + {%- if result.url -%} + {%- if result.cached_url -%} + {{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }} + {%- elif not result.is_onion -%} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% if archive_today %} + {{ result_link("https://archive.today/" + result.url, icon('link') + _('archive'), "text-info", id) }} + {% endif %} + {%- endif -%} + {%- endif -%} + {%- if proxify -%} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} + {%- endif -%} + {%- if result.pretty_url -%} + + {%- endif -%} +{%- endmacro %} + + +{% macro result_footer_nocache_rtl(result) -%} +
+ {%- for engine in result.engines -%} + {{ engine }} + {%- endfor -%} + {%- if proxify -%} + {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }} + {%- endif -%} + +{%- endmacro %} + +{% macro preferences_item_header(info, label, rtl, id) -%} + {%- if rtl -%} +
{{- "" -}} + {{- "" -}} + {{ info }}{{- "" -}} +
+ {%- else -%} +
{{- "" -}} + {{- "" -}} +
+ {%- endif -%} +{%- endmacro %} + +{% macro preferences_item_footer(info, label, rtl) -%} + {%- if rtl -%} +
{{- "" -}} +
+ {%- else -%} +
+ {{ info }}{{- "" -}} +
+ {%- endif -%} +{%- endmacro %} + +{% macro custom_select_class(rtl) -%} +custom-select{% if rtl %}-rtl{% endif %} +{%- endmacro %} + +{% macro checkbox_toggle(id, blocked) -%} +
{{- "" -}} + {{- "" -}} + {{- "" -}} + {{- "" -}} +
{{- "" -}} +{%- endmacro %} + +{% macro support_toggle(supports) -%} + {%- if supports -%} + + {{- _("supported") -}} + + {%- else -%} + + {{- _("not supported") -}} + + {%- 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 000000000..38db62bdf --- /dev/null +++ b/searx/templates/oscar/messages/first_time.html @@ -0,0 +1,8 @@ + diff --git a/searx/templates/oscar/messages/no_cookies.html b/searx/templates/oscar/messages/no_cookies.html new file mode 100644 index 000000000..9bebc8ad1 --- /dev/null +++ b/searx/templates/oscar/messages/no_cookies.html @@ -0,0 +1,5 @@ +{% from 'oscar/macros.html' import icon %} + 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 000000000..aee791766 --- /dev/null +++ b/searx/templates/oscar/messages/no_data_available.html @@ -0,0 +1,5 @@ +{% from 'oscar/macros.html' import icon %} + diff --git a/searx/templates/oscar/messages/no_results.html b/searx/templates/oscar/messages/no_results.html new file mode 100644 index 000000000..82bf2f77a --- /dev/null +++ b/searx/templates/oscar/messages/no_results.html @@ -0,0 +1,17 @@ +{% from 'oscar/macros.html' import icon %} +{% if unresponsive_engines %} + +{% else %} + +{% 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 000000000..63e578c70 --- /dev/null +++ b/searx/templates/oscar/messages/save_settings_successfull.html @@ -0,0 +1,9 @@ +{% from 'oscar/macros.html' import icon %} + diff --git a/searx/templates/oscar/messages/unknow_error.html b/searx/templates/oscar/messages/unknow_error.html new file mode 100644 index 000000000..3c4c9c15d --- /dev/null +++ b/searx/templates/oscar/messages/unknow_error.html @@ -0,0 +1,9 @@ +{% from 'oscar/macros.html' import icon %} + diff --git a/searx/templates/oscar/navbar.html b/searx/templates/oscar/navbar.html new file mode 100644 index 000000000..077fb9f15 --- /dev/null +++ b/searx/templates/oscar/navbar.html @@ -0,0 +1,9 @@ +
{{- "" -}} + {{- "" -}} + {{ instance_name }}{{- "" -}} + {{- "" -}} + {{- "" -}} + {{ _('about') }}{{- "" -}} + {{ _('preferences') }}{{- "" -}} + {{- "" -}} +
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html new file mode 100644 index 000000000..25d6c9cdb --- /dev/null +++ b/searx/templates/oscar/preferences.html @@ -0,0 +1,400 @@ +{% 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" %} +{% macro engine_about(search_engine, id) -%} +{% if search_engine.about is defined %} +{% set about = search_engine.about %} + +{%- endif -%} +{%- endmacro %} +{% block title %}{{ _('preferences') }} - {% endblock %} +{% block content %} + +
+ +

{{ _('Preferences') }}

+
+ + + + + + +
+
+
+
+ {% if 'categories' not in locked_preferences %} +
+ {% if rtl %} +
+ {% include 'oscar/categories.html' %} +
+ + {% else %} + +
+ {% include 'oscar/categories.html' %} +
+ {% endif %} +
+ {% 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') }} + + {{ 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') }} + + {{ 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') }} + + {{ 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 submitted, learn more about request methods') %} + {{ preferences_item_header(method_info, method_label, rtl, 'method') }} + + {{ 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') }} + + {{ 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') }} + + {{ 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') }} + + {{ 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') }} + + {{ preferences_item_footer(info, label, rtl) }} + {% endif %} + + {% if 'autofocus' not in locked_preferences %} + {% set label = _('Autofocus search field') %} + {% set info = _('Turn off if you use your keyboard to scroll') %} + {{ preferences_item_header(info, label, rtl, 'autofocus') }} + + {{ preferences_item_footer(info, label, rtl) }} + {% endif %} + + {% if 'archive_today' not in locked_preferences %} + {% set label = _('Show archive.today links') %} + {% set info = _('Alternative link cache service') %} + {{ preferences_item_header(info, label, rtl, 'archive_today') }} + + {{ 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') }} + + {{ 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') }} + + {{ preferences_item_footer(info, label, rtl) }} + {% endif %} + + {% set label = _('Engine tokens') %} + {% set info = _('Access tokens for private engines') %} + {{ preferences_item_header(info, label, rtl, 'tokens') }} + + {{ preferences_item_footer(info, label, rtl) }} +
+
+
+
+ + + + + + + +
+ +
+

+ + +

+
+ + {% for categ in all_categories %} + +
+
+
+
+ + + {% if not rtl %} + + + + + + + + + {% else %} + + + + + + + + + {% endif %} + + {% for search_engine in engines_by_category[categ] %} + {% if not search_engine.private %} + + {% if not rtl %} + + + + + + + + + {% else %} + + + + + + + + + {% endif %} + + {% endif %} + {% endfor %} +
{{ _("Allow") }}{{ _("Engine name") }}{{ _("Shortcut") }}{{ _("Selected language") }}{{ _("SafeSearch") }}{{ _("Time range") }}{{ _("Avg. time") }}{{ _("Max time") }}{{ _("Max time") }}{{ _("Avg. time") }}{{ _("Time range") }}{{ _("SafeSearch") }}{{ _("Selected language") }}{{ _("Shortcut") }}{{ _("Engine name") }}{{ _("Allow") }}
+ {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}} + + {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%} + {{- search_engine.name -}} + {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}} + {{ shortcuts[search_engine.name] }}{{ support_toggle(stats[search_engine.name].supports_selected_language) }}{{ support_toggle(search_engine.safesearch==True) }}{{ support_toggle(search_engine.time_range_support==True) }}{% if stats[search_engine.name]['warn_time'] %}{{ icon('exclamation-sign')}} {% endif %}{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}{{ support_toggle(search_engine.time_range_support==True) }}{{ support_toggle(search_engine.safesearch==True) }}{{ support_toggle(stats[search_engine.name].supports_selected_language) }}{{ shortcuts[search_engine.name] }}{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}{{ engine_about(search_engine) }} + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} +
+
+
+
+
+ {% endfor %} +
+
+
+ +
+
+ {% for plugin in plugins %} + {% if plugin.preference_section != 'onions' %} +
+
+

{{ _(plugin.name) }}

+
+
+
+
+
+ {{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }} +
+
+
+
+ {% endif %} + {% endfor %} +
+
+
+ + {% if answerers %} +
+ +

+ {{ _('This is the list of searx\'s instant answering modules.') }} +

+ + + {{ _('Name') }} + {{ _('Keywords') }} + {{ _('Description') }} + {{ _('Examples') }} + + + {% for answerer in answerers %} + + + + + + + {% endfor %} +
{{ answerer.info.name }}{{ answerer.keywords|join(', ') }}{{ answerer.info.description }}{{ answerer.info.examples|join(', ') }}
+
+ {% endif %} + +
+ +

+ {{ _('This is the list of cookies and their values searx is storing on your computer.') }}
+ {{ _('With that list, you can assess searx transparency.') }}
+

+ {% if cookies %} + + + + + + + {% for cookie in cookies %} + + + + + {% endfor %} +
{{ _('Cookie name') }}{{ _('Value') }}
{{ cookie }}{{ cookies[cookie] }}
+ {% else %} + {% include 'oscar/messages/no_cookies.html' %} + {% endif %} +
+
+ +

+ {{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }} + {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} +

+ +

+ {{ _('Search URL of the currently saved preferences') }} + ({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}): +

+ + +
+
+{% endblock %} diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html new file mode 100644 index 000000000..c7d93e2b3 --- /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 with context%} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if result.content %}

{{ result.content|safe }}

{% endif %} + +{% if result.repository %}

{{ icon('file') }} {{ result.repository }}

{% endif %} + +
+{{ result.codelines|code_highlighter(result.code_language)|safe }} +
+ +{% 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 000000000..53cfee5cb --- /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, loop.index) -}} +{{- result_sub_header(result, loop.index) -}} + +{%- if result.embedded -%} + +{%- endif -%} + +{%- if result.embedded -%} +
+ {{- result.embedded|safe -}} +
+{%- endif -%} + +{%- if result.img_src or result.thumbnail -%} +
{{- "" -}} +
{{- "" -}} + + {%- if result.content %}

{{ result.content|safe }}

{% endif -%} +
{{- "" -}} +
+{%- else -%} +{%- if result.content %}

{{ result.content|safe }}

{% endif -%} +{%- endif -%} + +{%- if rtl -%} +{{ result_footer_rtl(result, loop.index) }} +{%- else -%} +{{ result_footer(result, loop.index) }} +{%- endif -%} diff --git a/searx/templates/oscar/result_templates/files.html b/searx/templates/oscar/result_templates/files.html new file mode 100644 index 000000000..e2fec6f63 --- /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 -%} + +{%- endif -%} + +{%- if result.embedded -%} +
+ {{- result.embedded|safe -}} +
+{%- endif -%} + +{%- if result.abstract %}

{{ result.abstract|safe }}

{% endif -%} + +{%- if result.img_src -%} +
+
+{{ result.title|striptags }} +{%- if result.content %}

{{ result.content|safe }}

{% endif -%} +
+
+{%- else -%} +{%- if result.content %}

{{ result.content|safe }}

{% endif -%} +{%- endif -%} + + +{%- if result.author %}{% endif -%} + +{%- if result.filename %}{% endif -%} + +{%- if result.size %} +{%- endif -%} + +{%- if result.time %}{% endif -%} + +{%- if result.mtype %}{% endif -%} +
{{ _('Author') }}{{ result.author|safe }}
{{ _('Filename') }}{{ result.filename|safe }}
{{ _('Filesize') }} + {%- 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 -%} +
{{ _('Date') }}{{ result.time|safe }}
{{ _('Type') }}{{ result.mtype|safe }}/{{ result.subtype|safe }}
+ +{%- if rtl -%} +{{ result_footer_nocache_rtl(result) }} +{%- else -%} +{{ result_footer_nocache(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 000000000..96cdd53bb --- /dev/null +++ b/searx/templates/oscar/result_templates/images.html @@ -0,0 +1,36 @@ +{%- from 'oscar/macros.html' import draw_favicon with context -%} + +{{- "" -}} + {{ result.title|striptags }}{{- "" -}} + +{{- "" -}} diff --git a/searx/templates/oscar/result_templates/key-value.html b/searx/templates/oscar/result_templates/key-value.html new file mode 100644 index 000000000..9d75682d4 --- /dev/null +++ b/searx/templates/oscar/result_templates/key-value.html @@ -0,0 +1,19 @@ +{% from 'oscar/macros.html' import result_footer, result_footer_rtl with context %} +
+ + {% for key, value in result.items() %} + {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions', 'pretty_url', 'parsed_url'] %} + {% continue %} + {% endif %} + + + + {% endfor %} +
{{ key|upper }}: {{ value|truncate }}
+ +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} +
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html new file mode 100644 index 000000000..eb3fccfc0 --- /dev/null +++ b/searx/templates/oscar/result_templates/map.html @@ -0,0 +1,76 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{- result_header(result, favicons, loop.index) -}} +{{- result_sub_header(result, loop.index) -}} + +
+ +
+ {%- if result.img_src -%}{%- endif -%} + + {%- if result.type_icon or result.type -%} +

+ {%- if result.type_icon -%} + + {%- endif -%} + {{ result.type if result.type is not none else '' }} +

+ {%- endif -%} + + {%- if result.content %}

{{ result.content|safe }}

{% endif -%} + + + {%- if result.address -%} + + + + + {%- endif %} + {%- for info in result.data -%} + + {%- endfor -%} + {%- for link in result.links -%} + + {%- endfor -%} +
+ {{ result.address_label or _('address') }} + + {%- if result.address.name -%} + + {%- endif -%} + {%- if result.address.road -%} + + {%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%} + {{- result.address.road -}} +
+ {%- endif -%} + {%- if result.address.locality -%} + {{ result.address.locality }} + {%- if result.address.postcode %}, {{ result.address.postcode }}{% endif -%} +
+ {%- endif -%} + {%- if result.address.country -%} + {{ result.address.country }} + {%- endif -%} +
{{ info.label }}{{ info.value|safe }}
{{ link.label }}{{ link.url_label|safe }}
+ +

+ {%- if (result.latitude and result.longitude) or result.boundingbox -%} + + {%- endif -%} +

+ +
+ +{%- if (result.latitude and result.longitude) or result.boundingbox -%} +
+
+
+{%- endif -%} + +
+{%- if rtl -%} +{{- result_footer_rtl(result, loop.index) -}} +{% else %} +{{- result_footer(result, loop.index) -}} +{%- endif -%} diff --git a/searx/templates/oscar/result_templates/products.html b/searx/templates/oscar/result_templates/products.html new file mode 100644 index 000000000..149e3c903 --- /dev/null +++ b/searx/templates/oscar/result_templates/products.html @@ -0,0 +1,23 @@ +{% from 'oscar/macros.html' import draw_favicon, icon, result_header, result_sub_header, result_footer_rtl, result_footer %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +
+
+ {{ result.title|striptags }} {{ result.engine }} +

+ {% if result.price %}{{ result.price|safe }}
{% endif %} + {% if result.shipping %}{{ result.shipping|safe }}
{% endif %} + {% if result.source_country %}{{ result.source_country|safe }}
{% endif %} + {% if result.content %}{{ result.content|safe }}{% endif %} + {% if result.has_stock is defined %}
{% if result.has_stock %}{{ icon('check', _('Has stock')) }}{% else %}{{ icon('alert', _('Out of stock')) }}{% endif %}{% 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 000000000..9f6671549 --- /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, loop.index) -}} +{{- result_sub_header(result, loop.index) -}} + +{%- if result.seed is defined %}

{{ icon('transfer') }} {{ _('Seeder') }} {{ result.seed }} • {{ _('Leecher') }} {{ result.leech }}{% endif -%} +{%- if result.filesize %}
{{ icon('floppy-disk') }} {{ _('Filesize') -}} + + {%- 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 -%} + {% endif -%} +{%- if result.files %}
{{ icon('file') }} {{ _('Number of Files') }} {{ result.files }}{% endif -%} + +{%- if result.content %}
{{ result.content|safe }}{% endif -%} + +

+ +{%- if rtl -%} +{{ result_footer_rtl(result, loop.index) }} +{%- else -%} +{{ result_footer(result, loop.index) }} +{%- endif -%} diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html new file mode 100644 index 000000000..ad17ffe33 --- /dev/null +++ b/searx/templates/oscar/result_templates/videos.html @@ -0,0 +1,29 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{- result_header(result, favicons, loop.index) -}} +{{- result_sub_header(result, loop.index) -}} + +{%- if result.embedded -%} + +{%- endif -%} + +{%- if result.embedded -%} +
+ {{- result.embedded|safe -}} +
+{%- endif -%} + +
{{- "" -}} +
{{- "" -}} + + {%- if result.author %}

{{ _('Author') }}: {{ result.author }}

{% endif -%} + {%- if result.length %}

{{ _('Length') }}: {{ result.length }}

{% endif -%} + {%- if result.content %}

{{ result.content|safe }}

{% endif -%} +
{{- "" -}} +
+ +{%- if rtl -%} +{{ result_footer_rtl(result, loop.index) }} +{%- else -%} +{{ result_footer(result, loop.index) }} +{%- endif -%} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html new file mode 100644 index 000000000..df2d42430 --- /dev/null +++ b/searx/templates/oscar/results.html @@ -0,0 +1,187 @@ +{% extends "oscar/base.html" %} +{% macro search_form_attrs(pageno) -%} + {%- for category in selected_categories -%}{%- endfor -%} + {{- "" -}} + {{- "" -}} + {{- "" -}} + {{- "" -}} + {% if timeout_limit %}{% endif -%} +{%- endmacro %} +{% macro engine_data_form(engine_data) -%} + {% for engine_name, kv_data in engine_data.items() %} + {% for k, v in kv_data.items() %} + + {% endfor %} + {% endfor %} +{%- 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 %}{{" "}}{% endblock %} +{% block content %} + {% include 'oscar/search.html' %} + +
+ + +
+

{{ _('Search results') }}

+ + {% if corrections -%} +
+
+ {{ _('Try searching for:') }} + {% for correction in corrections -%} + + {% endfor %} +
+
+ {%- endif %} + + {% if answers -%} + {%- for answer in answers.values() %} +
+ {% if answer.url %} + {{ answer.answer }} + {% else %} + {{ answer.answer }} + {% endif %} +
+ {%- endfor %} + {%- endif %} + + {% for result in results -%} +
+ {%- set index = loop.index -%} + {%- if result.template -%} + {% include get_result_template('oscar', result['template']) %} + {%- else -%} + {% include 'oscar/result_templates/default.html' %} + {%- endif -%} +
+ {% endfor %} + + {% if not results and not answers -%} + {% include 'oscar/messages/no_results.html' %} + {% endif %} + +
+ + {% if paging -%} + {% if rtl %} + +
+ {% else %} + +
+ {% endif %} + {% endif %} +
+
+{% endblock %} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html new file mode 100644 index 000000000..841e48efc --- /dev/null +++ b/searx/templates/oscar/search.html @@ -0,0 +1,25 @@ +{% from 'oscar/macros.html' import icon %} + diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html new file mode 100644 index 000000000..d3982304d --- /dev/null +++ b/searx/templates/oscar/search_full.html @@ -0,0 +1,19 @@ +{% from 'oscar/macros.html' import icon %} + +