summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorAlex <alex@al-f.net>2018-08-09 16:13:50 +0200
committerAlexandre Flament <alex@al-f.net>2018-08-14 17:21:30 +0200
commit3ba0d0516e5cabce8ebcc9a27c0fe069fa23f52c (patch)
treedffd7311f1bf9bba9386101c67f5e03c30a53116 /searx/templates
parent845ba79e7532dedad2bb96e5d68504b6729bee14 (diff)
downloadsearxng-3ba0d0516e5cabce8ebcc9a27c0fe069fa23f52c.tar.gz
searxng-3ba0d0516e5cabce8ebcc9a27c0fe069fa23f52c.zip
simple theme update
- npm package update - apply #1226 - implement vim help dialog - display cookies and search URL with preferences - allow to enable / disable Open Access DOI rewrite - add a clear text button on the left of the search button - implement #1011 : the HTML title page is not set when using POST - remove searx/static/themes/simple/img/loader.gif - use full width when only there are only images as result
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/simple/preferences.html52
-rw-r--r--searx/templates/simple/result_templates/map.html15
-rw-r--r--searx/templates/simple/results.html31
-rw-r--r--searx/templates/simple/search.html1
4 files changed, 75 insertions, 24 deletions
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index 4529fea8c..049af5e33 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -52,9 +52,9 @@
<p class="value">
<select name="autocomplete">
<option value=""> - </option>
- {% for backend in autocomplete_backends %}
+ {%- for backend in autocomplete_backends -%}
<option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
- {% endfor %}
+ {%- endfor -%}
</select>
</p>
<div class="description">{{ _('Find stuff as you type') }}</div>
@@ -71,6 +71,19 @@
<div class="description">{{ _('Filter content') }}</p>
</fieldset>
{{ plugin_preferences('general') }}
+ <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 %}>
+ {{- doi_resolver_name }} - {{ doi_resolver_url -}}
+ </option>
+ {%- endfor -%}
+ </select>
+ </p>
+ <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div>
+ </fieldset>
{{ tab_footer() }}
{{ tab_header('maintab', 'engines', _('Engines')) }}
@@ -151,6 +164,38 @@
{{ plugin_preferences('ui') }}
{{ tab_footer() }}
+ {{ tab_header('maintab', 'cookies', _('Cookies')) }}
+
+ <p class="text-muted" style="margin:20px 0;">
+ {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
+ {{ _('With that list, you can assess searx transparency.') }}<br />
+ </p>
+
+ {% if cookies %}
+ <table class="cookies">
+ <tr>
+ <th>{{ _('Cookie name') }}</th>
+ <th>{{ _('Value') }}</th>
+ </tr>
+ {% for cookie in cookies %}
+ <tr>
+ <td>{{ cookie }}</td>
+ <td>{{ cookies[cookie] }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% else %}
+ {% include 'oscar/messages/no_cookies.html' %}
+ {% endif %}
+
+ <h4>{{ _('Search URL of the currently saved preferences') }} :</h4>
+ <div class="selectable_url">
+ <pre>{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}</pre>
+ </div>
+ <p class="small_font">{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}</p>
+
+ {{ tab_footer() }}
+
{{ tab_header('maintab', 'privacy', _('Privacy')) }}
<fieldset>
<legend>{{ _('Method') }}</legend>
@@ -173,6 +218,7 @@
<div class="description">{{ _('Proxying image results through searx') }}</div>
</fieldset>
{{ plugin_preferences('privacy') }}
+
{{ tab_footer() }}
{{ tabs_close() }}
@@ -180,7 +226,7 @@
<p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
<br />
{{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
- </p>
+ </p>
<input type="submit" value="{{ _('save') }}" />
<div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div>
diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html
index 1fe0c86ac..2de445168 100644
--- a/searx/templates/simple/result_templates/map.html
+++ b/searx/templates/simple/result_templates/map.html
@@ -23,17 +23,17 @@
{%- endif -%}
{% if result.address.road -%}
<span itemprop="streetAddress">
- {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
- {{ result.address.road }}
+ {%- 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 %}
+ <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>
+ <span itemprop="addressCountry">{{- result.address.country -}}</span>
{%- endif -%}
</p>
{%- endif -%}
@@ -44,11 +44,8 @@
{% 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 }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
+ <div id="result-overpass-table-loading-{{ index }}"><div class="loader">{{ _('Loading...') }}</div></div>
<table id="result-overpass-table-{{ index }}">
- <thead>
- <tr><th>key</th><th>value</th></tr>
- </thead>
<tbody>
</tbody>
</table>
diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html
index 081118eaf..195c478db 100644
--- a/searx/templates/simple/results.html
+++ b/searx/templates/simple/results.html
@@ -1,18 +1,25 @@
{% extends "simple/base.html" %}
{% from 'simple/macros.html' import icon, icon_small %}
-{% block title %}{{ q|e }} - {% endblock %}
+{% 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 }}&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>
{% include 'simple/search.html' %}
-<div id="results">
- {% if answers %}
+
+{% if results and results|map(attribute='template')|unique|list|count == 1 %}
+ {% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %}
+{% else %}
+ {% set unique_template = '' %}
+{% endif %}
+
+<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>
- {%- endfor %}
+ {%- for answer in answers -%}
+ <div class="answer">{{- answer -}}</div>
+ {%- endfor -%}
</div>
- {% endif %}
+ {%- endif %}
<div id="sidebar">
@@ -24,16 +31,16 @@
<div class="dialog-error" role="alert">
<p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p>
<p>{% for engine_name, error_type in unresponsive_engines %}
- {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
+ {{- engine_name }} ({{- error_type -}}){% if not loop.last %}, {% endif %}
{% endfor %}</p>
</div>
{% endif %}
{% if infoboxes %}
<div id="infoboxes">
- {% for infobox in infoboxes %}
- {% include 'simple/infobox.html' %}
- {% endfor %}
+ {% for infobox in infoboxes -%}
+ {% include 'simple/infobox.html' %}
+ {%- endfor %}
</div>
{% endif %}
@@ -56,7 +63,7 @@
<div id="search_url">
<h4 class="title">{{ _('Search URL') }} :</h4>
- <div><pre>{{ base_url }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}</pre></div>
+ <div class="selectable_url"><pre>{{ base_url }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}</pre></div>
</div>
<div id="apis">
<h4 class="title">{{ _('Download results') }}</h4>
diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html
index 3f48d7fcd..9c4a99b68 100644
--- a/searx/templates/simple/search.html
+++ b/searx/templates/simple/search.html
@@ -2,6 +2,7 @@
<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 %} >
+ <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>
<div class="search_filters">