diff options
Diffstat (limited to 'searx/templates/simple')
-rw-r--r-- | searx/templates/simple/404.html | 2 | ||||
-rw-r--r-- | searx/templates/simple/base.html | 17 | ||||
-rw-r--r-- | searx/templates/simple/categories.html | 2 | ||||
-rw-r--r-- | searx/templates/simple/infobox.html | 3 | ||||
-rw-r--r-- | searx/templates/simple/macros.html | 6 | ||||
-rw-r--r-- | searx/templates/simple/messages/no_results.html | 2 | ||||
-rw-r--r-- | searx/templates/simple/preferences.html | 49 | ||||
-rw-r--r-- | searx/templates/simple/result_templates/map.html | 87 | ||||
-rw-r--r-- | searx/templates/simple/results.html | 33 | ||||
-rw-r--r-- | searx/templates/simple/search.html | 4 |
10 files changed, 123 insertions, 82 deletions
diff --git a/searx/templates/simple/404.html b/searx/templates/simple/404.html index 11d6043..1a10514 100644 --- a/searx/templates/simple/404.html +++ b/searx/templates/simple/404.html @@ -3,7 +3,7 @@ <div class="center"> <h1>{{ _('Page not found') }}</h1> {% autoescape false %} - <p>{{ _('Go to %(search_page)s.', search_page=unicode('<a href="{}">{}</a>').format(url_for('index'), _('search page'))) }}</p> + <p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p> {% endautoescape %} </div> {% endblock %} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 92597b6..17c9785 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -2,7 +2,7 @@ <html class="no-js" lang="en" {% if rtl %} dir="rtl"{% endif %}> <head> <meta charset="UTF-8" /> - <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine"> + <meta name="description" content="searx — a privacy-respecting, hackable metasearch engine"> <meta name="keywords" content="searx, search, search engine, metasearch, meta search"> <meta name="generator" content="searx/{{ searx_version }}"> <meta name="referrer" content="no-referrer"> @@ -25,14 +25,14 @@ data-search-on-category-select="{{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}}" data-infinite-scroll="{{ 'true' if 'plugins/js/infinite_scroll.js' in scripts else 'false' }}" data-static-path="{{ url_for('static', filename='themes/simple') }}/" - data-no-item-found="{{ _('No item found') }}"></script> + data-translations="{{ translations }}"></script> <!--<![endif]--> {% block head %} - <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> + <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> {% endblock %} <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" /> </head> -<body> +<body class="{{ endpoint }}_endpoint" > <main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}"> {% if errors %} <div class="dialog-error" role="alert"> @@ -50,10 +50,11 @@ </main> <footer> <p> - {{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> - <a href="https://github.com/asciimoo/searx">{{ _('Source code') }}</a> | - <a href="https://github.com/asciimoo/searx/issues">{{ _('Issue tracker') }}</a> | - <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">{{ _('Public instances') }}</a> + {{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} — {{ _('a privacy-respecting, hackable metasearch engine') }}<br/> + <a href="{{ brand.GIT_URL }}">{{ _('Source code') }}</a> | + <a href="{{ brand.ISSUE_URL }}">{{ _('Issue tracker') }}</a> | + <a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>{% if brand.CONTACT_URL %} | + <a href="{{ brand.CONTACT_URL }}">{{ _('Contact instance maintainer') }}</a>{% endif %} </p> </footer> <!--[if gte IE 9]>--> diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 127d55b..6724d06 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -1,7 +1,7 @@ <div id="categories">{{- '' -}} <div id="categories_container"> {%- for category in categories -%} - <div class="category"><input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/><label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">{{ _(category) }}</label></div> + <div class="category"><a><input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/><label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">{{ _(category) }}</label></a></div> {%- endfor -%} {%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%} </div>{{- '' -}} diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html index 50b5689..56c51af 100644 --- a/searx/templates/simple/infobox.html +++ b/searx/templates/simple/infobox.html @@ -1,7 +1,6 @@ <aside class="infobox"> <h2><bdi>{{ infobox.infobox }}</bdi></h2> {% if infobox.img_src %}<img src="{{ image_proxify(infobox.img_src) }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %} - <p><bdi>{{ infobox.entity }}</bdi></p> <p><bdi>{{ infobox.content | safe }}</bdi></p> {% if infobox.attributes %} <div class="attributes"> @@ -34,7 +33,7 @@ <div> <h3><bdi>{{ topic.name }}</bdi></h3> {% for suggestion in topic.suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index f0b3627..1eb4266 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -1,6 +1,6 @@ <!-- Draw glyphicon icon from bootstrap-theme --> -{% macro icon(action) -%} - <span class="ion-icon-big ion-{{ action }}"></span> +{% macro icon(action, alt) -%} + <span title="{{ alt }}" class="ion-icon-big ion-{{ action }}"></span> {%- endmacro %} {% macro icon_small(action) -%} @@ -26,7 +26,7 @@ <!-- Draw result header --> {% macro result_header(result, favicons, image_proxify) -%} -<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}"> +<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}"> {%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="image" />{{ result_close_link() }}{% endif -%} {%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/>{{ result_close_link() }}{% endif -%} <h3>{{ result_link(result.url, result.title|safe) }}</h3> diff --git a/searx/templates/simple/messages/no_results.html b/searx/templates/simple/messages/no_results.html index fa984b0..df75ef2 100644 --- a/searx/templates/simple/messages/no_results.html +++ b/searx/templates/simple/messages/no_results.html @@ -7,7 +7,7 @@ {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %} {% endfor %} </p> - <p><small>{{ _('Please, try again later or find another searx instance.') }}</small></p> + <p><small>{{ _('Please, try again later or find another searx instance.') }} (<a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>) </small></p> </div> {% else %} <div class="dialog-error" role="alert"> diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 7437ed4..a0ed779 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -1,4 +1,4 @@ -{% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} +{% from 'simple/macros.html' import icon, tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} {% extends "simple/base.html" %} @@ -18,6 +18,17 @@ {%- endfor -%} {%- endmacro -%} +{% macro engine_about(search_engine) -%} +{% if search_engine.about is defined %} +{% set about = search_engine.about %} +<div class="engine-tooltip" role="tooltip">{{- "" -}} + <p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p> + {%- 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 -%} + {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%} +</div> +{%- endif -%} +{%- endmacro %} + {% block head %} {% endblock %} {% block content %} @@ -30,11 +41,14 @@ {{ tabs_open() }} {{ tab_header('maintab', 'general', _('General')) }} + {% if 'categories' not in locked_preferences %} <fieldset> <legend>{{ _('Default categories') }}</legend> {% set display_tooltip = false %} {% include 'simple/categories.html' %} </fieldset> + {% endif %} + {% if 'language' not in locked_preferences %} <fieldset> <legend>{{ _('Search language') }}</legend> <p class="value">{{- '' -}} @@ -47,6 +61,8 @@ </p> <div class="description">{{ _('What language do you prefer for search?') }}</div> </fieldset> + {% endif %} + {% if 'autocomplete' not in locked_preferences %} <fieldset> <legend>{{ _('Autocomplete') }}</legend> <p class="value"> @@ -59,6 +75,8 @@ </p> <div class="description">{{ _('Find stuff as you type') }}</div> </fieldset> + {% endif %} + {% if 'safesearch' not in locked_preferences %} <fieldset> <legend>{{ _('SafeSearch') }}</legend> <p class="value"> @@ -70,13 +88,15 @@ </p> <p class="description">{{ _('Filter content') }}</p> </fieldset> + {% endif %} {{ plugin_preferences('general') }} + {% if 'doi_resolver' not in locked_preferences %} <fieldset> <legend>{{ _('Open Access DOI resolver') }}</legend> <p class="value"> <select id='doi_resolver' name='doi_resolver'> {%- for doi_resolver_name,doi_resolver_url in doi_resolvers.items() -%} - <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}> + <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}> {{- doi_resolver_name }} - {{ doi_resolver_url -}} </option> {%- endfor -%} @@ -84,6 +104,7 @@ </p> <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div> </fieldset> + {% endif %} {{ tab_footer() }} {{ tab_header('maintab', 'engines', _('Engines')) }} @@ -111,7 +132,7 @@ {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %} <tr> <td class="engine_checkbox">{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}</td> - <th class="name">{{ search_engine.name }}</th> + <th class="name">{% if search_engine.enable_http %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ search_engine.name }} {{ engine_about(search_engine) }}</th> <td class="shortcut">{{ shortcuts[search_engine.name] }}</td> <td>{{ checkbox(engine_id + '_supported_languages', current_language == 'all' or current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages, true, true) }}</td> <td>{{ checkbox(engine_id + '_safesearch', search_engine.safesearch==True, true, true) }}</td> @@ -129,6 +150,7 @@ {{ tab_footer() }} {{ tab_header('maintab', 'ui', _('User interface')) }} + {% if 'locale' not in locked_preferences %} <fieldset> <legend>{{ _('Interface language') }}</legend> <p class="value"> @@ -140,6 +162,8 @@ </p> <div class="description">{{ _('Change the language of the layout') }}</div> </fieldset> + {% endif %} + {% if 'theme' not in locked_preferences %} <fieldset> <legend>{{ _('Themes') }}</legend> <p class="value"> @@ -151,6 +175,8 @@ </p> <div class="description">{{ _('Change searx layout') }}</div> </fieldset> + {% endif %} + {% if 'results_on_new_tab' not in locked_preferences %} <fieldset> <legend>{{ _('Results on new tabs') }}</legend> <p class="value"> @@ -161,6 +187,19 @@ </p> <div class="description">{{_('Open result links on new browser tabs') }}</div> </fieldset> + {% endif %} + {% if 'autofocus' not in locked_preferences %} + <fieldset> + <legend>{{ _('Autofocus search field') }}</legend> + <p class="value"> + <select name='autofocus'> + <option value="1" {% if autofocus %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not autofocus %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + </p> + <div class="description">{{_('Turn off if you use your keyboard to scroll') }}</div> + </fieldset> + {% endif %} {{ plugin_preferences('ui') }} {{ tab_footer() }} @@ -197,6 +236,7 @@ {{ tab_footer() }} {{ tab_header('maintab', 'privacy', _('Privacy')) }} + {% if 'method' not in locked_preferences %} <fieldset> <legend>{{ _('Method') }}</legend> <p class="value"> @@ -207,6 +247,8 @@ </p> <div class="description">{{ _('Search language') }}</div> </fieldset> + {% endif %} + {% if 'image_proxy' not in locked_preferences %} <fieldset> <legend>{{ _('Image proxy') }}</legend> <p class="value"> @@ -217,6 +259,7 @@ </p> <div class="description">{{ _('Proxying image results through searx') }}</div> </fieldset> + {% endif %} {{ plugin_preferences('privacy') }} {{ tab_footer() }} diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html index 2de4451..8b08bda 100644 --- a/searx/templates/simple/result_templates/map.html +++ b/searx/templates/simple/result_templates/map.html @@ -3,64 +3,47 @@ {{ result_header(result, favicons, image_proxify) -}} {{- result_sub_header(result) -}} -{%- if (result.latitude and result.longitude) or result.boundingbox -%} - <small> • <a class="btn-collapse collapsed searx_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small> -{%- endif -%} - -{%- if result.osm and (result.osm.type and result.osm.id) -%} - <small> • <a class="btn-collapse collapsed hide_if_nojs searx_overpass_request" data-target="#result-overpass-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}">{{ icon('location') }} {{ _('show details') }}</a></small> -{%- endif -%} -{#- -{% if (result.latitude and result.longitude) %} - <small> • <a class="btn-collapse disabled_if_nojs" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('location') }} {{ _('show geodata') }}</a></small> -{% endif %} --#} +{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} -{%- if result.address -%} -<p itemscope itemtype="http://schema.org/PostalAddress" class="content"> - {%- if result.address.name -%} - <strong itemprop="name">{{ result.address.name }}</strong><br/> - {%- endif -%} - {% if result.address.road -%} - <span itemprop="streetAddress"> - {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %} - {{- result.address.road -}} - </span><br/> +<table> + {%- if result.address -%} + <tr> + <th scope="row">{{ result.address_label or _('address') }}</th> + <td 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 %} - {%- if result.address.locality -%} - <span itemprop="addressLocality">{{- result.address.locality -}}</span> - {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %} - <br/> - {%- endif -%} - {%- if result.address.country -%} - <span itemprop="addressCountry">{{- result.address.country -}}</span> - {%- endif -%} -</p> -{%- endif -%} + {%- 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|safe }}</a></td></tr> + {%- endfor -%} +</table> -{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} +{%- if (result.latitude and result.longitude) or result.boundingbox -%} + <small> <a class="btn-collapse collapsed searx_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small> +{%- endif -%} {{- result_sub_footer(result, proxify) -}} -{% if result.osm and (result.osm.type and result.osm.id) -%} - <div class="result-content invisible" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}> - <div id="result-overpass-table-loading-{{ index }}"><div class="loader">{{ _('Loading...') }}</div></div> - <table id="result-overpass-table-{{ index }}"> - <tbody> - </tbody> - </table> - </div> -{%- endif %} - -{#- -{% if (result.latitude and result.longitude) -%} - <div id="result-geodata-{{ index }}" class="invisible"> - <strong>Longitude:</strong> {{ result.longitude }} <br/> - <strong>Latitude:</strong> {{ result.latitude }} - </div> -{%- endif %} --#} - {% if (result.latitude and result.longitude) or result.boundingbox -%} <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div> {%- endif %} diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 8885abc..7ece6c7 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -1,7 +1,14 @@ {% extends "simple/base.html" %} {% from 'simple/macros.html' import icon, icon_small %} +{% 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 %} {% block title %}{% if method == 'GET' %}{{- q|e -}} -{% endif %}{% endblock %} -{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&categories={{ selected_categories|join(",") | replace(' ','+') }}&pageno={{ pageno }}&time_range={{ time_range }}&language={{ current_language }}&safesearch={{ safesearch }}&format=rss">{% endblock %} +{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&categories={{ selected_categories|join(",") | replace(' ','+') }}&pageno={{ pageno }}&time_range={{ time_range }}&language={{ current_language }}&safesearch={{ safesearch }}&format=rss">{% endblock %} {% block content %} <nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav> {% include 'simple/search.html' %} @@ -15,8 +22,14 @@ <div id="results" class="{{ only_template }}"> {% if answers -%} <div id="answers"><h4 class="title">{{ _('Answers') }} : </h4> - {%- for answer in answers -%} - <div class="answer">{{- answer -}}</div> + {%- for answer in answers.values() -%} + <div class="answer"> + {% if answer.url %} + <a href="{{ answer.url }}">{{ answer.answer }}</a> + {% else %} + <span>{{ answer.answer }}</span> + {% endif %} + </div> {%- endfor -%} </div> {%- endif %} @@ -49,7 +62,7 @@ <h4 class="title">{{ _('Suggestions') }} : </h4> <div class="wrapper"> {% for suggestion in suggestions %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion.url }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> @@ -65,13 +78,13 @@ <div id="search_url"> <h4 class="title">{{ _('Search URL') }} :</h4> - <div class="selectable_url"><pre>{{ base_url }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div> + <div class="selectable_url"><pre>{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div> </div> <div id="apis"> <h4 class="title">{{ _('Download results') }}</h4> {% for output_type in ('csv', 'json', 'rss') %} <div class="left"> - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ q|e }}"> {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1"> @@ -94,7 +107,7 @@ <h4>{{ _('Try searching for:') }}</h4> {% for correction in corrections %} <div class="left"> - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation"> <input type="hidden" name="q" value="{{ correction.url }}"> <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> @@ -127,9 +140,10 @@ {% if paging %} <nav id="pagination"> {% if pageno > 1 %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}right{% else %}left{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > + {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} @@ -143,9 +157,10 @@ </div> </form> {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div class="{% if rtl %}left{% else %}right{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > + {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index e9023b4..a4ee392 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -1,7 +1,7 @@ -<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> +<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <div id="search_wrapper"> <div class="search_box"> - <input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} > + <input id="q" {% if autofocus %}autofocus{% endif %} name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} > <button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon('close') }}</span><span class="show_if_nojs">{{ _('Clear search') }}</span></button> <button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="show_if_nojs">{{ _('Start search') }}</span></button> </div> |