summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-11-06 12:26:48 +0100
committerAlexandre Flament <alex@al-f.net>2021-11-08 21:40:53 +0100
commit80fb77476fad4b229418c530f3ffda67f357a15a (patch)
treebabc003c7dc636da860ede1dc0d8e8dad0333ac6 /searx/templates
parent90acb342d32b1ce890402acbc24cc9a5793fddc6 (diff)
[mod] new preference: query_in_title
* disable by default * settings.yml: ui.query_in_title * in /preferences: privacy tab when enabled, the result page's title contains the user query. previously: * oscar theme: the query was always included * simple theme: the query was included with the GET method
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/oscar/preferences.html11
-rw-r--r--searx/templates/oscar/results.html2
-rw-r--r--searx/templates/simple/preferences.html12
-rw-r--r--searx/templates/simple/results.html2
4 files changed, 25 insertions, 2 deletions
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index 944a390ef..a54ca25d9 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -280,6 +280,17 @@
{{ 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>
diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html
index b5bedcd44..ce99fe0ac 100644
--- a/searx/templates/oscar/results.html
+++ b/searx/templates/oscar/results.html
@@ -16,7 +16,7 @@
{%- endmacro %}
{%- macro search_url() %}{{ url_for('search', _external=True) }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&amp;language={{ current_language }}{% endif %}{% endmacro -%}
-{% block title %}{{ q|e }} - {% endblock %}
+{% 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() }}&amp;format=rss">{% endblock %}
{% block content %}
{% include 'oscar/search.html' %}
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index 90d01d2b6..995170754 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -237,6 +237,18 @@
<div class="description">{{ _('Proxying image results through SearXNG') }}</div>
</fieldset>
{% endif %}
+ {% if 'query_in_title' not in locked_preferences %}
+ <fieldset>
+ <legend>{{ _('Query in the page\'s title') }}</legend>
+ <p class="value">
+ <select name='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>
+ </p>
+ <div class="description">{{ _('When enabled, the result page\'s title contains your query. Your browser can record this title.') }}</div>
+ </fieldset>
+ {% endif %}
{{ plugin_preferences('privacy') }}
{{ tab_footer() }}
diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html
index 59874dab3..05cbc45d7 100644
--- a/searx/templates/simple/results.html
+++ b/searx/templates/simple/results.html
@@ -7,7 +7,7 @@
{% endfor %}
{% endfor %}
{%- endmacro %}
-{% block title %}{% if method == 'GET' %}{{- q|e -}} -{% endif %}{% endblock %}
+{% 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="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
{% block content %}
<nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav>