summaryrefslogtreecommitdiff
path: root/searx/templates/simple
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2019-12-29 09:47:06 +0100
committerGitHub <noreply@github.com>2019-12-29 09:47:06 +0100
commit36e72a46192235615f63a02984ab88c70145b0ec (patch)
tree0c2e238ed8fd03a95a090692d0d761fe2ea13d79 /searx/templates/simple
parentb2e1ee8d35050033b41765a2de49c0eea5f8b4b4 (diff)
parentf6d66c0f6f1d8f1f583d9000ee0123450cce8130 (diff)
Merge branch 'master' into fix-engine-spotify
Diffstat (limited to 'searx/templates/simple')
-rw-r--r--searx/templates/simple/base.html25
-rw-r--r--searx/templates/simple/infobox.html5
-rw-r--r--searx/templates/simple/result_templates/key-value.html11
-rw-r--r--searx/templates/simple/result_templates/torrent.html2
-rw-r--r--searx/templates/simple/results.html16
-rw-r--r--searx/templates/simple/search.html1
6 files changed, 40 insertions, 20 deletions
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
index 734dccbe8..92597b654 100644
--- a/searx/templates/simple/base.html
+++ b/searx/templates/simple/base.html
@@ -11,29 +11,26 @@
<meta name="HandheldFriendly" content="True">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
+ {% block meta %}{% endblock %}
{% if rtl %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searx-rtl.min.css') }}" type="text/css" media="screen" />
{% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searx.min.css') }}" type="text/css" media="screen" />
{% endif %}
{% block styles %}{% endblock %}
- {% block meta %}{% endblock %}
+ <!--[if gte IE 9]>-->
+ <script src="{{ url_for('static', filename='js/searx.head.min.js') }}"
+ data-method="{{ method or 'POST' }}"
+ data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"
+ 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>
+ <!--<![endif]-->
{% block head %}
<link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
{% endblock %}
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
- <script type="text/javascript">
- var searx = {
- autocompleter: {% if autocomplete %}true{% else %}false{% endif %},
- method: "{{ method or 'POST' }}",
- touch: (("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch) || false,
- staticPath: "{{ url_for('static', filename='themes/simple') }}/",
- noItemFound: "{{ _('No item found') }}",
- search_on_category_select: {{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}},
- infinite_scroll: {{ 'true' if 'plugins/js/infinite_scroll.js' in scripts else 'false' }}
- };
- document.getElementsByTagName("html")[0].className = (searx.touch)?"js touch":"js";
- </script>
</head>
<body>
<main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}">
@@ -60,7 +57,7 @@
</p>
</footer>
<!--[if gte IE 9]>-->
- <script src="{{ url_for('static', filename='js/searx.min.js') }}" ></script>
+ <script src="{{ url_for('static', filename='js/searx.min.js') }}"></script>
<!--<![endif]-->
</body>
</html>
diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html
index d99806ac4..50b568919 100644
--- a/searx/templates/simple/infobox.html
+++ b/searx/templates/simple/infobox.html
@@ -36,6 +36,11 @@
{% for suggestion in topic.suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<input type="hidden" name="q" value="{{ suggestion }}">
+ <input type="hidden" name="time_range" value="{{ time_range }}">
+ <input type="hidden" name="language" value="{{ current_language }}">
+ <input type="hidden" name="safesearch" value="{{ safesearch }}">
+ <input type="hidden" name="theme" value="{{ theme }}">
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
<input type="submit" value="{{ suggestion }}" />
</form>
{% endfor %}
diff --git a/searx/templates/simple/result_templates/key-value.html b/searx/templates/simple/result_templates/key-value.html
new file mode 100644
index 000000000..eebaa2c85
--- /dev/null
+++ b/searx/templates/simple/result_templates/key-value.html
@@ -0,0 +1,11 @@
+<table>
+ {% for key, value in result.items() %}
+ {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions'] %}
+ {% continue %}
+ {% endif %}
+ <tr>
+ <td><b>{{ key|upper }}</b>: {{ value }}</td>
+ </tr>
+ {% endfor %}
+</table>
+<div class="engines">{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}</div>{{- '' -}}
diff --git a/searx/templates/simple/result_templates/torrent.html b/searx/templates/simple/result_templates/torrent.html
index 3c7fd15e8..71c775bc9 100644
--- a/searx/templates/simple/result_templates/torrent.html
+++ b/searx/templates/simple/result_templates/torrent.html
@@ -6,7 +6,7 @@
{% if result.magnetlink %}<p class="altlink"> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</p>{% endif %}
{% if result.torrentfile %}<p class="altlink"> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</p>{% endif %}
-{% if result.seed %}<p class="stat"> &bull; {{ icon('arrow-swap') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>{% endif %}
+{% if result.seed is defined %}<p class="stat"> &bull; {{ icon('arrow-swap') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>{% endif %}
{%- if result.filesize %}<p class="stat">{{ icon('floppy-disk') }} {{ _('Filesize') }}<span class="badge">
{%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html
index a8e899e57..8885abc30 100644
--- a/searx/templates/simple/results.html
+++ b/searx/templates/simple/results.html
@@ -51,9 +51,11 @@
{% for suggestion in suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<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 }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}">
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
<input type="submit" class="suggestion" value="&bull; {{ suggestion.title }}">
</form>
{% endfor %}
@@ -63,7 +65,7 @@
<div id="search_url">
<h4 class="title">{{ _('Search URL') }} :</h4>
- <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 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 %}{% if timeout_limit %}&amp;timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div>
</div>
<div id="apis">
<h4 class="title">{{ _('Download results') }}</h4>
@@ -79,6 +81,7 @@
<input type="hidden" name="language" value="{{ current_language }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="format" value="{{ output_type }}">
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
<input type="submit" value="{{ output_type }}">
</form>
</div>
@@ -92,12 +95,13 @@
{% for correction in corrections %}
<div class="left">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation">
- <input type="hidden" name="q" value="{{ correction }}">
+ <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 }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}">
- <input type="submit" value="{{ correction }}">
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit }}" >{% endif %}
+ <input type="submit" value="{{ correction.title }}">
</form>
</div>
{% endfor %}
@@ -134,7 +138,8 @@
<input type="hidden" name="language" value="{{ current_language }}" >
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
<input type="hidden" name="theme" value="{{ theme }}" >
- <button type="submit">{{ icon_small('chevron-left') }} {{ _('previous page') }}</button>
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
+ <button type="submit">{{ icon_small('chevron-left') }} {{ _('previous page') }}</button>
</div>
</form>
{% endif %}
@@ -149,7 +154,8 @@
<input type="hidden" name="language" value="{{ current_language }}" >
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
<input type="hidden" name="theme" value="{{ theme }}" >
- <button type="submit">{{ _('next page') }} {{ icon_small('chevron-right') }}</button>
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
+ <button type="submit">{{ _('next page') }} {{ icon_small('chevron-right') }}</button>
</div>
</form>
</nav>
diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html
index 9c4a99b68..e9023b420 100644
--- a/searx/templates/simple/search.html
+++ b/searx/templates/simple/search.html
@@ -14,4 +14,5 @@
{% include 'simple/categories.html' %}
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
<input type="hidden" name="theme" value="{{ theme }}" >
+ {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
</form>