diff options
| author | Paul Braeuning <paul@paulgo.io> | 2022-05-03 18:47:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-03 18:47:35 +0200 |
| commit | 31521f3a465fa2beb7e3fd7ed47621262a28f554 (patch) | |
| tree | a9a896b08d98b0ddcaf65b2159c34326c77bf80b /searx/templates | |
| parent | 8a79eb4d7b0265afc200ecf6c1d729274a065b18 (diff) | |
| parent | c3bb6c7059388308aa9843943ce2491856ef1596 (diff) | |
Merge pull request #1153 from return42/drop-oscar
[theme] peel out oscar from SearXNG development
Diffstat (limited to 'searx/templates')
32 files changed, 2 insertions, 1695 deletions
diff --git a/searx/templates/oscar/404.html b/searx/templates/oscar/404.html deleted file mode 100644 index cdb31db73..000000000 --- a/searx/templates/oscar/404.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "oscar/base.html" %} -{% block content %} -<div class="text-center"> - <h1>{{ _('Page not found') }}</h1> - {% autoescape false %} - <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> - {% endautoescape %} -</div> -{% endblock %} diff --git a/searx/templates/oscar/advanced.html b/searx/templates/oscar/advanced.html deleted file mode 100644 index 0b13d50d6..000000000 --- a/searx/templates/oscar/advanced.html +++ /dev/null @@ -1,17 +0,0 @@ -<input type="checkbox" name="advanced_search" class="visually-hidden" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}> -<label for="check-advanced">{{- "" -}} - <span class="glyphicon glyphicon-cog"></span> - {{- _('Advanced settings') -}} -</label> -<div id="advanced-search-container"> - {% include 'oscar/categories.html' %} - - <div class="row"> - <div class="col-xs-6"> - {%- include 'oscar/time-range.html' -%} - </div> - <div class="col-xs-6"> - {%- include 'oscar/languages.html' -%} - </div> - </div> -</div> diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html deleted file mode 100644 index dbc0699df..000000000 --- a/searx/templates/oscar/base.html +++ /dev/null @@ -1,114 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -<!DOCTYPE html> -<html lang="{{ locale_rfc5646 }}" xml:lang="{{ locale_rfc5646 }}"{% if rtl %} dir="rtl"{% endif %} class="nojs"> -<head> - <meta charset="UTF-8" /> - <meta name="description" content="SearXNG - a privacy-respecting, hackable metasearch engine" /> - <meta name="keywords" content="SearXNG, search, search engine, metasearch, meta search" /> - <meta name="generator" content="SearXNG/{{ searx_version }}"> - <meta name="referrer" content="no-referrer"> - <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=2.0, user-scalable=1" /> - {% block meta %}{% endblock %} - <title>{% block title %}{% endblock %}{{ instance_name }}</title> - <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" /> - {% if preferences.get_value('oscar-style') -%} - {{' '}}<link rel="stylesheet" href="{{ url_for('static', filename='css/'+preferences.get_value('oscar-style')+'.min.css') }}" type="text/css" /> - {%- else -%} - {{' '}}<link rel="stylesheet" href="{{ url_for('static', filename='css/logicodev.min.css') }}" type="text/css" /> - {%- endif %} - - {% set templates = results|map(attribute='template')|unique|list -%} - {%- set load_leaflet = 'map.html' in templates -%} - {%- if load_leaflet -%} - {{' '}}<link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.min.css') }}" type="text/css" /> - {%- endif %} - - {%- for css in styles %} - <link rel="stylesheet" href="{{ url_for('static', filename=css) }}" type="text/css" /> - {% endfor %} - - <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" /> - - {% block styles %} - {% endblock %} - {% block head %} - {% endblock %} - - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> - <noscript> - <style type="text/css"> - .tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;} - .margin_top_if_nojs {margin-top: 20px;} - .hide_if_nojs {display: none !important;overflow: hidden !important;} - .disabled_if_nojs {pointer-events: none; cursor: default; text-decoration: line-through;} - </style> - </noscript> -</head> -<body class="{{ endpoint }}_endpoint" > - {% include 'oscar/navbar.html' %} - - <div class="container"> - {% if errors %} - <div class="alert alert-danger fade in" role="alert"> - <button class="close" data-dismiss="alert" type="button"> - <span aria-hidden="true">×</span> - <span class="sr-only">{{ _('Close') }}</span> - </button> - <strong class="lead">{{ icon('info-sign') }} {{ _('Error!') }}</strong> - <ul> - {% for message in errors %} - <li>{{ message }}</li> - {% endfor %} - </ul> - </div> - {% endif %} - - {% block site_alert_error %} - {% endblock %} - {% block site_alert_warning %} - {% endblock %} - {% block site_alert_info %} - {% endblock %} - {% block site_alert_success %} - {% endblock %} - - {% block content %} - {% endblock %} - - </div> - <div class="footer"> - <div class="container"> - {% block footer %} - {% endblock %} - <p class="text-muted"> - <small> - {{ _('Powered by') }} <a href="{{ get_setting('brand.docs_url') }}">SearXNG</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> - <a href="{{ searx_git_url }}">{{ _('Source code') }}</a> | - <a href="{{ get_setting('brand.issue_url') }}">{{ _('Issue tracker') }}</a> | - <a href="{{ url_for('stats') }}">{{ _('Engine stats') }}</a> | - <a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a>{% if get_setting('general.contact_url') %} | - <a href="{{ get_setting('general.contact_url') }}">{{ _('Contact instance maintainer') }}</a>{% endif %} - </small> - </p> - </div> - </div> - <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script> - <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> - {% if load_leaflet %}{{" "}}<script src="{{ url_for('static', filename='js/leaflet.js') }}"></script>{{ "\n" }}{% endif %} - {% if autocomplete %}{{" "}}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{{ "\n" }}{% endif %} - - <script src="{{ url_for('static', filename='js/searxng.min.js') }}" - data-method="{{ method or 'POST' }}" - data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}" - data-infinite-scroll="{% if infinite_scroll %}true{% else %}false{% endif %}" - data-translations="{{ translations }}"></script> - {% for script in scripts %} - {{""}}<script src="{{ url_for('static', filename=script) }}"></script> - {% endfor %} - <noscript> - <style> - .glyphicon { display: none; } - </style> - </noscript> -</body> -</html> diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html deleted file mode 100644 index 39d1e1d33..000000000 --- a/searx/templates/oscar/categories.html +++ /dev/null @@ -1,13 +0,0 @@ -<div id="categories"> -{%- if rtl -%} - {% for category in categories_as_tabs | reverse -%} - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{- '' -}} - <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> - {%- endfor %} -{%- else -%} - {% for category in categories_as_tabs -%} - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{- '' -}} - <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> - {%- endfor %} -{%- endif -%} -</div> diff --git a/searx/templates/oscar/index.html b/searx/templates/oscar/index.html deleted file mode 100644 index 0e7e7863a..000000000 --- a/searx/templates/oscar/index.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "oscar/base.html" %} -{% block content %} -<div class="container-fluid"> - <div class="row">{{- "" -}} - <div class="text-center col-sm-12 col-md-12"> - {%- if cookies['oscar-style'] == 'pointhi' -%} - <h1 class="text-hide center-block"><img class="center-block img-responsive" src="{{ url_for('static', filename='img/searxng.svg') }}" alt="searx logo"/>SearXNG</h1> - {%- else -%} - <div class="text-hide center-block" id="main-logo">{{- "" -}} - <img class="center-block img-responsive" src="{{ url_for('static', filename='img/searxng.svg') }}" alt="searx logo" />SearXNG{{- "" -}} - </div> - {%- endif -%} - </div>{{- "" -}} - </div> - <div class="row"> - <div class="text-center col-sm-12 col-md-12"> - {% include 'oscar/search_full.html' %} - </div> - </div> -</div> -{% endblock %} diff --git a/searx/templates/oscar/info.html b/searx/templates/oscar/info.html deleted file mode 100644 index c12446a08..000000000 --- a/searx/templates/oscar/info.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "oscar/base.html" %} -{% block title %}{{ active_page.title }} - {% endblock %} -{% block content %} -<ul class="nav nav-tabs"> - {% for pagename, locale, page in all_pages %} - <li> - <a href="{{ url_for('info', pagename=pagename, locale=locale) }}" {% if pagename == active_pagename %}class="active"{% endif %}>{{page.title}}</a> - </li> -{% endfor %} -</ul> -{{ active_page.html | safe }} -{% endblock %} diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html deleted file mode 100644 index 8a12b8074..000000000 --- a/searx/templates/oscar/infobox.html +++ /dev/null @@ -1,49 +0,0 @@ -{% from 'oscar/macros.html' import result_link with context %} -<div class="panel panel-default infobox"> - <div class="panel-heading">{{- "" -}} - <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> - <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 %} - - {% if infobox.attributes -%} - <table class="table table-striped infobox_part"> - {% for attribute in infobox.attributes -%} - <tr>{{- "" -}} - <td><bdi>{{ attribute.label }}</bdi></td> - {%- if attribute.image -%} - <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td> - {%- else -%} - <td><bdi>{{ attribute.value }}</bdi></td> - {%- endif -%} - </tr> - {% endfor -%} - </table> - {% endif %} - - {% if infobox.urls -%} - <div class="infobox_part">{{- "\n" -}} - <bdi> - {%- for url in infobox.urls -%} - <p class="btn btn-default btn-xs">{{ result_link(url.url, url.title) }}</p> - {% endfor -%} - </bdi>{{- "" -}} - </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 deleted file mode 100644 index c0ecb440e..000000000 --- a/searx/templates/oscar/languages.html +++ /dev/null @@ -1,10 +0,0 @@ -{% from 'oscar/macros.html' import custom_select_class %} -<label class="visually-hidden" for="language">{{ _('Language') }}</label> -<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,flag in language_codes | sort(attribute=1) -%} - <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}> - {{- lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id -}} - </option> -{%- endfor -%} -</select> diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html deleted file mode 100644 index 2b27cfd28..000000000 --- a/searx/templates/oscar/macros.html +++ /dev/null @@ -1,145 +0,0 @@ -<!-- Draw glyphicon icon from bootstrap-theme --> -{% macro icon(action, alt) -%} - <span title="{{ alt }}" class="glyphicon glyphicon-{{ action }}"></span> -{%- endmacro %} - -<!-- Draw favicon --> -{% macro draw_favicon(favicon) -%} - <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" /> -{%- endmacro %} - -{%- macro result_link(url, title, classes='', id='') -%} -<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}{% if id %} aria-labelledby="result-{{id}}"{%endif%}>{{ title }}</a> -{%- endmacro -%} - -<!-- Draw result header --> -{% macro result_header(result, favicons, id) -%} -<h4 class="result_header" id="result-{{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 %}</h4> -{%- endmacro %} - -<!-- Draw result sub header --> -{% macro result_sub_header(result, id) -%} - {%- if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%} - {%- if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif -%} - {%- if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif -%} - {%- if result.metadata %} <div class="highlight">{{ result.metadata|safe }}</div>{% endif -%} -{%- endmacro %} - -<!-- Draw result footer --> -{% macro result_footer(result, id) -%} - <div class="clearfix"></div>{{- "" -}} - <div class="pull-right"> - {%- for engine in result.engines -%} - <span class="label label-default">{{ engine }}</span> - {%- endfor -%} - {%- if result.url -%} - {%- 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 and proxify_results -%} - <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> - {%- endif -%} - </div> - {%- if result.pretty_url -%} - <div class="external-link">{{ result.pretty_url }}</div> - {%- 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 and proxify_results -%} - <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> - {%- for engine in result.engines -%} - <span class="label label-default">{{ engine }}</span> - {%- endfor -%} - {%- if result.url -%} - {%- 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 and proxify_results -%} - <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small> - {%- endif -%} - {%- if result.pretty_url -%} - <div class="external-link">{{ result.pretty_url }}</div> - {%- 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 and proxify_results -%} - <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">{{- "" -}} - <label class="col-sm-3 col-md-2 pull-right"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}} - <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>{{- "" -}} - <div class="col-sm-4 col-md-4"> - {%- else -%} - <div class="row form-group">{{- "" -}} - <label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}} - <div class="col-sm-4 col-md-4"> - {%- endif -%} -{%- endmacro %} - -{% macro preferences_item_footer(info, label, rtl) -%} - {%- if rtl -%} - </div>{{- "" -}} - </div> - {%- else -%} - </div> - <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>{{- "" -}} - </div> - {%- endif -%} -{%- endmacro %} - -{% macro 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">{{- "" -}} - <label class="onoffswitch-label" for="{{ id }}">{{- "" -}} - <span class="onoffswitch-inner"></span>{{- "" -}} - <span class="onoffswitch-switch"></span>{{- "" -}} - </label>{{- "" -}} - <label class="visually-hidden" for="{{ id }}">{{ _('Allow') }}</label>{{- "" -}} - </div>{{- "" -}} -{%- endmacro %} - -{% macro support_toggle(supports) -%} - {%- if supports == '?' -%} - <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" title="{{- _('broken') -}}"></span>{{- "" -}} - {%- elif supports -%} - <span class="glyphicon glyphicon-ok" aria-hidden="true" title="{{- _('supported') -}}"></span>{{- "" -}} - {%- else -%} - <span aria-hidden="true" title="{{- _('not supported') -}}"></span>{{- "" -}} - {%- endif -%} -{%- endmacro %} diff --git a/searx/templates/oscar/messages/first_time.html b/searx/templates/oscar/messages/first_time.html deleted file mode 100644 index 8b29d7020..000000000 --- a/searx/templates/oscar/messages/first_time.html +++ /dev/null @@ -1,8 +0,0 @@ -<div class="alert alert-info fade in" role="alert"> - <button class="close" data-dismiss="alert" type="button"> - <span aria-hidden="true">×</span> - <span class="sr-only">{{ _('Close') }}</span> - </button> - <strong class="lead">{{ icon('info-sign') }} {{ _('Heads up!') }}</strong> - {{ _('It look like you are using SearXNG first time.') }} -</div> diff --git a/searx/templates/oscar/messages/no_data_available.html b/searx/templates/oscar/messages/no_data_available.html deleted file mode 100644 index aee791766..000000000 --- a/searx/templates/oscar/messages/no_data_available.html +++ /dev/null @@ -1,5 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -<div class="alert alert-info fade in" role="alert"> - <strong class="lead">{{ icon('info-sign') }} {{ _('Heads up!') }}</strong> - {{ _('There is currently no data available. ') }} -</div> diff --git a/searx/templates/oscar/messages/no_results.html b/searx/templates/oscar/messages/no_results.html deleted file mode 100644 index 16026daad..000000000 --- a/searx/templates/oscar/messages/no_results.html +++ /dev/null @@ -1,20 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -{% if unresponsive_engines %} -<div class="alert alert-danger fade in" role="alert"> - <p><strong class="lead">{{ icon('remove-sign') }} {{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p> - {%- for engine_name, error_type in unresponsive_engines -%} - <p> - {{- engine_name }} ( - <a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}"> - {{- error_type -}} - </a> ){{- '' -}} - </p> - {%- endfor -%} - <p><small>{{ _('Please, try again later or find another SearXNG instance.') }} (<a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a>)</small></p> -</div> -{% else %} -<div class="alert alert-info fade in" role="alert"> - <strong class="lead">{{ icon('info-sign') }} {{ _('Sorry!') }}</strong> - {{ _("we didn't find any results. Please use another query or search in more categories.") }} -</div> -{% endif %} diff --git a/searx/templates/oscar/messages/save_settings_successfull.html b/searx/templates/oscar/messages/save_settings_successfull.html deleted file mode 100644 index 63e578c70..000000000 --- a/searx/templates/oscar/messages/save_settings_successfull.html +++ /dev/null @@ -1,9 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -<div class="alert alert-success fade in" role="alert"> - <button class="close" data-dismiss="alert" type="button"> - <span aria-hidden="true">×</span> - <span class="sr-only">{{ _('Close') }}</span> - </button> - <strong class="lead">{{ icon('ok-sign') }} {{ _('Well done!') }}</strong> - {{ _('Settings saved successfully.') }} -</div> diff --git a/searx/templates/oscar/messages/unknow_error.html b/searx/templates/oscar/messages/unknow_error.html deleted file mode 100644 index 3c4c9c15d..000000000 --- a/searx/templates/oscar/messages/unknow_error.html +++ /dev/null @@ -1,9 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -<div class="alert alert-danger fade in" role="alert"> - <button class="close" data-dismiss="alert" type="button"> - <span aria-hidden="true">×</span> - <span class="sr-only">{{ _('Close') }}</span> - </button> - <strong class="lead">{{ icon('exclamation-sign') }} {{ _('Oh snap!') }}</strong> - {{ _('Something went wrong.') }} -</div> diff --git a/searx/templates/oscar/navbar.html b/searx/templates/oscar/navbar.html deleted file mode 100644 index f5401c382..000000000 --- a/searx/templates/oscar/navbar.html +++ /dev/null @@ -1,9 +0,0 @@ -<div class="searxng-navbar">{{- "" -}} - <span class="instance {% if rtl %}pull-right{% else %}pull-left{% endif%}">{{- "" -}} - <a href="{{ url_for('index') }}">{{ instance_name }}</a>{{- "" -}} - </span>{{- "" -}} - <span class="{% if rtl %}pull-left{% else %}pull-right{% endif %}">{{- "" -}} - <a href="{{ url_for('info', pagename='about') }}">{{ _('about') }}</a>{{- "" -}} - <a href="{{ url_for('preferences') }}">{{ _('preferences') }}</a>{{- "" -}} - </span>{{- "" -}} -</div> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html deleted file mode 100644 index 1a5219b07..000000000 --- a/searx/templates/oscar/preferences.html +++ /dev/null @@ -1,509 +0,0 @@ -{% 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 or stats[search_engine.name]['result_count'] > 0 %} -{% set about = search_engine.about %} -<div class="engine-tooltip" role="tooltip" id="{{ id }}">{{- "" -}} - <p class="description"></p> - {% if search_engine.about is defined %} - <h5><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></h5> - {%- if about.wikidata_id -%}<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>{%- endif -%} - {% endif %} - {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%} - {%- if stats[search_engine.name]['result_count'] -%} - <p>{{ _('Number of results') }}: {{ stats[search_engine.name]['result_count'] }} ( {{ _('Avg.') }} )</p>{{- "" -}} - {%- endif -%} - {%- if reliabilities.get(search_engine.name, {}).errors or reliabilities.get(search_engine.name, {}).checker -%} - <a href="{{ url_for('stats', engine=search_engine.name|e) }}" title="{{ _('View error logs and submit a bug report') }}"> - {{ _('View error logs and submit a bug report') }} - </a> - {%- endif -%} -</div> -{%- endif -%} -{%- endmacro %} - -{%- macro engine_time(engine_name, css_align_class) -%} -<td class="{{ label }}">{{- "" -}} - {%- if stats[engine_name].time != None -%} - <span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}} - <span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true"> - {%- if max_rate95 is not none and max_rate95 > 0 -%} - <div class="stacked-bar-chart-median bar{{ (100 * (stats[engine_name].time / max_rate95))|round }}"></div>{{- "" -}} - <div class="stacked-bar-chart-rate80 bar{{ (100 * ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95))|round }}"></div>{{- "" -}} - <div class="stacked-bar-chart-rate95 bar{{ (100 * ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95))|round }}"></div>{{- "" -}} - <span class="stacked-bar-chart-rate100"></span> - {%- endif -%} - </span>{{- "" -}} - <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}} - <p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}} - <p>{{ _('P80') }}: {{ stats[engine_name].rate80 }}</p>{{- "" -}} - <p>{{ _('P95') }}: {{ stats[engine_name].rate95 }}</p>{{- "" -}} - </div> - {%- endif -%} -</td> -{%- endmacro -%} - -{%- macro engine_reliability(engine_name, css_align_class) -%} -{% set r = reliabilities.get(engine_name, {}).get('reliablity', None) %} -{% set checker_result = reliabilities.get(engine_name, {}).get('checker', []) %} -{% set errors = reliabilities.get(engine_name, {}).get('errors', []) %} -{% if r != None %} - {% if r <= 50 %}{% set label = 'danger' %} - {% elif r < 80 %}{% set label = 'warning' %} - {% elif r < 90 %}{% set label = 'default' %} - {% else %}{% set label = 'success' %} - {% endif %} -{% else %} - {% set r = '' %} -{% endif %} -{% if checker_result or errors %} -<td class="{{ css_align_class }} {{ label }}">{{- "" -}} - <a href="{{ url_for('stats', engine=engine_name|e) }}">{{- "" -}} - <span aria-labelledby="{{engine_name}}_reliability"> - {{ icon('exclamation-sign', 'The engine is not reliabled') }} {{ r -}} - </span>{{- "" -}} - </a>{{- "" -}} - <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_reliability"> - {%- if checker_result -%} - <p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p> - {%- endif -%} - {%- for error in errors -%} - <p>{{ error }} </p>{{- "" -}} - {%- endfor -%} - </div>{{- "" -}} -</td> -{%- else -%} -<td class="{{ css_align_class }} {{ label }}"><span>{{ r }}</span></td> -{%- endif -%} -{%- endmacro -%} - -{%- macro plugin_of_category(plugin_category) -%} -{%- for plugin in plugins -%} - {%- if plugin.preference_section == plugin_category -%} - {{- preferences_item_header(_(plugin.description), _(plugin.name), rtl, 'plugin_' + plugin.id) -}} - {{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}} - {{- preferences_item_footer(_(plugin.description), _(plugin.name), rtl) -}} - {%- endif -%} -{%- endfor -%} -{% endmacro %} - -{%- block title %}{{ _('preferences') }} - {% endblock -%} - -{% block content %} - -<div> - - <h1>{{ _('Preferences') }}</h1> - <form method="post" action="{{ url_for('preferences') }}" id="search_form" autocomplete="off"> - - <!-- Nav tabs --> - <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist"> - <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li> - <li><a href="#tab_ui" role="tab" data-toggle="tab">{{ _('User Interface') }}</a></li> - <li><a href="#tab_privacy" role="tab" data-toggle="tab">{{ _('Privacy') }}</a></li> - <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li> - <li><a href="#tab_query" role="tab" data-toggle="tab">{{ _('Special Queries') }}</a></li> - <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li> - </ul> - - <!-- Tab panes --> - <noscript> - <h3>{{ _('General') }}</h3> - </noscript> - <div class="tab-content"> - <div class="tab-pane active" id="tab_general"> - <fieldset> - <div class="container-fluid"> - {% if 'categories' not in locked_preferences %} - <div class="row form-group"> - {% if rtl %} - <div class="col-sm-11 col-md-10"> - {% include 'oscar/categories.html' %} - </div> - <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label> - {% else %} - <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label> - <div class="col-sm-11 col-md-10 search-categories"> - {% include 'oscar/categories.html' %} - </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 '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 {{ 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 '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 {{ 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 %} - - {{ plugin_of_category('general' )}} - - {% 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 {{ 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_url == current_doi_resolver %}selected="selected"{% endif %}> - {{ doi_resolver_name }} - {{ doi_resolver_url }} - </option> - {% endfor %} - </select> - {{ preferences_item_footer(info, label, rtl) }} - {% endif %} - - {{ plugin_of_category('onion' )}} - - {% set label = _('Engine tokens') %} - {% set info = _('Access tokens for private engines') %} - {{ preferences_item_header(info, label, rtl, 'tokens') }} - <input class="form-control" id="tokens" name="tokens" value='{{ preferences.tokens.get_value() }}' autocomplete="off" spellcheck="false" autocorrect="off" /> - {{ preferences_item_footer(info, label, rtl) }} - </div> - </fieldset> - </div> - <div class="tab-pane active_if_nojs" id="tab_ui"> - <noscript> - <h3>{{ _('User Interface') }}</h3> - </noscript> - <fieldset> - <div class="container-fluid"> - {% 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 {{ 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 'theme' not in locked_preferences %} - {% set theme_label = _('Theme') %} - {% set theme_info = _('Change SearXNG layout') %} - {{ preferences_item_header(theme_info, theme_label, rtl, '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 {{ 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 %} - - {% 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 '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 {{ 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 %} - - {% if 'infinite_scroll' not in locked_preferences %} - {% set label = _('Infinite scroll') %} - {% set info = _('Automatically load next page when scrolling to bottom of current page') %} - {{ preferences_item_header(info, label, rtl, 'infinite_scroll') }} - <select class="form-control {{ custom_select_class(rtl) }}" name="infinite_scroll" id="infinite_scroll"> - <option value="1" {% if infinite_scroll %}selected="selected"{% endif %}>{{ _('On') }}</option> - <option value="0" {% if not infinite_scroll %}selected="selected"{% endif %}>{{ _('Off')}}</option> - </select> - {{ preferences_item_footer(info, label, rtl) }} - {% endif %} - - {{ plugin_of_category('ui' )}} - </div> - </fieldset> - </div> - <div class="tab-pane active_if_nojs" id="tab_privacy"> - <noscript> - <h3>{{ _('Privacy') }}</h3> - </noscript> - <fieldset> - <div class="container-fluid"> - {% if 'method' not in locked_preferences %} - {% set method_label = _('HTTP 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 {{ 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 'image_proxy' not in locked_preferences %} - {% set image_proxy_label = _('Image proxy') %} - {% set image_proxy_info = _('Proxying image results through SearXNG') %} - {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl, '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 'query_in_title' not in locked_preferences %} - {% set query_in_title_label = _("Query in the page's title") %} - {% set query_in_title_info = _("When enabled, the result page's title contains your query. Your browser can record this title") %} - {{ preferences_item_header(query_in_title_info, query_in_title_label, rtl, 'query_in_title') }} - <select class="form-control {{ custom_select_class(rtl) }}" name="query_in_title" id="query_in_title"> - <option value="1" {% if query_in_title %}selected="selected"{% endif %}>{{ _('Enabled') }}</option> - <option value="" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled')}}</option> - </select> - {{ preferences_item_footer(query_in_title_info, query_in_title_label, rtl) }} - {% endif %} - - {{ plugin_of_category('privacy' )}} - </div> - </fieldset> - </div> - <div class="tab-pane active_if_nojs" id="tab_engine"> - <!-- Nav tabs --> - <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist"> - {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} - <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li> - {% endfor %} - </ul> - - <noscript> - <h3>{{ _('Engines') }}</h3> - </noscript> - - <!-- Tab panes --> - <div class="tab-content"> - - <div class="hide_if_nojs"> - <p class="text-{% if rtl %}left{% else %}right{% endif %}"> - <button type="button" class="btn btn-default btn-success" id="allow-all-engines">{{ _("Allow all") }}</button> - <button type="button" class="btn btn-default btn-danger" id="disable-all-engines">{{ _("Disable all") }}</button> - </p> - </div> - - {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} - <noscript><label>{{ _(categ) }}</label> - </noscript> - <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}"> - {% if categ == OTHER_CATEGORY %} - <p>{{_('This tab does not show up for search results, but you can search the engines listed here via bangs.')}}</p> - {% endif %} - <div class="container-fluid"> - <fieldset> - <div class="table-responsive"> - <table class="table table-hover table-condensed table-striped"> - <tr> - {% if not rtl %} - <th scope="col">{{ _("Allow") }}</th> - <th scope="col">{{ _("Engine name") }}</th> - <th scope="col">{{ _("Shortcut") }}</th> - <th scope="col" class="col-stat">{{ _("Selected language") }}</th> - <th scope="col" class="col-stat">{{ _("SafeSearch") }}</th> - <th scope="col" class="col-stat">{{ _("Time range") }}</th> - <th scope="col">{{ _("Response time") }}</th> - <th scope="col" class="col-stat text-right">{{ _("Max time") }}</th> - <th scope="col" class="col-stat text-right">{{ _("Reliability") }}</th> - {% else %} - <th scope="col" class="col-stat">{{ _("Reliability") }}</th> - <th scope="col" class="col-stat">{{ _("Max time") }}</th> - <th scope="col" class="text-right">{{ _("Response time") }}</th> - <th scope="col" class="text-right">{{ _("Time range") }}</th> - <th scope="col" class="text-right">{{ _("SafeSearch") }}</th> - <th scope="col" class="text-right">{{ _("Selected language") }}</th> - <th scope="col" class="text-right">{{ _("Shortcut") }}</th> - <th scope="col" class="text-right">{{ _("Engine name") }}</th> - <th scope="col" class="text-right">{{ _("Allow") }}</th> - {% endif %} - </tr> - {% for group, engines in engines_by_category[categ] | group_engines_in_tab %} - {% if loop.length > 1 %} - <tr><th colspan="9">{{_(group)}}</th></tr> - {% endif %} - {% for search_engine in engines %} - {% if not search_engine.private %} - <tr> - {% if not rtl %} - <td class="onoff-checkbox"> - {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}} - </td> - <th scope="row" data-engine-name="{{ search_engine.name }}"><span aria-labelledby="{{ 'tooltip_' + categ + '_' + search_engine.name }}"> - {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%} - {{- search_engine.name -}} - {%- if search_engine.about and search_engine.about.language %} - ({{search_engine.about.language | upper}}) - {%- endif %} - </span> - {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}} - </th> - <td class="name">{{ shortcuts[search_engine.name] }}</td> - <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td> - <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td> - <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td> - {{ engine_time(search_engine.name, 'text-right') }} - <td class="text-right {{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}</td> - {{ engine_reliability(search_engine.name, 'text-right ') }} - {% else %} - {{ engine_reliability(search_engine.name, 'text-left') }} - <td class="text-left {{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}</td> - {{ engine_time(search_engine.name, 'text-left') }} - <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td> - <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td> - <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td> - <td>{{ shortcuts[search_engine.name] }}</td> - <th scope="row" data-engine-name="{{ search_engine.name }}"><span>{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}</span>{{ engine_about(search_engine) }}</th> - <td class="onoff-checkbox"> - {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} - </td> - {% endif %} - </tr> - {% endif %} - {% endfor %} - {% endfor %} - </table> - </div> - </fieldset> - </div> - </div> - {% endfor %} - </div> - </div> - <div class="tab-pane active_if_nojs" id="tab_query"> - <noscript> - <h3>{{ _('Query') }}</h3> - </noscript> - {% if answerers %} - <table class="table table-striped"> - <thead> - <tr> - <th{% if rtl %} class="text-right"{% endif %}>{{ _('Allow') }}</th> - <th{% if rtl %} class="text-right"{% endif %}>{{ _('Keywords') }}</th> - <th{% if rtl %} class="text-right"{% endif %}>{{ _('Name') }}</th> - <th{% if rtl %} class="text-right"{% endif %}>{{ _('Description') }}</th> - <th{% if rtl %} class="text-right"{% endif %}>{{ _('Examples') }}</th> - </tr> - </thead> - <tbody> - <td></td> - <th scope="colgroup" colspan="4">{{ _("This is the list of SearXNG's instant answering modules.") }}</th> - {% for answerer in answerers %} - <tr> - <td></td> - <td>{{ answerer.keywords|join(', ') }}</td> - <td>{{ answerer.info.name }}</td> - <td>{{ answerer.info.description }}</td> - <td>{{ answerer.info.examples|join(', ') }}</td> - </tr> - {% endfor %} - </tbody> - <tbody> - <td></td> - <th scope="colgroup" colspan="4">{{ _('This is the list of plugins.') }}</th> - {%- for plugin in plugins -%} - {%- if plugin.preference_section == 'query' -%} - <tr> - <td>{{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}</td> - <td>{{ plugin.query_keywords|join(', ') }}</td> - <td>{{ _(plugin.name) }}</td> - <td>{{ _(plugin.description) }}</td> - <td>{{ plugin.query_examples }}</td> - </tr> - {%- endif -%} - {%- endfor -%} - </tbody> - </table> - {% endif %} - </div> - <div class="tab-pane active_if_nojs" id="tab_cookies"> - <noscript> - <h3>{{ _('Cookies') }}</h3> - </noscript> - <p class="text-muted"> - {{ _('This is the list of cookies and their values SearXNG is storing on your computer.') }}<br /> - {{ _('With that list, you can assess SearXNG transparency.') }}<br /> - </p> - {% if cookies %} - <table class="table table-striped"> - <tr> - <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Cookie name') }}</th> - <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Value') }}</th> - </tr> - - {% for cookie in cookies %} - <tr> - <td class="text-muted">{{ cookie }}</td> - <td class="text-muted">{{ cookies[cookie] }}</td> - </tr> - {% endfor %} - </table> - {% else %} - {% include 'oscar/messages/no_cookies.html' %} - {% endif %} - </div> - </div> - - <p class="text-muted"> - {{ _('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.") }} - </p> - - <p> - {{ _('Search URL of the currently saved preferences') }} - <small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>: - </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 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> - </div> - </form> -</div> -{% endblock %} diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html deleted file mode 100644 index c7d93e2b3..000000000 --- a/searx/templates/oscar/result_templates/code.html +++ /dev/null @@ -1,18 +0,0 @@ -{% 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 %}<p class="result-content">{{ result.content|safe }}</p>{% endif %} - -{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} aria-labelledby="result-{{loop.index}}">{{ result.repository }}</a></p>{% endif %} - -<div dir="ltr"> -{{ result.codelines|code_highlighter(result.code_language)|safe }} -</div> - -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html deleted file mode 100644 index ea202910d..000000000 --- a/searx/templates/oscar/result_templates/default.html +++ /dev/null @@ -1,38 +0,0 @@ -{% 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.iframe_src -%} - <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') }}" aria-labelledby="result-{{loop.index}}">{{ icon('music') }} {{ _('show media') }}</a></small> -{%- endif -%} - -{% if result.iframe_src -%} -<div id="result-media-{{ index }}" class="embedded-content invisible"> - <iframe data-src="{{result.iframe_src}}" frameborder="0" scrolling="no" allowfullscreen></iframe> -</div> -{%- endif -%} - -{%- if result.img_src or result.thumbnail -%} -<div class="container-fluid">{{- "" -}} - <div class="row">{{- "" -}} - <img src="{{ image_proxify(result.img_src or result.thumbnail) }}" title="{{ result.title|striptags }}" class="default-image-style col-xs-2 col-sm-4 col-md-4 result-content"> - {%- if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%} - </div>{{- "" -}} -</div> -{%- else -%} -{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%} -{%- endif -%} - -{% if result.audio_src -%} -<div id="result-media-{{ index }}" class="audio-control"> - <audio controls><source src="{{result.audio_src}}"></audio> -</div> -{%- 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 deleted file mode 100644 index 52798f7d8..000000000 --- a/searx/templates/oscar/result_templates/files.html +++ /dev/null @@ -1,55 +0,0 @@ -{% 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 }}" class="default-image-style 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/images.html b/searx/templates/oscar/result_templates/images.html deleted file mode 100644 index 96cdd53bb..000000000 --- a/searx/templates/oscar/result_templates/images.html +++ /dev/null @@ -1,36 +0,0 @@ -{%- from 'oscar/macros.html' import draw_favicon with context -%} - -<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}" id="result-{{loop.index}}">{{- "" -}} - <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">{{- "" -}} -</a> -<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">{{- "" -}} - <div class="modal-dialog">{{- "" -}} - <div class="modal-wrapper">{{- "" -}} - <div class="modal-header">{{- "" -}} - <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>{{- "" -}} - <h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4>{{- "" -}} - </div>{{- "" -}} - <div class="modal-body">{{- "" -}} - <img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}"> - {%- if result.author %}<span class="photo-author">{{ result.author }}</span><br />{% endif -%} - {%- if result.content %}<p class="result-content">{{ result.content|striptags }}</p>{% endif -%} - {%- if result.img_format %}<p class="result-format">{{ result.img_format }}</p>{% endif -%} - {%- if result.source %}<p class="result-source">{{ result.source }}</p>{% endif -%} - </div>{{- "" -}} - <div class="modal-footer">{{- "" -}} - <div class="clearfix"></div>{{- "" -}} - <span class="label label-default pull-right">{{ result.engine }}</span>{{- "" -}} - <p class="text-muted pull-left">{{ result.pretty_url }}</p>{{- "" -}} - <div class="clearfix"></div>{{- "" -}} - <div class="row">{{- "" -}} - <div class="col-md-6">{{- "" -}} - <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('Get image') }}</a>{{- "" -}} - </div>{{- "" -}} - <div class="col-md-6">{{- "" -}} - <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('View source') }}</a>{{- "" -}} - </div>{{- "" -}} - </div>{{- "" -}} - </div>{{- "" -}} - </div>{{- "" -}} - </div>{{- "" -}} -</div>{{- "" -}} diff --git a/searx/templates/oscar/result_templates/key-value.html b/searx/templates/oscar/result_templates/key-value.html deleted file mode 100644 index 9d75682d4..000000000 --- a/searx/templates/oscar/result_templates/key-value.html +++ /dev/null @@ -1,19 +0,0 @@ -{% from 'oscar/macros.html' import result_footer, result_footer_rtl with context %} -<div class="result result-default"> -<table class="table table-responsive table-bordered table-condensed"> - {% for key, value in result.items() %} - {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions', 'pretty_url', 'parsed_url'] %} - {% continue %} - {% endif %} - <tr> - <td><b>{{ key|upper }}</b>: {{ value|truncate }}</td> - </tr> - {% endfor %} -</table> - -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} -</div> diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html deleted file mode 100644 index bcd1019ec..000000000 --- a/searx/templates/oscar/result_templates/map.html +++ /dev/null @@ -1,76 +0,0 @@ -{% 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) -}} - -<div class="container-fluid"> - - <div class="row"> - {%- if result.img_src -%}<img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" class="img-thumbnail">{%- endif -%} - - {%- if result.type_icon or result.type -%} - <p class="result-content"> - {%- if result.type_icon -%} - <img src="{{ image_proxify(result.type_icon) }}" title="{{ result.type|striptags }}" class="img-type"> - {%- endif -%} - {{ result.type if result.type is not none else '' }} - </p> - {%- endif -%} - - {%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%} - - <table class="result-content result-map-details"> - {%- if result.address -%} - <tr> - <th scope="row"> - {{ result.address_label or _('address') }} - </th> - <td class="result-content result-adress" itemscope itemtype="http://schema.org/PostalAddress"> - {%- if result.address.name -%} - <strong itemprop="name" class="hidden">{{ result.address.name }}</strong> - {%- endif -%} - {%- if result.address.road -%} - <span itemprop="streetAddress"> - {%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%} - {{- result.address.road -}} - </span><br/> - {%- endif -%} - {%- if result.address.locality -%} - <span itemprop="addressLocality">{{ result.address.locality }}</span> - {%- if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif -%} - <br/> - {%- endif -%} - {%- if result.address.country -%} - <span itemprop="addressCountry">{{ result.address.country }}</span> - {%- endif -%} - </td> - </tr> - {%- endif %} - {%- for info in result.data -%} - <tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr> - {%- endfor -%} - {%- for link in result.links -%} - <tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr> - {%- endfor -%} - </table> - - <p class="result-content"> - {%- if (result.latitude and result.longitude) or result.boundingbox -%} - <span><a class="text-info btn-collapse collapsed searxng_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></span> - {%- endif -%} - </p> - - </div> - -{%- if (result.latitude and result.longitude) or result.boundingbox -%} - <div class="collapse" id="result-map-{{ index }}"> - <div class="osm-map-box" id="osm-map-{{ index }}"></div> - </div> -{%- endif -%} - -</div> -{%- 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 deleted file mode 100644 index 590db0e05..000000000 --- a/searx/templates/oscar/result_templates/products.html +++ /dev/null @@ -1,22 +0,0 @@ -{% 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/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html deleted file mode 100644 index 9f6671549..000000000 --- a/searx/templates/oscar/result_templates/torrent.html +++ /dev/null @@ -1,25 +0,0 @@ -{% 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 %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif -%} -{%- if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') -}} - <span class="badge"> - {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') -}} - {%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') -}} - {%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') -}} - {%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') -}} - {%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} - </span>{% endif -%} -{%- if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif -%} - -{%- if result.content %}<br />{{ result.content|safe }}{% endif -%} - -</p> - -{%- if rtl -%} -{{ result_footer_rtl(result, 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 deleted file mode 100644 index 975f75e2a..000000000 --- a/searx/templates/oscar/result_templates/videos.html +++ /dev/null @@ -1,29 +0,0 @@ -{% 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.iframe_src -%} - <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small> -{%- endif -%} - -{% if result.iframe_src -%} -<div id="result-video-{{ index }}" class="embedded-video collapse"> - <iframe data-src="{{result.iframe_src}}" width="540" height="304" frameborder="0" scrolling="no" allowfullscreen></iframe> -</div> -{%- endif %} - -<div class="container-fluid">{{- "" -}} - <div class="row">{{- "" -}} - <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" aria-labelledby="result-{{loop.index}}" /></a> - {%- if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif -%} - {%- if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif -%} - {%- if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif -%} - </div>{{- "" -}} -</div> - -{%- if rtl -%} -{{ result_footer_rtl(result, loop.index) }} -{%- else -%} -{{ result_footer(result, loop.index) }} -{%- endif -%} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html deleted file mode 100644 index ac7179158..000000000 --- a/searx/templates/oscar/results.html +++ /dev/null @@ -1,196 +0,0 @@ -{% extends "oscar/base.html" %} -{% macro search_form_attrs(pageno) -%} - {%- for category in selected_categories -%}<input type="hidden" name="category_{{ category }}" value="1"/>{%- endfor -%} - <input type="hidden" name="q" value="{{ q|e }}" />{{- "" -}} - <input type="hidden" name="pageno" value="{{ pageno }}" />{{- "" -}} - <input type="hidden" name="time_range" value="{{ time_range }}" />{{- "" -}} - <input type="hidden" name="language" value="{{ current_language }}" />{{- "" -}} - {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif -%} -{%- endmacro %} -{% macro engine_data_form(engine_data) -%} - {% for engine_name, kv_data in engine_data.items() %} - {% for k, v in kv_data.items() %} - <input type="hidden" name="engine_data-{{ engine_name }}-{{ k|e }}" value="{{ v|e }}" /> - {% 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 %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %} -{% block meta %}{{" "}}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&format=rss">{% endblock %} -{% block content %} - {% include 'oscar/search.html' %} - - <div class="row"> - <div class="col-sm-4 col-sm-push-8" id="sidebar_results"> - {% if number_of_results != '0' -%} - <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p> - {%- endif %} - - {% if unresponsive_engines and results|length >= 1 -%} - <div class="alert alert-danger fade in" role="alert"> - <p>{{ _('Engines cannot retrieve results') }}:</p> - {%- for engine_name, error_type in unresponsive_engines -%} - <p>{{- '' -}} - {{- engine_name }} ( - <a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}"> - {{- error_type -}} - </a> ){{- '' -}} - </p> - {%- endfor -%} - </div> - {%- endif %} - - {% if infoboxes -%} - {% for infobox in infoboxes %} - {% include 'oscar/infobox.html' %}{{- "\n\n" -}} - {% endfor %} - {%- endif %} - - {% if suggestions %} - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title">{{ _('Suggestions') }}</h4> - </div> - <div class="panel-body"> - {% for suggestion in suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('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> - {% endfor %} - </div> - </div> - {%- endif %} - - <div class="panel panel-default hidden-xs"> - <div class="panel-heading">{{- "" -}} - <h4 class="panel-title">{{ _('Links') }}</h4>{{- "" -}} - </div> - <div class="panel-body"> - <form role="form">{{- "" -}} - <div class="form-group">{{- "" -}} - <label for="search_url">{{ _('Search URL') }}</label>{{- "" -}} - <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>{{- "" -}} - </div>{{- "" -}} - </form> - {% if search_formats %} - <label>{{ _('Download results') }}</label> - <div class="clearfix"></div> - {% for output_type in search_formats %} - <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>{{- "" -}} - </form> - {% endfor %} - <div class="clearfix"></div> - {% if 'rss' in search_formats %} - <br /><label><a href="{{ search_url() }}&format=rss">{{ _('RSS subscription') }}</a></label> - {% endif %} - <div class="clearfix"></div> - {% endif %} - </div> - </div> - </div><!-- /#sidebar_results --> - - <div class="col-sm-8 col-sm-pull-4" id="main_results"> - <h1 class="sr-only">{{ _('Search results') }}</h1> - - {% if corrections -%} - <div class="result"> - <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 %} - - {% if answers -%} - {%- for answer in answers.values() %} - <div class="result well"> - {% if answer.url %} - <a href="{{ answer.url }}">{{ answer.answer }}</a> - {% else %} - <span>{{ answer.answer }}</span> - {% endif %} - </div> - {%- endfor %} - {%- endif %} - - {% for result in results -%} - <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}"> - {%- set index = loop.index -%} - {%- if result.template -%} - {% include get_result_template('oscar', result['template']) %} - {%- else -%} - {% include 'oscar/result_templates/default.html' %} - {%- endif -%} - </div> - {% endfor %} - - {% if not results and not answers -%} - {% include 'oscar/messages/no_results.html' %} - {% endif %} - - <div class="clearfix"></div> - - {% if paging -%} - {% if rtl %} - <div id="pagination"> - <div class="pull-left">{{- "" -}} - <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> - {{- search_form_attrs(pageno+1) -}} - {{- engine_data_form(engine_data) -}} - <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('search') }}" class="pull-left"> - {{- search_form_attrs(pageno-1) -}} - {{- engine_data_form(engine_data) -}} - <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>{{- "" -}} - </form>{{- "" -}} - </div> - </div><!-- /#pagination --> - <div class="clearfix"></div> - {% else %} - <div id="pagination"> - <div class="pull-left">{{- "" -}} - <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="pull-left"> - {{- search_form_attrs(pageno-1) -}} - {{- engine_data_form(engine_data) -}} - <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('search') }}" class="pull-left"> - {{- search_form_attrs(pageno+1) -}} - {{- engine_data_form(engine_data) -}} - <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>{{- "" -}} - </form>{{- "" -}} - </div> - </div><!-- /#pagination --> - <div class="clearfix"></div> - {% endif %} - {% endif %} - </div><!-- /#main_results --> - </div> -{% endblock %} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html deleted file mode 100644 index 2b3758efd..000000000 --- a/searx/templates/oscar/search.html +++ /dev/null @@ -1,25 +0,0 @@ -{% from 'oscar/macros.html' import icon %} -<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="button" id="clear_search" class="btn btn-default hide_if_nojs" aria-label="{{ _('Clear search') }}">{{ icon('remove') }}</button> - </span> - </div> - </div> - <div class="col-xs-6 col-md-2 search-margin"> - {%- include 'oscar/time-range.html' -%} - </div> - <div class="col-xs-6 col-md-2 search-margin"> - {%- include 'oscar/languages.html' -%} - </div> - </div> - <div class="row"> - <div class="col-sm-12"> - {%- include 'oscar/categories.html' -%} - </div> - </div> -</form><!-- / #search_form_full --> diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html deleted file mode 100644 index d3982304d..000000000 --- a/searx/templates/oscar/search_full.html +++ /dev/null @@ -1,19 +0,0 @@ -{% from 'oscar/macros.html' import icon %} - -<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" id="search_form" role="search"> - {% if rtl %} - <div class="input-group"> - {% else %} - <div class="input-group col-md-8 col-md-offset-2"> - {% endif %} - <input type="search" autofocus name="q" class="form-control input-lg autofocus" 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 input-lg" 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 input-lg" aria-label="{{ _('Clear search') }}"><span class="hide_if_nojs">{{ icon('remove') }}</span><span class="hidden active_if_nojs">{{ _('Clear') }}</span></button> - </span> - </div> - <div class="col-md-8 col-md-offset-2 advanced"> - {% include 'oscar/advanced.html' %} - </div> - -</form><!-- / #search_form_full --> diff --git a/searx/templates/oscar/stats.html b/searx/templates/oscar/stats.html deleted file mode 100644 index 646cb9923..000000000 --- a/searx/templates/oscar/stats.html +++ /dev/null @@ -1,157 +0,0 @@ -{% extends 'oscar/base.html' %} -{% from '__common__/new_issue.html' import new_issue with context %} - -{% block title %}{{ _('stats') }} - {% if selected_engine_name %} {{ selected_engine_name }} - {% endif %}{% endblock %} - -{%- macro th_sort(column_order, column_name) -%} - {%- if selected_engine_name -%} - {{ column_name }} - {%- elif column_order==sort_order -%} - {{ column_name }} {{ icon('arrow-dropdown') }} - {%- else -%} - <a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}</a> - {%- endif -%} -{%- endmacro -%} - -{% block content %} -<div class="container-fluid"> - <h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1> - <div class="row"> - <div class="col-xs-12 col-sm-12 col-md-12"> - <div class="table-responsive"> - {% if not engine_stats.get('time') %} - <div class="col-sm-12 col-md-12"> - {% include 'oscar/messages/no_data_available.html' %} - </div> - {% else %} - <table class="table table-hover table-condensed table-striped engine-stats"> - <tr> - <th scope="col" class="engine-name">{{ th_sort('name', _("Engine name")) }}</th> - <th scope="col" class="engine-score">{{ th_sort('score', _('Scores')) }}</th> - <th scope="col" class="result-count">{{ th_sort('result_count', _('Result count')) }}</th> - <th scope="col" class="response-time">{{ th_sort('time', _('Response time')) }}</th> - <th scope="col" class="engine-reliability">{{ th_sort('reliability', _('Reliability')) }}</th> - </tr> - {% for engine_stat in engine_stats.get('time', []) %} - <tr> - <td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a></td> - <td class="engine-score"> - {%- if engine_stat.score -%} - <span aria-labelledby="{{engine_stat.name}}_score" >{{ engine_stat.score|round(1) }}</span> - <div class="engine-tooltip text-left" role="tooltip" id="{{engine_stat.name}}_score">{{- "" -}} - <p>{{ _('Scores per result') }}: {{ engine_stat.score_per_result | round(3) }}</p> - </div> - {%- endif -%} - </td> - <td class="result-count"> - {%- if engine_stat.result_count -%} - <div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}} - <div class="bar-chart-graph" aria-hidden="true">{{- "" -}} - <div class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}"></div>{{- "" -}} - </div> - {%- endif -%} - </td> - <td class="response-time"> - {%- if engine_stat.total is not none -%} - <div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}} - <div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">{{- "" -}} - {% if engine_stat.http is not none and engine_stats.max_time %}<div class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{%- endif -%} - {% if engine_stat.processing is not none and engine_stats.max_time %}<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{%- endif -%} - </div> - <div class="engine-tooltip text-left" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}} - <table class="table table-striped"> - <tr> - <th scope="col"></th> - <th scope="col">{{ _('Total') }}</th> - <th scope="col">{{ _('HTTP') }}</th> - <th scope="col">{{ _('Processing') }}</th> - </tr> - <tr> - <th scope="col">{{ _('Median') }}</th> - <td>{{ engine_stat.total }}</td> - <td>{{ engine_stat.http or '' }}</td> - <td>{{ engine_stat.processing }}</td> - </tr> - <tr> - <th scope="col">{{ _('P80') }}</th> - <td>{{ engine_stat.total_p80 }}</td> - <td>{{ engine_stat.http_p80 or '' }}</td> - <td>{{ engine_stat.processing_p80 }}</td> - </tr> - <tr> - <th scope="col">{{ _('P95') }}</th> - <td>{{ engine_stat.total_p95 }}</td> - <td>{{ engine_stat.http_p95 or '' }}</td> - <td>{{ engine_stat.processing_p95 }}</td> - </tr> - </table> - </div> - {%- endif -%} - </td> - <td class="engine-reliability"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td> - </tr> - {% endfor %} - </table> - {% endif %} - </div> - </div> - <div class="col-xs-12 col-sm-12 col-md-12"> - {% if selected_engine_name %} - {% for secondary in [False, True] %} - {% set ns = namespace(first=true) %} - {% for error in engine_reliabilities[selected_engine_name].errors %} - {% if secondary == error.secondary %} - {% if ns.first %} - {% set ns.first = false %} - <h3>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h3> - {% endif %} - <table class="table table-striped table-bordered engine-error"> - <tbody> - <tr> - {%- if error.exception_classname -%} - <th scope="row" class="engine-error-type">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td> - {%- elif error.log_message -%} - <th scope="row" class="engine-error-type">{{ _('Message') }}</th><td>{{ error.log_message }}</td> - {%- endif -%} - <th scope="row" class="engine-error-type">{{ _('Percentage') }}</th><td class="engine-error-type">{{ error.percentage }}</td> - </tr> - {% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}} - <td colspan="3"> - {%- for param in error.log_parameters -%} - <span class="log_parameters">{{ param }}</span> - {%- endfor -%} - </td> - </tr> - {% endif %} - <tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr> - <tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr> - <tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr> - </tbody> - </table> - {% endif %} - {% endfor %} - {% endfor %} - {% if engine_reliabilities[selected_engine_name].checker %} - <h3>{{ _('Checker') }}</h3> - <table class="table table-striped table-bordered"> - <tr> - <th scope="col" class="failed-test">{{ _('Failed test') }}</th> - <th scope="col">{{ _('Comment(s)') }}</th> - </tr> - {% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %} - <tr> - <td>{{ test_name }}</td> - <td> - {% for r in results %}<p>{{ r }}</p>{% endfor %} - </td> - </tr> - {% endfor %} - </table> - {% endif %} - {{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }} - {% endif %} - </div> - </div> -</div> - -{% endblock %} diff --git a/searx/templates/oscar/time-range.html b/searx/templates/oscar/time-range.html deleted file mode 100644 index 6087dd417..000000000 --- a/searx/templates/oscar/time-range.html +++ /dev/null @@ -1,19 +0,0 @@ -{% 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_class(rtl) }} form-control" accesskey="t">{{- "" -}} - <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}> - {{- _('Anytime') -}} - </option>{{- "" -}} - <option id="time-range-day" value="day" {{ "selected" if time_range=="day" else ""}}> - {{- _('Last day') -}} - </option>{{- "" -}} - <option id="time-range-week" value="week" {{ "selected" if time_range=="week" else ""}}> - {{- _('Last week') -}} - </option>{{- "" -}} - <option id="time-range-month" value="month" {{ "selected" if time_range=="month" else ""}}> - {{- _('Last month') -}} - </option>{{- "" -}} - <option id="time-range-year" value="year" {{ "selected" if time_range=="year" else ""}}> - {{- _('Last year') -}} - </option>{{- "" -}} -</select> diff --git a/searx/templates/oscar/messages/no_cookies.html b/searx/templates/simple/messages/no_cookies.html index 9bebc8ad1..a9898b4e3 100644 --- a/searx/templates/oscar/messages/no_cookies.html +++ b/searx/templates/simple/messages/no_cookies.html @@ -1,4 +1,4 @@ -{% from 'oscar/macros.html' import icon %} +{% from 'simple/icons.html' import icon %} <div class="alert alert-info fade in" role="alert"> <strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong> {{ _('currently, there are no cookies defined.') }} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index fef003d5e..2278237b5 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -399,7 +399,7 @@ {% endfor %} </table> {% else %} - {% include 'oscar/messages/no_cookies.html' %} + {% include 'simple/messages/no_cookies.html' %} {% endif %} <h4>{{ _('Search URL of the currently saved preferences') }} :</h4> <div class="selectable_url"> |