Add theme required fixes

This commit is contained in:
kvan7 2023-10-31 14:31:01 +00:00
parent 0058a112cc
commit 281d0aac91
40 changed files with 998 additions and 886 deletions

22
.vscode/settings.json vendored
View file

@ -1,11 +1,15 @@
{ {
"python.testing.unittestArgs": [ "python.testing.unittestArgs": [
"-v", "-v",
"-s", "-s",
"./tests", "./tests",
"-p", "-p",
"test_*.py" "test_*.py"
], ],
"python.testing.pytestEnabled": false, "python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true, "python.testing.unittestEnabled": true,
"[less]": {
"editor.tabSize": 2,
"editor.insertSpaces": true
}
} }

View file

@ -86,7 +86,7 @@ MANAGE += pyenv pyenv.install pyenv.uninstall
MANAGE += pypi.upload pypi.upload.test MANAGE += pypi.upload pypi.upload.test
MANAGE += format.python MANAGE += format.python
MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean
MANAGE += themes.all themes.simple themes.simple.test themes.kvanDark themes.kvanDark.test pygments.less MANAGE += themes.all themes.simple themes.simple.test themes.kvanDark themes.kvanDark.test themes.kvanDark.stylelint pygments.less
MANAGE += static.build.commit static.build.drop static.build.restore MANAGE += static.build.commit static.build.drop static.build.restore
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -145,7 +145,7 @@ module.exports = function (grunt) {
svgo: ['--config', 'svg4web.svgo.js'] svgo: ['--config', 'svg4web.svgo.js']
}, },
files: { files: {
'<%= _templates %>/simple/searxng-wordmark.min.svg': '<%= _brand %>/searxng-wordmark.svg', '<%= _templates %>/kvanDark/searxng-wordmark.min.svg': '<%= _brand %>/searxng-wordmark.svg',
'img/searxng.svg': '<%= _brand %>/searxng.svg', 'img/searxng.svg': '<%= _brand %>/searxng.svg',
'img/img_load_error.svg': '<%= _brand %>/img_load_error.svg' 'img/img_load_error.svg': '<%= _brand %>/img_load_error.svg'
} }
@ -192,7 +192,7 @@ module.exports = function (grunt) {
'heart-outline': 'node_modules/ionicons/dist/svg/heart-outline.svg', 'heart-outline': 'node_modules/ionicons/dist/svg/heart-outline.svg',
'information-circle-outline': 'src/svg/information-circle-outline.svg', 'information-circle-outline': 'src/svg/information-circle-outline.svg',
}, },
dest: '../../../templates/simple/icons.html', dest: '../../../templates/kvanDark/icons.html',
}, },
}, },
}); });
@ -229,7 +229,7 @@ module.exports = function (grunt) {
grunt.log.error(err); grunt.log.error(err);
} }
} }
const template = `{# this file was generated by searx/static/themes/simple/gruntfile.js #} const template = `{# this file was generated by searx/static/themes/kvanDark/gruntfile.js #}
{%- set icons = { {%- set icons = {
<% for (const iconName in icons) { %> '<%- iconName %>':'<%- icons[iconName] %>', <% for (const iconName in icons) { %> '<%- iconName %>':'<%- icons[iconName] %>',
<% } %> <% } %>

View file

@ -1,8 +1,8 @@
#main_results #results.image-detail-open.only_template_images { #main_kvanDark\/results #results.image-detail-open.only_template_images {
width: min(98%, 59.25rem) !important; width: min(98%, 59.25rem) !important;
} }
#main_results #results.only_template_images.image-detail-open #backToTop { #main_kvanDark\/results #results.only_template_images.image-detail-open #backToTop {
.ltr-left(56.75rem) !important; .ltr-left(56.75rem) !important;
.ltr-right(inherit); .ltr-right(inherit);
} }

View file

@ -1,4 +1,5 @@
#main_index { #main_index,
#main_kvanDark\/index {
margin-top: 26vh; margin-top: 26vh;
} }
@ -45,7 +46,8 @@
} }
} }
#main_index { #main_index,
#main_kvanDark\/index {
margin-top: 6em; margin-top: 6em;
} }
} }

View file

@ -15,7 +15,8 @@ table {
} }
} }
#main_preferences { #main_preferences,
#main_kvanDark\/preferences {
form { form {
width: 100%; width: 100%;
} }

View file

@ -248,7 +248,8 @@ html.no-js #clear_search.hide_if_nojs {
@media screen and (max-width: @tablet) and (hover: none) { @media screen and (max-width: @tablet) and (hover: none) {
#main_index, #main_index,
#main_results { #main_kvanDark\/index,
#main_kvanDark\/results {
#categories_container { #categories_container {
width: max-content; width: max-content;
@ -348,7 +349,7 @@ html.no-js #clear_search.hide_if_nojs {
} }
} }
#main_results #q:placeholder-shown ~ #send_search { #main_kvanDark\/results #q:placeholder-shown ~ #send_search {
.ltr-margin-right(2.6rem); .ltr-margin-right(2.6rem);
transition: margin 0.1s; transition: margin 0.1s;
} }

View file

@ -4,31 +4,31 @@ see the CSS rules for #results in style.less ( grid-template-columns and gap).
In this file, the --center-page-width values comes from the Oscar theme (Bootstrap 3). In this file, the --center-page-width values comes from the Oscar theme (Bootstrap 3).
All rules starts with ".center-aligment-yes #main_results" to be enabled only All rules starts with ".center-aligment-yes #main_kvanDark\/results" to be enabled only
on the /search URL and when the "center alignment" preference is enabled. on the /search URL and when the "center alignment" preference is enabled.
*/ */
@media screen and (min-width: @phone) { @media screen and (min-width: @phone) {
.center-aligment-yes #main_results { .center-aligment-yes #main_kvanDark\/results {
--center-page-width: 48rem; --center-page-width: 48rem;
} }
} }
@media screen and (min-width: 62rem) { @media screen and (min-width: 62rem) {
.center-aligment-yes #main_results { .center-aligment-yes #main_kvanDark\/results {
--center-page-width: 60rem; --center-page-width: 60rem;
} }
} }
@media screen and (min-width: @tablet) { @media screen and (min-width: @tablet) {
.center-aligment-yes #main_results { .center-aligment-yes #main_kvanDark\/results {
--center-page-width: 73rem; --center-page-width: 73rem;
} }
} }
@media screen and (min-width: @phone) and (max-width: @tablet) { @media screen and (min-width: @phone) and (max-width: @tablet) {
// any change must be reset in @media screen and (min-width: @tablet) { ... } // any change must be reset in @media screen and (min-width: @tablet) { ... }
.center-aligment-yes #main_results { .center-aligment-yes #main_kvanDark\/results {
#results { #results {
grid-template-columns: 60% calc(40% - @results-gap); grid-template-columns: 60% calc(40% - @results-gap);
margin-left: 0; margin-left: 0;
@ -50,7 +50,7 @@ on the /search URL and when the "center alignment" preference is enabled.
} }
@media screen and (min-width: @tablet) { @media screen and (min-width: @tablet) {
.center-aligment-yes #main_results { .center-aligment-yes #main_kvanDark\/results {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -86,7 +86,7 @@ on the /search URL and when the "center alignment" preference is enabled.
&.image-detail-open { &.image-detail-open {
// * grid-template-columns and .ltr-margin-left are set in style.less // * grid-template-columns and .ltr-margin-left are set in style.less
// * With .image-detail-open.only_template_images, the width is set in detail.less // * With .image-detail-open.only_template_images, the width is set in detail.less
// * #results is going to be centered because of the #main_results rules, // * #results is going to be centered because of the #main_kvanDark\/results rules,
// align-self aligns the results on the left or right according to the language. // align-self aligns the results on the left or right according to the language.
align-self: flex-start; align-self: flex-start;
} }

View file

@ -100,7 +100,7 @@
} }
// Image flexbox // Image flexbox
#main_results div#results.only_template_images #urls { #main_kvanDark\/results div#results.only_template_images #urls {
direction: rtl; direction: rtl;
} }
@ -136,6 +136,7 @@
// Logo on the right // Logo on the right
#main_preferences h1, #main_preferences h1,
#main_kvanDark\/preferences h1,
#main_stats h1 { #main_stats h1 {
background-position-x: 100%; background-position-x: 100%;
} }

View file

@ -917,7 +917,7 @@ summary.title {
margin: 2rem 0 0 0 !important; margin: 2rem 0 0 0 !important;
} }
#main_results div#results { #main_kvanDark\/results div#results {
margin: 0 auto; margin: 0 auto;
justify-content: center; justify-content: center;
display: grid; display: grid;
@ -963,7 +963,7 @@ summary.title {
/* Misc */ /* Misc */
#main_results div#results.only_template_images { #main_kvanDark\/results div#results.only_template_images {
margin: 1rem @results-tablet-offset 0 @results-tablet-offset; margin: 1rem @results-tablet-offset 0 @results-tablet-offset;
display: grid; display: grid;
grid-template-columns: 100%; grid-template-columns: 100%;
@ -1013,7 +1013,7 @@ summary.title {
background-color: var(--color-base-background-mobile); background-color: var(--color-base-background-mobile);
} }
#main_results div#results { #main_kvanDark\/results div#results {
grid-template-columns: 100%; grid-template-columns: 100%;
margin: 0 auto; margin: 0 auto;
} }
@ -1023,7 +1023,8 @@ summary.title {
.ltr-right(10px); .ltr-right(10px);
} }
#main_index #links_on_top { #main_index #links_on_top,
#main_kvanDark\/index {
top: 0.5rem; top: 0.5rem;
.ltr-right(0.5rem); .ltr-right(0.5rem);
} }

View file

@ -1,9 +1,10 @@
{% extends "simple/base.html" %} {% extends "kvanDark/base.html" %}
{% block content %} {% block content %}
<div class="center"> <div class="center">
<h1>{{ _('Page not found') }}</h1> <h1>{{ _('Page not found') }}</h1>
{% autoescape false %} {% autoescape false %}
<p>{{ _('Go to %(search_page)s.', search_page='<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'))) }}
{% endautoescape %} </p>
{% endautoescape %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,86 +1,100 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="no-js theme-{{ preferences.get_value('simple_style') or 'auto' }} center-aligment-{{ preferences.get_value('center_alignment') and 'yes' or 'no' }}" lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl"{% endif %}> <html
<head> class="no-js theme-{{ preferences.get_value('kvanDark_style') or 'dark' }} center-aligment-{{ preferences.get_value('center_alignment') and 'yes' or 'no' }}"
<meta charset="UTF-8" /> lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl" {% endif %}>
<meta name="description" content="SearXNG — a privacy-respecting, open 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="robots" content="noarchive">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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/searxng-rtl.min.css') }}" type="text/css" media="screen" />
{% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css" media="screen" />
{% endif %}
{% if get_setting('server.limiter') %}
<link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css" />
{% endif %}
{% block styles %}{% endblock %}
<!--[if gte IE 9]>-->
<script src="{{ url_for('static', filename='js/searxng.head.min.js') }}" client_settings="{{ client_settings }}"></script>
<!--<![endif]-->
{% block head %}
<link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
{% endblock %}
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}" sizes="any">
<link rel="icon" href="{{ url_for('static', filename='img/favicon.svg') }}" type="image/svg+xml">
</head>
<body class="{{ endpoint }}_endpoint" >
<main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}" class="{{body_class}}">
{% if errors %}
<div class="dialog-error" role="alert">
<a href="#" class="close" aria-label="close" title="close">×</a>
<ul>
{% for message in errors %}
<li>{{ message }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<nav id="links_on_top"> <head>
{%- from 'simple/icons.html' import icon_big -%} <meta charset="UTF-8" />
{%- block linkto_about -%} <meta name="description" content="SearXNG — a privacy-respecting, open metasearch engine">
<a href="{{ url_for('info', pagename='about') }}" class="link_on_top_about">{{ icon_big('information-circle-outline') }}<span>{{ _('About') }}</span></a> <meta name="keywords" content="SearXNG, search, search engine, metasearch, meta search">
{%- endblock -%} <meta name="generator" content="searxng/{{ searx_version }}">
{%- block linkto_donate -%} <meta name="referrer" content="no-referrer">
{%- if donation_url -%} <meta name="robots" content="noarchive">
<a href="{{ donation_url }}" class="link_on_top_donate">{{ icon_big('heart-outline') }}<span>{{ _('Donate') }}</span></a> <meta name="viewport" content="width=device-width, initial-scale=1">
{%- endif -%} <meta name="HandheldFriendly" content="True">
{%- endblock -%} <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
{%- block linkto_preferences -%} <title>{% block title %}{% endblock %}{{ instance_name }}</title>
<a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('menu-outline') }}<span>{{ _('Preferences') }}</span></a> {% block meta %}{% endblock %}
{%- endblock -%} {% if rtl %}
</nav> <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-rtl.min.css') }}" type="text/css"
{% block header %} media="screen" />
{% endblock %} {% else %}
{% block content %} <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css"
{% endblock %} media="screen" />
</main> {% endif %}
<footer> {% if get_setting('server.limiter') %}
<p> <link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css" />
{{ _('Powered by') }} <a href="{{ url_for('info', pagename='about') }}">searxng</a> - {{ searx_version }} — {{ _('a privacy-respecting, open metasearch engine') }}<br/> {% endif %}
<a href="{{ searx_git_url }}">{{ _('Source code') }}</a> {% block styles %}{% endblock %}
| <a href="{{ get_setting('brand.issue_url') }}">{{ _('Issue tracker') }}</a> <!--[if gte IE 9]>-->
{% if enable_metrics %}| <a href="{{ url_for('stats') }}">{{ _('Engine stats') }}</a>{% endif %} <script src="{{ url_for('static', filename='js/searxng.head.min.js') }}"
{% if get_setting('brand.public_instances') %} client_settings="{{ client_settings }}"></script>
| <a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a> <!--<![endif]-->
{% endif %} {% block head %}
{% if get_setting('general.privacypolicy_url') %} <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search"
| <a href="{{ get_setting('general.privacypolicy_url') }}">{{ _('Privacy policy') }}</a> href="{{ opensearch_url }}" />
{% endif %} {% endblock %}
{% if get_setting('general.contact_url') %} <link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}" sizes="any">
| <a href="{{ get_setting('general.contact_url') }}">{{ _('Contact instance maintainer') }}</a> <link rel="icon" href="{{ url_for('static', filename='img/favicon.svg') }}" type="image/svg+xml">
{% endif %} </head>
</p>
</footer> <body class="{{ endpoint }}_endpoint">
<!--[if gte IE 9]>--> <main id="main_{{ self._TemplateReference__context.name|replace(" kvanDark/", "" )|replace(".html", "" ) }}"
<script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script> class="{{body_class}}">
<!--<![endif]--> {% if errors %}
<div class="dialog-error" role="alert">
<a href="#" class="close" aria-label="close" title="close">×</a>
<ul>
{% for message in errors %}
<li>{{ message }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<nav id="links_on_top">
{%- from 'kvanDark/icons.html' import icon_big -%}
{%- block linkto_about -%}
<a href="{{ url_for('info', pagename='about') }}" class="link_on_top_about">{{
icon_big('information-circle-outline') }}<span>{{ _('About') }}</span></a>
{%- endblock -%}
{%- block linkto_donate -%}
{%- if donation_url -%}
<a href="{{ donation_url }}" class="link_on_top_donate">{{ icon_big('heart-outline') }}<span>{{ _('Donate')
}}</span></a>
{%- endif -%}
{%- endblock -%}
{%- block linkto_preferences -%}
<a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('menu-outline')
}}<span>{{ _('Preferences') }}</span></a>
{%- endblock -%}
</nav>
{% block header %}
{% endblock %}
{% block content %}
{% endblock %}
</main>
<footer>
<p>
{{ _('Powered by') }} <a href="{{ url_for('info', pagename='about') }}">searxng</a> - {{ searx_version }} —
{{ _('a privacy-respecting, open metasearch engine') }}<br />
<a href="{{ searx_git_url }}">{{ _('Source code') }}</a>
| <a href="{{ get_setting('brand.issue_url') }}">{{ _('Issue tracker') }}</a>
{% if enable_metrics %}| <a href="{{ url_for('stats') }}">{{ _('Engine stats') }}</a>{% endif %}
{% if get_setting('brand.public_instances') %}
| <a href="{{ get_setting('brand.public_instances') }}">{{ _('Public instances') }}</a>
{% endif %}
{% if get_setting('general.privacypolicy_url') %}
| <a href="{{ get_setting('general.privacypolicy_url') }}">{{ _('Privacy policy') }}</a>
{% endif %}
{% if get_setting('general.contact_url') %}
| <a href="{{ get_setting('general.contact_url') }}">{{ _('Contact instance maintainer') }}</a>
{% endif %}
</p>
</footer>
<!--[if gte IE 9]>-->
<script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script>
<!--<![endif]-->
</body> </body>
</html> </html>

View file

@ -1,37 +1,39 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
{%- set category_icons = { {%- set category_icons = {
'general': 'search-outline', 'general': 'search-outline',
'images': 'image-outline', 'images': 'image-outline',
'videos': 'play-outline', 'videos': 'play-outline',
'news': 'newspaper-outline', 'news': 'newspaper-outline',
'map': 'location-outline', 'map': 'location-outline',
'music': 'musical-notes-outline', 'music': 'musical-notes-outline',
'it': 'layers-outline', 'it': 'layers-outline',
'science': 'school-outline', 'science': 'school-outline',
'files': 'file-tray-full-outline', 'files': 'file-tray-full-outline',
'social media': 'people-outline', 'social media': 'people-outline',
} -%} } -%}
<div id="categories" class="search_categories">{{- '' -}} <div id="categories" class="search_categories">{{- '' -}}
<div id="categories_container"> <div id="categories_container">
{%- if not search_on_category_select or not display_tooltip -%} {%- if not search_on_category_select or not display_tooltip -%}
{%- for category in categories_as_tabs -%} {%- for category in categories_as_tabs -%}
<div class="category category_checkbox">{{- '' -}} <div class="category category_checkbox">{{- '' -}}
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/> <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips"> category in selected_categories %} checked="checked" {% endif %} />
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}} <label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
<div class="category_name">{{- _(category) -}}</div> {{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
</label> <div class="category_name">{{- _(category) -}}</div>
</div> </label>
{%- endfor -%} </div>
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%} {%- endfor -%}
{%- else -%} {%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
{%- for category in categories_as_tabs -%}{{- '\n' -}} {%- else -%}
<button type="submit" name="category_{{ category }}" class="category category_button {% if category in selected_categories %}selected{% endif %}"> {%- for category in categories_as_tabs -%}{{- '\n' -}}
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}} <button type="submit" name="category_{{ category }}"
<div class="category_name">{{- _(category) -}}</div>{{- '' -}} class="category category_button {% if category in selected_categories %}selected{% endif %}">
</button>{{- '' -}} {{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
{%- endfor -%} <div class="category_name">{{- _(category) -}}</div>{{- '' -}}
{{- '\n' -}} </button>{{- '' -}}
{%- endif -%} {%- endfor -%}
</div>{{- '' -}} {{- '\n' -}}
{%- endif -%}
</div>{{- '' -}}
</div> </div>

View file

@ -1,4 +1,4 @@
{# this file was generated by searx/static/themes/simple/gruntfile.js #} {# this file was generated by searx/static/themes/kvanDark/gruntfile.js #}
{%- set icons = { {%- set icons = {
'warning':'<svg class="ionicon" viewBox="0 0 512 512" aria-hidden="true"><path d="M256 80c-8.66 0-16.58 7.36-16 16l8 216a8 8 0 008 8h0a8 8 0 008-8l8-216c.58-8.64-7.34-16-16-16z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><circle cx="256" cy="416" r="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>', 'warning':'<svg class="ionicon" viewBox="0 0 512 512" aria-hidden="true"><path d="M256 80c-8.66 0-16.58 7.36-16 16l8 216a8 8 0 008 8h0a8 8 0 008-8l8-216c.58-8.64-7.34-16-16-16z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><circle cx="256" cy="416" r="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>',
'close':'<svg class="ionicon" viewBox="0 0 512 512" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"/></svg>', 'close':'<svg class="ionicon" viewBox="0 0 512 512" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"/></svg>',

View file

@ -1,8 +1,10 @@
{% extends "simple/base.html" %} {% extends "kvanDark/base.html" %}
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
{% block content %} {% block content %}
<div class="index"> <div class="index">
<div class="title"><h1>SearXNG</h1></div> <div class="title">
{% include 'simple/simple_search.html' %} <h1>SearXNG</h1>
</div>
{% include 'kvanDark/kvanDark_search.html' %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,16 +1,17 @@
{% extends 'simple/page_with_header.html' %} {% extends 'kvanDark/page_with_header.html' %}
{% block title %}{{ active_page.title }} - {% endblock %} {% block title %}{{ active_page.title }} - {% endblock %}
{% block linkto_about %}{% endblock %} {% block linkto_about %}{% endblock %}
{% block linkto_donate %}{% endblock %} {% block linkto_donate %}{% endblock %}
{% block content %} {% block content %}
<ul class="tabs"> <ul class="tabs">
{% for pagename, locale, page in all_pages %} {% for pagename, locale, page in all_pages %}
<li> <li>
<a href="{{ url_for('info', pagename=pagename, locale=locale) }}" {% if pagename == active_pagename %}class="active"{% endif %}>{{page.title}}</a> <a href="{{ url_for('info', pagename=pagename, locale=locale) }}" {% if pagename==active_pagename
</li> %}class="active" {% endif %}>{{page.title}}</a>
{% endfor %} </li>
{% endfor %}
</ul> </ul>
<div class="info-page {{pagename}}"> <div class="info-page {{pagename}}">
{{- active_page.html | safe -}} {{- active_page.html | safe -}}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,63 +1,70 @@
{% from 'simple/icons.html' import icon_small %} {% from 'kvanDark/icons.html' import icon_small %}
<!-- Draw favicon --> <!-- Draw favicon -->
{% macro draw_favicon(favicon) -%} {% macro draw_favicon(favicon) -%}
<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='themes/simple/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}"> <img width="14" height="14" class="favicon"
src="{{ url_for('static', filename='themes/kvanDark/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}">
{%- endmacro %} {%- endmacro %}
{% macro result_open_link(url, classes='') -%} {% macro result_open_link(url, classes='') -%}
<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}> <a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank"
{%- endmacro %} rel="noopener noreferrer" {% else %}rel="noreferrer" {% endif %}>
{%- endmacro %}
{%- macro result_close_link() -%} {%- macro result_close_link() -%}
</a> </a>
{%- endmacro %} {%- endmacro %}
{%- macro result_link(url, title, classes='') -%} {%- macro result_link(url, title, classes='') -%}
{{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }} {{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }}
{%- endmacro -%} {%- endmacro -%}
<!-- Draw result header --> <!-- Draw result header -->
{% macro result_header(result, favicons, image_proxify) -%} {% 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 %}{% for e in result.engines %} {{ e }}{% endfor %}"> <article
{{- result_open_link(result.url, "url_wrapper") -}} 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 %}">
{%- for part in get_pretty_url(result.parsed_url) -%} {{- result_open_link(result.url, "url_wrapper") -}}
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span> {%- for part in get_pretty_url(result.parsed_url) -%}
{%- endfor %} <span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
{{- result_close_link() -}} {%- endfor %}
{%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" loading="lazy" width="200" height="200">{{ result_close_link() }}{% endif -%} {{- result_close_link() -}}
{%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" loading="lazy" width="200" height="200">{{ result_close_link() }}{% endif -%} {%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image"
<h3>{{ result_link(result.url, result.title|safe) }}</h3> src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" loading="lazy" width="200"
{%- endmacro -%} height="200">{{ result_close_link() }}{% endif -%}
{%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail"
src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" loading="lazy" width="200"
height="200">{{ result_close_link() }}{% endif -%}
<h3>{{ result_link(result.url, result.title|safe) }}</h3>
{%- endmacro -%}
<!-- Draw result sub header --> <!-- Draw result sub header -->
{%- macro result_sub_header(result) -%} {%- macro result_sub_header(result) -%}
{%- if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%} {%- if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}">{{ result.publishedDate
{%- if result.length %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%} }}</time>{% endif -%}
{%- if result.author %}<div class="result_author">{{ _('Author') }}: {{ result.author }}</div>{% endif -%} {%- if result.length %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%}
{%- if result.metadata %}<div class="highlight">{{ result.metadata|safe }}</div>{% endif -%} {%- if result.author %}<div class="result_author">{{ _('Author') }}: {{ result.author }}</div>{% endif -%}
{%- endmacro -%} {%- if result.metadata %}<div class="highlight">{{ result.metadata|safe }}</div>{% endif -%}
{%- endmacro -%}
<!-- Draw result sub footer --> <!-- Draw result sub footer -->
{%- macro result_sub_footer(result, proxify) -%} {%- macro result_sub_footer(result, proxify) -%}
<div class="engines"> <div class="engines">
{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %} {% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}
{{ result_link(cache_url + result.url, icon_small('ellipsis-vertical-outline') + _('cached'), "cache_link") }}&lrm; {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %} {{ result_link(cache_url + result.url, icon_small('ellipsis-vertical-outline') + _('cached'), "cache_link")
</div>{{- '' -}} }}&lrm; {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'),
<div class="break"></div>{{- '' -}} "proxyfied_link") }} {% endif %}
{%- endmacro -%} </div>{{- '' -}}
<div class="break"></div>{{- '' -}}
{%- endmacro -%}
<!-- Draw result footer --> <!-- Draw result footer -->
{%- macro result_footer(result) -%} {%- macro result_footer(result) -%}
</article> </article>
{%- endmacro -%} {%- endmacro -%}
<!-- input checkbox, on/off slider user can tap--> <!-- input checkbox, on/off slider user can tap-->
{%- macro checkbox_onoff(name, checked) -%} {%- macro checkbox_onoff(name, checked) -%}
<input type="checkbox" {{- ' ' -}} <input type="checkbox" {{- ' ' -}} name="{{ name }}" {{- ' ' -}} id="{{ name }}" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}} aria-labelledby="pref_{{ name }}" {{- ' ' -}} class="checkbox-onoff" {{- ' ' -}} {%- if checked -%} checked{%- endif
id="{{ name }}" {{- ' ' -}} -%} />
aria-labelledby="pref_{{ name }}"{{- ' ' -}}
class="checkbox-onoff"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%} {%- endmacro -%}

View file

@ -1,5 +1,5 @@
{% from 'simple/icons.html' import icon %} {% from 'kvanDark/icons.html' import icon %}
<div class="alert alert-info fade in" role="alert"> <div class="alert alert-info fade in" role="alert">
<strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong> <strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong>
{{ _('currently, there are no cookies defined.') }} {{ _('currently, there are no cookies defined.') }}
</div> </div>

View file

@ -1,11 +1,11 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
<div class="dialog-error-block" role="alert"> <div class="dialog-error-block" role="alert">
<p><strong>{{ _('Sorry!') }}</strong></p> <p><strong>{{ _('Sorry!') }}</strong></p>
<p>{{ _("No results were found. You can try to:") }}</p> <p>{{ _("No results were found. You can try to:") }}</p>
<ul> <ul>
<li>{{ _("Refresh the page.") }}</li> <li>{{ _("Refresh the page.") }}</li>
<li>{{ _("Search for another query or select another category (above).") }}</li> <li>{{ _("Search for another query or select another category (above).") }}</li>
<li>{{ _("Change the search engine used in the preferences:") }} <a href="/preferences">/preferences</a></li> <li>{{ _("Change the search engine used in the preferences:") }} <a href="/preferences">/preferences</a></li>
<li>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li> <li>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li>
</ul> </ul>
</div> </div>

View file

@ -1,7 +1,7 @@
{%- set body_class = "page_with_header" -%} {%- set body_class = "page_with_header" -%}
{%- extends "simple/base.html" -%} {%- extends "kvanDark/base.html" -%}
{%- block header -%} {%- block header -%}
<a href="{{ url_for('index') }}">{{- '' -}} <a href="{{ url_for('index') }}">{{- '' -}}
<img class="logo" src="{{ url_for('static', filename='img/searxng.png') }}" alt="SearXNG">{{- '' -}} <img class="logo" src="{{ url_for('static', filename='img/searxng.png') }}" alt="SearXNG">{{- '' -}}
</a>{{- '' -}} </a>{{- '' -}}
{%- endblock -%} {%- endblock -%}

View file

@ -1,52 +1,52 @@
{%- from 'simple/icons.html' import icon_small, icon_big -%} {%- from 'kvanDark/icons.html' import icon_small, icon_big -%}
{%- extends "simple/page_with_header.html" -%} {%- extends "kvanDark/page_with_header.html" -%}
{%- macro tabs_open() -%} {%- macro tabs_open() -%}
<div class="tabs" role="tablist"> <div class="tabs" role="tablist">
{%- endmacro -%} {%- endmacro -%}
{%- macro tab_header(name, id, label, checked) -%} {%- macro tab_header(name, id, label, checked) -%}
<input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked"{% endif %} /> <input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked" {% endif
<label id="tab-label-{{ id }}" for="tab-{{ id }}" role="tab" aria-controls="tab-content-{{ id }}">{{ label }}</label> %} />
<section id="tab-content-{{ id }}" role="tabpanel" aria-labelledby="tab-label-{{ id }}" aria-hidden="false"> <label id="tab-label-{{ id }}" for="tab-{{ id }}" role="tab" aria-controls="tab-content-{{ id }}">{{ label
{%- endmacro -%} }}</label>
<section id="tab-content-{{ id }}" role="tabpanel" aria-labelledby="tab-label-{{ id }}" aria-hidden="false">
{%- endmacro -%}
{%- macro tab_footer() -%} {%- macro tab_footer() -%}
</section> </section>
{%- endmacro -%} {%- endmacro -%}
{%- macro tabs_close() -%} {%- macro tabs_close() -%}
</div> </div>
{%- endmacro -%} {%- endmacro -%}
{%- macro checkbox(name, checked, disabled) -%} {%- macro checkbox(name, checked, disabled) -%}
{%- if checked == '?' -%} {%- if checked == '?' -%}
{{- icon_small('warning') -}} {{- icon_small('warning') -}}
{%- else -%} {%- else -%}
<input type="checkbox" {%- if name %} name="{{ name }}" {%- endif %} value="None" {%- if checked %} checked {%- endif -%}{%- if disabled %} disabled {%- endif -%}/> <input type="checkbox" {%- if name %} name="{{ name }}" {%- endif %} value="None" {%- if checked %} checked {%- endif
{%- endif -%} -%}{%- if disabled %} disabled {%- endif -%} />
{%- endif -%}
{%- endmacro -%} {%- endmacro -%}
{%- macro checkbox_onoff_reversed(name, checked) -%} {%- macro checkbox_onoff_reversed(name, checked) -%}
<input type="checkbox" {{- ' ' -}} <input type="checkbox" {{- ' ' -}} name="{{ name }}" {{- ' ' -}} id="{{ name }}" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}} aria-labelledby="pref_{{ name }}" {{- ' ' -}} class="checkbox-onoff reversed-checkbox" {{- ' ' -}} {%- if checked
id="{{ name }}" {{- ' ' -}} -%} checked{%- endif -%} />
aria-labelledby="pref_{{ name }}"{{- ' ' -}}
class="checkbox-onoff reversed-checkbox"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%} {%- endmacro -%}
{%- macro plugin_preferences(section) -%} {%- macro plugin_preferences(section) -%}
{%- for plugin in plugins -%} {%- for plugin in plugins -%}
{%- if plugin.preference_section == section -%} {%- if plugin.preference_section == section -%}
<fieldset>{{- '' -}} <fieldset>{{- '' -}}
<legend>{{ _(plugin.name) }}</legend>{{- '' -}} <legend>{{ _(plugin.name) }}</legend>{{- '' -}}
<div class="value"> <div class="value">
{{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}} {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
</div>{{- '' -}} </div>{{- '' -}}
<div class="description"> <div class="description">
{{- _(plugin.description) -}} {{- _(plugin.description) -}}
</div>{{- '' -}} </div>{{- '' -}}
</fieldset> </fieldset>
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
@ -54,192 +54,187 @@
{%- macro engine_about(search_engine) -%} {%- macro engine_about(search_engine) -%}
{%- if search_engine.about is defined -%} {%- if search_engine.about is defined -%}
{%- set about = search_engine.about -%} {%- set about = search_engine.about -%}
<div class="engine-tooltip" role="tooltip">{{- '' -}} <div class="engine-tooltip" role="tooltip">{{- '' -}}
<p class="engine-description"></p>{{- '' -}} <p class="engine-description"></p>{{- '' -}}
<p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>{{- '' -}} <p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>{{- '' -}}
{%- if about.wikidata_id -%} {%- 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> <p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}"
{%- endif -%} rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>
{%- if search_engine.enable_http -%} {%- endif -%}
<p>{{- icon_big('exclamation-sign', 'No HTTPS') -}}{{- _('No HTTPS')-}}</p> {%- if search_engine.enable_http -%}
{% endif -%} <p>{{- icon_big('exclamation-sign', 'No HTTPS') -}}{{- _('No HTTPS')-}}</p>
{%- if reliabilities.get(search_engine.name, {}).errors or reliabilities.get(search_engine.name, {}).checker -%} {% endif -%}
<a href="{{ url_for('stats', engine=search_engine.name|e) }}" {{- ' ' -}} {%- if reliabilities.get(search_engine.name, {}).errors or reliabilities.get(search_engine.name, {}).checker -%}
title="{{ _('View error logs and submit a bug report') }}"> <a href="{{ url_for('stats', engine=search_engine.name|e) }}" {{- ' ' -}}
{{- _('View error logs and submit a bug report') -}} title="{{ _('View error logs and submit a bug report') }}">
</a> {{- _('View error logs and submit a bug report') -}}
{%- endif -%} </a>
<p>{{- '' -}} {%- endif -%}
<span class="right">{{ _("!bang for this engine") }}</span>{{- '' -}} <p>{{- '' -}}
{%- for bang in [search_engine.name] + [search_engine.shortcut] -%} <span class="right">{{ _("!bang for this engine") }}</span>{{- '' -}}
<span class="bang"> {{ '!' + bang.replace(' ', '_') }}</span> {%- for bang in [search_engine.name] + [search_engine.shortcut] -%}
{%- endfor -%} <span class="bang"> {{ '!' + bang.replace(' ', '_') }}</span>
</p>{{- '' -}} {%- endfor -%}
<p>{{- '' -}} </p>{{- '' -}}
<span class="right">{{ _("!bang for its categories") }}</span> <p>{{- '' -}}
{%- for bang in search_engine.categories -%} <span class="right">{{ _("!bang for its categories") }}</span>
<span class="bang">{{ '!' + bang.replace(' ', '_') }}</span> {%- for bang in search_engine.categories -%}
{%- endfor -%} <span class="bang">{{ '!' + bang.replace(' ', '_') }}</span>
</p>{{- '' -}} {%- endfor -%}
</div> </p>{{- '' -}}
</div>
{%- endif -%} {%- endif -%}
{%- endmacro -%} {%- endmacro -%}
{%- macro engine_time(engine_name) -%} {%- macro engine_time(engine_name) -%}
<td class="{{ label }}">{{- '' -}} <td class="{{ label }}">{{- '' -}}
{%- if stats[engine_name].time != None -%} {%- if stats[engine_name].time != None -%}
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- '' -}} <span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- '' -}}
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true"> <span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
{%- if max_rate95 is not none and max_rate95 > 0 -%} {%- 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-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>{{- '' -}} <div
<span class="stacked-bar-chart-rate100"></span> class="stacked-bar-chart-rate80 bar{{ (100 * ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95))|round }}">
{%- endif -%} </div>{{- '' -}}
</span>{{- '' -}} <div
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- '' -}} class="stacked-bar-chart-rate95 bar{{ (100 * ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95))|round }}">
<p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- '' -}} </div>{{- '' -}}
<p>{{ _('P80') }}: {{ stats[engine_name].rate80 }}</p>{{- '' -}} <span class="stacked-bar-chart-rate100"></span>
<p>{{ _('P95') }}: {{ stats[engine_name].rate95 }}</p>{{- '' -}} {%- endif -%}
</div> </span>{{- '' -}}
{%- endif -%} <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- '' -}}
</td> <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 -%} {%- endmacro -%}
{%- macro engine_reliability(engine_name) -%} {%- macro engine_reliability(engine_name) -%}
{%- set r = reliabilities.get(engine_name, {}).get('reliability', None) -%} {%- set r = reliabilities.get(engine_name, {}).get('reliability', None) -%}
{%- set checker_result = reliabilities.get(engine_name, {}).get('checker', []) -%} {%- set checker_result = reliabilities.get(engine_name, {}).get('checker', []) -%}
{%- set errors = reliabilities.get(engine_name, {}).get('errors', []) -%} {%- set errors = reliabilities.get(engine_name, {}).get('errors', []) -%}
{%- if r != None -%} {%- if r != None -%}
{%- if r <= 50 -%} {%- if r <= 50 -%} {% set label='danger' -%} {%- elif r < 80 -%} {%- set label='warning' -%} {%- elif r < 90 %} {%- set
{% set label = 'danger' -%} label='' -%} {%- else -%} {%- set label='success' -%} {%- endif -%} {% else %} {%- set r='' -%} {%- endif -%} {%- if
{%- elif r < 80 -%} checker_result or errors -%} <td class="{{ label }} column-reliability">{{- '' -}}
{%- set label = 'warning' -%} <a href="{{ url_for('stats', engine=engine_name|e) }}">{{- '' -}}
{%- elif r < 90 %} <span aria-labelledby="{{engine_name}}_reliability">
{%- set label = '' -%} {{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}}
{%- else -%} </span>{{- '' -}}
{%- set label = 'success' -%} </a>{{- '' -}}
{%- endif -%} <div class="engine-tooltip" role="tooltip" id="{{engine_name}}_reliability">
{% else %} {%- if checker_result -%}
{%- set r = '' -%} <p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p>
{%- endif -%} {%- endif -%}
{%- if checker_result or errors -%} {%- if errors -%}<p>{{ _('Errors:') }}</p>{%- endif -%}
<td class="{{ label }} column-reliability">{{- '' -}} {%- for error in errors -%}
<a href="{{ url_for('stats', engine=engine_name|e) }}">{{- '' -}} <p>{{ error }}</p>{{- '' -}}
<span aria-labelledby="{{engine_name}}_reliability"> {%- endfor -%}
{{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}} </div>{{- '' -}}
</span>{{- '' -}} </td>
</a>{{- '' -}} {%- else -%}
<div class="engine-tooltip" role="tooltip" id="{{engine_name}}_reliability"> <td class="{{ label }}">{% if r %}<span>{{ r }}</span>
{%- if checker_result -%} {%- endif -%}
<p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p> </td>
{%- endif -%} {%- endif -%}
{%- if errors -%}<p>{{ _('Errors:') }}</p>{%- endif -%} {%- endmacro -%}
{%- for error in errors -%}
<p>{{ error }}</p>{{- '' -}}
{%- endfor -%}
</div>{{- '' -}}
</td>
{%- else -%}
<td class="{{ label }}">{% if r %}<span>{{ r }}</span>
{%- endif -%}
</td>
{%- endif -%}
{%- endmacro -%}
{%- block head -%}{%- endblock -%} {%- block head -%}{%- endblock -%}
{%- block linkto_preferences -%}{%- endblock -%} {%- block linkto_preferences -%}{%- endblock -%}
{%- block content -%} {%- block content -%}
<h1>{{ _('Preferences') }}</h1> <h1>{{ _('Preferences') }}</h1>
<form id="search_form" method="post" action="{{ url_for('preferences') }}" autocomplete="off"> <form id="search_form" method="post" action="{{ url_for('preferences') }}" autocomplete="off">
{{- tabs_open() -}} {{- tabs_open() -}}
{{- tab_header('maintab', 'general', _('General'), True) -}} {{- tab_header('maintab', 'general', _('General'), True) -}}
{%- if 'categories' not in locked_preferences -%} {%- if 'categories' not in locked_preferences -%}
<fieldset> <fieldset>
<legend>{{- _('Default categories') -}}</legend> <legend>{{- _('Default categories') -}}</legend>
{% set display_tooltip = false %} {% set display_tooltip = false %}
{% include 'simple/categories.html' %} {% include 'kvanDark/categories.html' %}
</fieldset> </fieldset>
{%- endif -%} {%- endif -%}
{%- if 'language' not in locked_preferences -%} {%- if 'language' not in locked_preferences -%}
{%- include 'simple/preferences/language.html' -%} {%- include 'kvanDark/preferences/language.html' -%}
{% endif %} {% endif %}
{%- if 'autocomplete' not in locked_preferences -%} {%- if 'autocomplete' not in locked_preferences -%}
{%- include 'simple/preferences/autocomplete.html' -%} {%- include 'kvanDark/preferences/autocomplete.html' -%}
{%- endif -%} {%- endif -%}
{% if 'safesearch' not in locked_preferences %} {% if 'safesearch' not in locked_preferences %}
{%- include 'simple/preferences/safesearch.html' -%} {%- include 'kvanDark/preferences/safesearch.html' -%}
{%- endif -%} {%- endif -%}
{{- plugin_preferences('general') -}} {{- plugin_preferences('general') -}}
{%- if 'doi_resolver' not in locked_preferences %} {%- if 'doi_resolver' not in locked_preferences %}
{%- include 'simple/preferences/doi_resolver.html' -%} {%- include 'kvanDark/preferences/doi_resolver.html' -%}
{%- endif -%} {%- endif -%}
{%- include 'simple/preferences/tokens.html' -%} {%- include 'kvanDark/preferences/tokens.html' -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'ui', _('User interface')) -}} {{- tab_header('maintab', 'ui', _('User interface')) -}}
{%- if 'locale' not in locked_preferences -%} {%- if 'locale' not in locked_preferences -%}
{%- include 'simple/preferences/ui_locale.html' -%} {%- include 'kvanDark/preferences/ui_locale.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'theme' not in locked_preferences -%} {%- if 'theme' not in locked_preferences -%}
{%- include 'simple/preferences/theme.html' -%} {%- include 'kvanDark/preferences/theme.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'results_on_new_tab' not in locked_preferences -%} {%- if 'results_on_new_tab' not in locked_preferences -%}
{%- include 'simple/preferences/results_on_new_tab.html' -%} {%- include 'kvanDark/preferences/results_on_new_tab.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'infinite_scroll' not in locked_preferences -%} {%- if 'infinite_scroll' not in locked_preferences -%}
{%- include 'simple/preferences/infinite_scroll.html' -%} {%- include 'kvanDark/preferences/infinite_scroll.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'search_on_category_select' not in locked_preferences -%} {%- if 'search_on_category_select' not in locked_preferences -%}
{%- include 'simple/preferences/search_on_category_select.html' -%} {%- include 'kvanDark/preferences/search_on_category_select.html' -%}
{%- endif -%} {%- endif -%}
{%- include 'simple/preferences/hotkeys.html' -%} {%- include 'kvanDark/preferences/hotkeys.html' -%}
{{- plugin_preferences('ui') -}} {{- plugin_preferences('ui') -}}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'privacy', _('Privacy')) -}} {{- tab_header('maintab', 'privacy', _('Privacy')) -}}
{%- if 'method' not in locked_preferences -%} {%- if 'method' not in locked_preferences -%}
{%- include 'simple/preferences/method.html' -%} {%- include 'kvanDark/preferences/method.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'image_proxy' not in locked_preferences -%} {%- if 'image_proxy' not in locked_preferences -%}
{%- include 'simple/preferences/image_proxy.html' -%} {%- include 'kvanDark/preferences/image_proxy.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'query_in_title' not in locked_preferences -%} {%- if 'query_in_title' not in locked_preferences -%}
{%- include 'simple/preferences/query_in_title.html' -%} {%- include 'kvanDark/preferences/query_in_title.html' -%}
{%- endif -%} {%- endif -%}
{{- plugin_preferences('privacy') -}} {{- plugin_preferences('privacy') -}}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'engines', _('Engines')) -}} {{- tab_header('maintab', 'engines', _('Engines')) -}}
<p> <p>
{{- _('Currently used search engines') -}} {{- _('Currently used search engines') -}}
</p> </p>
{{- tabs_open() -}} {{- tabs_open() -}}
{%- include 'simple/preferences/engines.html' -%} {%- include 'kvanDark/preferences/engines.html' -%}
{{- tabs_close() -}} {{- tabs_close() -}}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'query', _('Special Queries')) -}} {{- tab_header('maintab', 'query', _('Special Queries')) -}}
{%- if answerers -%} {%- if answerers -%}
{%- include 'simple/preferences/answerers.html' -%} {%- include 'kvanDark/preferences/answerers.html' -%}
{%- endif -%} {%- endif -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'cookies', _('Cookies')) -}} {{- tab_header('maintab', 'cookies', _('Cookies')) -}}
{%- include 'simple/preferences/cookies.html' -%} {%- include 'kvanDark/preferences/cookies.html' -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tabs_close() -}} {{- tabs_close() -}}
{%- include 'simple/preferences/footer.html' -%} {%- include 'kvanDark/preferences/footer.html' -%}
</form>{{- '' -}} </form>{{- '' -}}
{%- endblock -%} {%- endblock -%}

View file

@ -1,45 +1,46 @@
<p class="text-muted"> <p class="text-muted">
{{- _('This is the list of cookies and their values SearXNG is storing on your computer.') }} {{- _('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 />{{- _('With that list, you can assess SearXNG transparency.') -}}
<br />{{- '' -}} <br />{{- '' -}}
</p> </p>
{% if cookies %} {% if cookies %}
<table class="cookies"> <table class="cookies">
<tr>{{- '' -}} <tr>{{- '' -}}
<th>{{ _('Cookie name') }}</th>{{- '' -}} <th>{{ _('Cookie name') }}</th>{{- '' -}}
<th>{{ _('Value') }}</th>{{- '' -}} <th>{{ _('Value') }}</th>{{- '' -}}
</tr> </tr>
{%- for cookie in cookies -%} {%- for cookie in cookies -%}
<tr>{{- '' -}} <tr>{{- '' -}}
<td>{{ cookie }}</td>{{- '' -}} <td>{{ cookie }}</td>{{- '' -}}
<td>{{ cookies[cookie] }}</td>{{- '' -}} <td>{{ cookies[cookie] }}</td>{{- '' -}}
</tr> </tr>
{%- endfor -%} {%- endfor -%}
</table> </table>
{%- else -%} {%- else -%}
{% include 'simple/messages/no_cookies.html' %} {% include 'kvanDark/messages/no_cookies.html' %}
{% endif %} {% endif %}
<h4> <h4>
{{- _('Search URL of the currently saved preferences') -}}:{{- '' -}} {{- _('Search URL of the currently saved preferences') -}}:{{- '' -}}
</h4>{{- '' -}} </h4>{{- '' -}}
<div class="selectable_url">{{- '' -}} <div class="selectable_url">{{- '' -}}
<pre> <pre>
{{- url_for('index', _external=True) -}}?preferences={{- preferences_url_params|e -}} {{- url_for('index', _external=True) -}}?preferences={{- preferences_url_params|e -}}
{%- raw -%}&amp;q=%s{%- endraw -%} {%- raw -%}&amp;q=%s{%- endraw -%}
</pre>{{- '' -}} </pre>{{- '' -}}
</div>{{- '' -}} </div>{{- '' -}}
<p class="small_font"> <p class="small_font">
{{- _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') -}} {{- _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result
sites.') -}}
</p> </p>
<h4> <h4>
{{- _('URL to restore your preferences in another browser') -}}:{{- '' -}} {{- _('URL to restore your preferences in another browser') -}}:{{- '' -}}
</h4>{{- '' -}} </h4>{{- '' -}}
<div class="selectable_url">{{- '' -}} <div class="selectable_url">{{- '' -}}
<pre> <pre>
{{- url_for('preferences', _external=True) -}}?preferences={{- preferences_url_params|e -}} {{- url_for('preferences', _external=True) -}}?preferences={{- preferences_url_params|e -}}
&amp;save=1{{- '' -}} &amp;save=1{{- '' -}}
</pre>{{- '' -}} </pre>{{- '' -}}
</div>{{- '' -}} </div>{{- '' -}}
<p class="small_font"> <p class="small_font">
{{- _('Specifying custom settings in the preferences URL can be used to sync preferences across devices.') -}} {{- _('Specifying custom settings in the preferences URL can be used to sync preferences across devices.') -}}
</p> </p>

View file

@ -14,12 +14,12 @@
</div>{{- '' -}} </div>{{- '' -}}
</fieldset>{{- '' -}} </fieldset>{{- '' -}}
<fieldset>{{- '' -}} <!-- <fieldset>{{- '' -}}
<legend id="pref_simple_style">{{- _('Theme style') -}}</legend>{{- '' -}} <legend id="pref_kvanDark_style">{{- _('Theme style') -}}</legend>{{- '' -}}
<div class="value">{{- '' -}} <div class="value">{{- '' -}}
<select name="simple_style" aria-labelledby="pref_simple_style"> <select name="kvanDark_style" aria-labelledby="pref_kvanDark_style">
{%- for name in ['auto', 'light', 'dark'] -%} {%- for name in ['auto', 'light', 'dark'] -%}
<option value="{{ name }}" {%- if name==preferences.get_value('simple_style') %} selected="selected" {%- <option value="{{ name }}" {%- if name==preferences.get_value('kvanDark_style') %} selected="selected" {%-
endif -%}> endif -%}>
{{- _(name) -}} {{- _(name) -}}
</option> </option>
@ -29,6 +29,6 @@
<div class="description"> <div class="description">
{{- _('Choose auto to follow your browser settings') -}} {{- _('Choose auto to follow your browser settings') -}}
</div>{{- '' -}} </div>{{- '' -}}
</fieldset>{{- '' -}} </fieldset>{{- '' -}} -->
{%- include 'simple/preferences/center_alignment.html' -%} {%- include 'kvanDark/preferences/center_alignment.html' -%}

View file

@ -1,31 +1,25 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
{%- if result.content -%} {%- if result.content -%}
<p class="content"> <p class="content">
{{- result.content|safe -}} {{- result.content|safe -}}
</p> </p>
{%- endif -%} {%- endif -%}
{%- if result.repository -%} {%- if result.repository -%}
<p class="content">{{- '' -}} <p class="content">{{- '' -}}
{{ _('repo') }}: {{- ' ' -}} {{ _('repo') }}: {{- ' ' -}}
<a href="{{ result.repository|safe }}"{{- ' ' -}} <a href="{{ result.repository|safe }}" {{- ' ' -}} {% if results_on_new_tab %} target="_blank" {{- ' ' -}}
{% if results_on_new_tab %} rel="noopener noreferrer" {%- else -%} rel="noreferrer" {%- endif -%}>
target="_blank" {{- ' ' -}} {{- result.repository -}}
rel="noopener noreferrer" </a>{{- '' -}}
{%- else -%} </p>
rel="noreferrer"
{%- endif -%}
>
{{- result.repository -}}
</a>{{- '' -}}
</p>
{%- endif -%} {%- endif -%}
<div dir="ltr" class="codelines"> <div dir="ltr" class="codelines">
{{- result.codelines|code_highlighter(result.code_language)|safe -}} {{- result.codelines|code_highlighter(result.code_language)|safe -}}
</div> </div>
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}

View file

@ -1,28 +1,32 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<p class="altlink"><a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p> <p class="altlink"><a class="btn-collapse collapsed media-loader disabled_if_nojs"
data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}"
data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p>
{%- endif %} {%- endif %}
{%- if result.content %} {%- if result.content %}
<p class="content"> <p class="content">
{{ result.content|safe }} {{ result.content|safe }}
</p> </p>
{%- else %} {%- else %}
<p class="content empty_element"> <p class="content empty_element">
{{ _('This site did not provide any description.')|safe }} {{ _('This site did not provide any description.')|safe }}
</p> </p>
{% endif -%} {% endif -%}
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<div id="result-media-{{ index }}" class="embedded-content invisible"> <div id="result-media-{{ index }}" class="embedded-content invisible">
<iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe> <iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe>
</div> </div>
{%- endif %} {%- endif %}
{% if result.audio_src -%} {% if result.audio_src -%}
<div id="result-media-{{ index }}" class="audio-control"> <div id="result-media-{{ index }}" class="audio-control">
<audio controls><source src="{{result.audio_src}}"></audio> <audio controls>
<source src="{{result.audio_src}}">
</audio>
</div> </div>
{%- endif %} {%- endif %}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

@ -1,5 +1,5 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{% from 'simple/icons.html' import icon_small %} {% from 'kvanDark/icons.html' import icon_small %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
@ -7,46 +7,61 @@
{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} {%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
<table> <table>
{%- if result.address -%} {%- if result.address -%}
<tr> <tr>
<th scope="row">{{ result.address_label or _('address') }}</th> <th scope="row">{{ result.address_label or _('address') }}</th>
<td itemscope itemtype="http://schema.org/PostalAddress"> <td itemscope itemtype="http://schema.org/PostalAddress">
{%- if result.address.name -%} {%- if result.address.name -%}
<strong itemprop="name" class="hidden">{{ result.address.name }}</strong> <strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
{%- endif -%} {%- endif -%}
{% if result.address.road -%} {% if result.address.road -%}
<span itemprop="streetAddress"> <span itemprop="streetAddress">
{%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %} {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %}
{{- result.address.road -}} {{- result.address.road -}}
</span><br/> </span><br />
{%- endif %} {%- endif %}
{%- if result.address.locality -%} {%- if result.address.locality -%}
<span itemprop="addressLocality">{{- result.address.locality -}}</span> <span itemprop="addressLocality">{{- result.address.locality -}}</span>
{%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %} {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{%
<br/> endif %}
{%- endif -%} <br />
{%- if result.address.country -%} {%- endif -%}
<span itemprop="addressCountry">{{- result.address.country -}}</span> {%- if result.address.country -%}
{%- endif -%} <span itemprop="addressCountry">{{- result.address.country -}}</span>
</td> {%- endif -%}
</tr> </td>
{%- endif %} </tr>
{%- for info in result.data -%} {%- endif %}
<tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr> {%- for info in result.data -%}
{%- endfor -%} <tr>
{%- for link in result.links -%} <th scope="row">{{ info.label }}</th>
<tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr> <td>{{ info.value|safe }}</td>
{%- endfor -%} </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> </table>
{%- if (result.latitude and result.longitude) or result.boundingbox -%} {%- if (result.latitude and result.longitude) or result.boundingbox -%}
<small> <a class="btn-collapse collapsed searxng_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_small( 'globe-outline') }} {{ _('show map') }}</a></small> <small> <a class="btn-collapse collapsed searxng_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_small( 'globe-outline') }} {{ _('show
map') }}</a></small>
{%- endif -%} {%- endif -%}
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{% if (result.latitude and result.longitude) or result.boundingbox -%} {% if (result.latitude and result.longitude) or result.boundingbox -%}
<div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" class="osm-map-box"></div></div> <div id="result-map-{{ index }}" class="invisible">
<div id="osm-map-{{ index }}" class="osm-map-box"></div>
</div>
{%- endif %} {%- endif %}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

@ -1,38 +1,50 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link
with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
<div class="attributes"> <div class="attributes">
{%- if result.publishedDate %}<div class="result_publishedDate"><span>{{ _("Published date") }}:</span><span><time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time></span></div>{% endif -%} {%- if result.publishedDate %}<div class="result_publishedDate"><span>{{ _("Published date") }}:</span><span><time
{%- if result.authors %}<div class="result_authors"><span>{{ _("Author") }}:</span><span>{{ result.authors | join(", ") }}</span></div>{% endif -%} class="published_date" datetime="{{ result.pubdate }}">{{ result.publishedDate }}</time></span></div>{%
{%- if result.journal -%} endif -%}
<div class="result_journal"> {%- if result.authors %}<div class="result_authors"><span>{{ _("Author") }}:</span><span>{{ result.authors | join(",
<span>{{- _("Journal") }}:</span><span>{{ result.journal -}} ") }}</span></div>{% endif -%}
{%- if result.volume -%} {%- if result.journal -%}
&nbsp;{{- result.volume -}} <div class="result_journal">
{%- if result.number -%} <span>{{- _("Journal") }}:</span><span>{{ result.journal -}}
.{{- result.number -}} {%- if result.volume -%}
{%- endif -%} &nbsp;{{- result.volume -}}
{%- endif -%} {%- if result.number -%}
{%- if result.pages -%} .{{- result.number -}}
&nbsp;{{- result.pages -}} {%- endif -%}
{%- endif -%} {%- endif -%}
</span> {%- if result.pages -%}
</div> &nbsp;{{- result.pages -}}
{%- endif %} {%- endif -%}
{%- if result.editor %}<div class="result_editor"><span>{{ _("Editor") }}:</span><span>{{ result.editor }}</span></div>{% endif -%} </span>
{%- if result.publisher %}<div class="result_publisher"><span>{{ _("Publisher") }}:</span><span>{{ result.publisher }}</span></div>{% endif -%} </div>
{%- if result.type %}<div class="result_type"><span>{{ _("Type") }}:</span><span>{{ result.type }}</span></div>{% endif -%} {%- endif %}
{%- if result.tags %}<div class="result_tags"><span>{{ _("Tags") }}:</span><span>{{ result.tags | join(", ")}}</span></div>{%- endif -%} {%- if result.editor %}<div class="result_editor"><span>{{ _("Editor") }}:</span><span>{{ result.editor }}</span>
{%- if result.doi %}<div class="result_doi"><span>{{ _("DOI") }}:</span><span>{{ result_link(doi_resolver + result.doi, result.doi) }}</span></div>{% endif -%} </div>{% endif -%}
{%- if result.issn %}<div class="result_issn"><span>{{ _("ISSN") }}:</span><span>{{ result.issn | join(", ") }}</span></div>{% endif -%} {%- if result.publisher %}<div class="result_publisher"><span>{{ _("Publisher") }}:</span><span>{{ result.publisher
{%- if result.isbn %}<div class="result_isbn"><span>{{ _("ISBN") }}:</span><span>{{ result.isbn | join(", ") }}</span></div>{% endif -%} }}</span></div>{% endif -%}
{%- if result.type %}<div class="result_type"><span>{{ _("Type") }}:</span><span>{{ result.type }}</span></div>{%
endif -%}
{%- if result.tags %}<div class="result_tags"><span>{{ _("Tags") }}:</span><span>{{ result.tags | join(",
")}}</span></div>{%- endif -%}
{%- if result.doi %}<div class="result_doi"><span>{{ _("DOI") }}:</span><span>{{ result_link(doi_resolver +
result.doi, result.doi) }}</span></div>{% endif -%}
{%- if result.issn %}<div class="result_issn"><span>{{ _("ISSN") }}:</span><span>{{ result.issn | join(", ")
}}</span></div>{% endif -%}
{%- if result.isbn %}<div class="result_isbn"><span>{{ _("ISBN") }}:</span><span>{{ result.isbn | join(", ")
}}</span></div>{% endif -%}
</div> </div>
{%- if result.content -%}<p class="content">{{- result.content | safe -}}</p>{%- endif -%} {%- if result.content -%}<p class="content">{{- result.content | safe -}}</p>{%- endif -%}
{%- if result.comments -%}<p class="comments">{{- result.comments -}}</p>{%- endif -%} {%- if result.comments -%}<p class="comments">{{- result.comments -}}</p>{%- endif -%}
<p class="altlink"> <p class="altlink">
{%- if result.pdf_url -%}{{ result_link(result.pdf_url, _('PDF')) }}{%- endif -%} {%- if result.pdf_url -%}{{ result_link(result.pdf_url, _('PDF')) }}{%- endif -%}
{%- if result.html_url -%}{{ result_link(result.html_url, _('HTML')) }}{%- endif -%} {%- if result.html_url -%}{{ result_link(result.html_url, _('HTML')) }}{%- endif -%}
{%- if result.doi %}{{ result_link('https://www.altmetric.com/details/doi/' + result.doi, 'Altmetric') }}{% endif -%} {%- if result.doi %}{{ result_link('https://www.altmetric.com/details/doi/' + result.doi, 'Altmetric') }}{% endif
-%}
</p> </p>
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

@ -1,4 +1,4 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
@ -6,9 +6,9 @@
{% if result.shipping %}<div class="result_shipping">{{ result.shipping }}</div></br>{% endif %} {% if result.shipping %}<div class="result_shipping">{{ result.shipping }}</div></br>{% endif %}
{% if result.source_country %}<div class="result_source_country">{{ result.source_country }}</div></br>{% endif %} {% if result.source_country %}<div class="result_source_country">{{ result.source_country }}</div></br>{% endif %}
{%- if result.content %} {%- if result.content %}
<p class="content"> <p class="content">
{{ result.content }} {{ result.content }}
</p> </p>
{% endif -%} {% endif -%}
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

@ -1,23 +1,29 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link
with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
{% if result.magnetlink %}<p class="altlink"> &bull; {{ result_link(result.magnetlink, icon_big('magnet-outline') + _('magnet link'), "magnetlink") }}</p>{% endif %} {% if result.magnetlink %}<p class="altlink"> &bull; {{ result_link(result.magnetlink, icon_big('magnet-outline') +
{% if result.torrentfile %}<p class="altlink"> &bull; {{ result_link(result.torrentfile, icon_big('download-alt') + _('torrent file'), "torrentfile") }}</p>{% endif %} _('magnet link'), "magnetlink") }}</p>{% endif %}
{% if result.torrentfile %}<p class="altlink"> &bull; {{ result_link(result.torrentfile, icon_big('download-alt') +
_('torrent file'), "torrentfile") }}</p>{% endif %}
{% if result.seed is defined %}<p class="stat"> &bull; {{ icon_big('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_big('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_big('floppy-disk') }} {{ _('Filesize') }}<span class="badge"> {%- if result.filesize %}<p class="stat">{{ icon_big('floppy-disk') }} {{ _('Filesize') }}<span class="badge">
{%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} {%- elif result.filesize < 1024*1024
{%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }} %}{{ '{0:0.2f}' .format(result.filesize/1024) }} {{ _('kiB') }} {%- elif result.filesize < 1024*1024*1024
{%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }} %}{{ '{0:0.2f}' .format(result.filesize/1024/1024) }} {{ _('MiB') }} {%- elif result.filesize <
{%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} 1024*1024*1024*1024 %}{{ '{0:0.2f}' .format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} {%- else
{%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} %}{{ '{0:0.2f}' .format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} </span>
</span></p> </p>
{%- endif -%} {%- endif -%}
{%- if result.files %}<p class="stat">{{ icon_big('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span></p>{% endif -%} {%- if result.files %}<p class="stat">{{ icon_big('file') }} {{ _('Number of Files') }} <span class="badge">{{
result.files }}</span></p>{% endif -%}
{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%} {%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}

View file

@ -1,24 +1,26 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) }} {{ result_header(result, favicons, image_proxify) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<p class="altlink"> <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p> <p class="altlink"> <a class="btn-collapse collapsed media-loader disabled_if_nojs"
data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}"
data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p>
{%- endif %} {%- endif %}
{%- if result.content %} {%- if result.content %}
<p class="content"> <p class="content">
{{ result.content|safe }} {{ result.content|safe }}
</p> </p>
{%- else %} {%- else %}
<p class="content empty_element"> <p class="content empty_element">
{{ _('This site did not provide any description.')|safe }} {{ _('This site did not provide any description.')|safe }}
</p> </p>
{% endif -%} {% endif -%}
</p> </p>
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<div id="result-video-{{ index }}" class="embedded-video invisible"> <div id="result-video-{{ index }}" class="embedded-video invisible">
<iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe> <iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe>
</div> </div>
{%- endif %} {%- endif %}
{{ result_footer(result) }} {{ result_footer(result) }}

View file

@ -1,175 +1,184 @@
{% extends "simple/base.html" %} {% extends "kvanDark/base.html" %}
{% from 'simple/icons.html' import icon, icon_big, icon_small %} {% from 'kvanDark/icons.html' import icon, icon_big, icon_small %}
{% macro engine_data_form(engine_data) -%} {% macro engine_data_form(engine_data) -%}
{% for engine_name, kv_data in engine_data.items() %} {% for engine_name, kv_data in engine_data.items() %}
{% for k, v in kv_data.items() %} {% for k, v in kv_data.items() %}
<input type="hidden" name="engine_data-{{ engine_name }}-{{ k|e }}" value="{{ v|e }}" /> <input type="hidden" name="engine_data-{{ engine_name }}-{{ k|e }}" value="{{ v|e }}" />
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{%- endmacro %} {%- endmacro %}
{% block title %}{% if query_in_title %}{{- 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 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 %} {% block content %}
{% include 'simple/search.html' %} {% include 'kvanDark/search.html' %}
{% if results and results|map(attribute='template')|unique|list|count == 1 %} {% if results and results|map(attribute='template')|unique|list|count == 1 %}
{% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %} {% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %}
{% else %} {% else %}
{% set only_template = '' %} {% set only_template = '' %}
{% endif %} {% endif %}
<div id="results" class="{{ only_template }}"> <div id="results" class="{{ only_template }}">
{% if answers -%} {% if answers -%}
<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4> <div id="answers" role="complementary" aria-labelledby="answers-title">
{%- for answer in answers.values() -%} <h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
<div class="answer"> {%- for answer in answers.values() -%}
<span>{{ answer.answer }}</span> <div class="answer">
{% if answer.url -%} <span>{{ answer.answer }}</span>
<a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a> {% if answer.url -%}
{% endif -%} <a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>
</div> {% endif -%}
{%- endfor -%} </div>
</div> {%- endfor -%}
{%- endif %} </div>
{%- endif %}
<div id="sidebar"> <div id="sidebar">
{%- if number_of_results != '0' -%} {%- if number_of_results != '0' -%}
<p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p> <p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
{%- endif -%} {%- endif -%}
{%- if infoboxes -%} {%- if infoboxes -%}
<div id="infoboxes"> <div id="infoboxes">
<details open class="sidebar-collapsable"> <details open class="sidebar-collapsable">
<summary class="title">{{ _('Info') }}</summary> <summary class="title">{{ _('Info') }}</summary>
{%- for infobox in infoboxes -%} {%- for infobox in infoboxes -%}
{%- include 'simple/elements/infobox.html' -%} {%- include 'kvanDark/elements/infobox.html' -%}
{%- endfor -%} {%- endfor -%}
</details> </details>
</div> </div>
{%- endif -%} {%- endif -%}
{%- if suggestions -%} {%- if suggestions -%}
{%- include 'simple/elements/suggestions.html' -%} {%- include 'kvanDark/elements/suggestions.html' -%}
{%- endif -%} {%- endif -%}
{%- if method == 'POST' -%} {%- if method == 'POST' -%}
{%- include 'simple/elements/search_url.html' -%} {%- include 'kvanDark/elements/search_url.html' -%}
{%- endif -%} {%- endif -%}
{%- if unresponsive_engines -%} {%- if unresponsive_engines -%}
{%- include 'simple/elements/engines_msg.html' -%} {%- include 'kvanDark/elements/engines_msg.html' -%}
{%- endif -%} {%- endif -%}
{%- if search_formats -%} {%- if search_formats -%}
{%- include 'simple/elements/apis.html' -%} {%- include 'kvanDark/elements/apis.html' -%}
{%- endif -%} {%- endif -%}
<div id="sidebar-end-collapsable"></div> <div id="sidebar-end-collapsable"></div>
</div> </div>
{% if corrections %} {% if corrections %}
<div id="corrections" role="complementary" aria-labelledby="corrections-title"> <div id="corrections" role="complementary" aria-labelledby="corrections-title">
<h4 id="corrections-title">{{ _('Try searching for:') }}</h4> <h4 id="corrections-title">{{ _('Try searching for:') }}</h4>
{% for correction in corrections %} {% for correction in corrections %}
<div class="left"> <div class="left">
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation"> <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation">
{% for category in selected_categories %} {% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1"> <input type="hidden" name="category_{{ category }}" value="1">
{% endfor %} {% endfor %}
<input type="hidden" name="q" value="{{ correction.url }}"> <input type="hidden" name="q" value="{{ correction.url }}">
<input type="hidden" name="language" value="{{ current_language }}"> <input type="hidden" name="language" value="{{ current_language }}">
<input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}"> <input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}"> <input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit }}" >{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit }}">{% endif %}
<input type="submit" role="link" value="{{ correction.title }}"> <input type="submit" role="link" value="{{ correction.title }}">
</form> </form>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div id="urls" role="main"> <div id="urls" role="main">
{% for result in results %} {% for result in results %}
{% if result.open_group and not only_template %}<div class="template_group_{{ result['template']|replace('.html', '') }}">{% endif %} {% if result.open_group and not only_template %}<div
{% set index = loop.index %} class="template_group_{{ result['template']|replace('.html', '') }}">{% endif %}
{% include get_result_template('simple', result['template']) %} {% set index = loop.index %}
{% if result.close_group and not only_template %}</div>{% endif %} {% include get_result_template('kvanDark', result['template']) %}
{% endfor %} {% if result.close_group and not only_template %}</div>{% endif %}
{% if not results and not answers %} {% endfor %}
{% include 'simple/messages/no_results.html' %} {% if not results and not answers %}
{% endif %} {% include 'kvanDark/messages/no_results.html' %}
</div> {% endif %}
<div id="backToTop"> </div>
<a href="#" aria-label="{{ _('Back to top') }}">{{ icon_small('chevron-up-outline') }}</a> <div id="backToTop">
</div> <a href="#" aria-label="{{ _('Back to top') }}">{{ icon_small('chevron-up-outline') }}</a>
{% if paging %} </div>
<nav id="pagination" role="navigation"> {% if paging %}
{% if pageno > 1 %} <nav id="pagination" role="navigation">
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="previous_page"> {% if pageno > 1 %}
<div class="{% if rtl %}right{% else %}left{% endif %}"> <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="previous_page">
<input type="hidden" name="q" value="{{ q|e }}" > <div class="{% if rtl %}right{% else %}left{% endif %}">
{% for category in selected_categories %} <input type="hidden" name="q" value="{{ q|e }}">
<input type="hidden" name="category_{{ category }}" value="1" > {% for category in selected_categories %}
{% endfor %} <input type="hidden" name="category_{{ category }}" value="1">
<input type="hidden" name="pageno" value="{{ pageno-1 }}" > {% endfor %}
<input type="hidden" name="language" value="{{ current_language }}" > <input type="hidden" name="pageno" value="{{ pageno-1 }}">
<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="time_range" value="{{ time_range }}">
<input type="hidden" name="theme" value="{{ theme }}" > <input type="hidden" name="safesearch" value="{{ safesearch }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} <input type="hidden" name="theme" value="{{ theme }}">
{{- engine_data_form(engine_data) -}} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
<button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button> %}
</div> {{- engine_data_form(engine_data) -}}
</form> <button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button>
{% endif %} </div>
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page"> </form>
<div class="{% if rtl %}left{% else %}right{% endif %}"> {% endif %}
<input type="hidden" name="q" value="{{ q|e }}" > <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page">
{% for category in selected_categories %} <div class="{% if rtl %}left{% else %}right{% endif %}">
<input type="hidden" name="category_{{ category }}" value="1" > <input type="hidden" name="q" value="{{ q|e }}">
{% endfor %} {% for category in selected_categories %}
<input type="hidden" name="pageno" value="{{ pageno+1 }}" > <input type="hidden" name="category_{{ category }}" value="1">
<input type="hidden" name="language" value="{{ current_language }}" > {% endfor %}
<input type="hidden" name="time_range" value="{{ time_range }}" > <input type="hidden" name="pageno" value="{{ pageno+1 }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}" > <input type="hidden" name="language" value="{{ current_language }}">
<input type="hidden" name="theme" value="{{ theme }}" > <input type="hidden" name="time_range" value="{{ time_range }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} <input type="hidden" name="safesearch" value="{{ safesearch }}">
{{- engine_data_form(engine_data) -}} <input type="hidden" name="theme" value="{{ theme }}">
<button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button> {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
</div> %}
</form> {{- engine_data_form(engine_data) -}}
{% set pstart = 1 %} <button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button>
{% set pend = 11 %} </div>
{% if pageno > 5 %} </form>
{% set pstart = pageno - 4 %} {% set pstart = 1 %}
{% set pend = pageno + 6 %} {% set pend = 11 %}
{% endif %} {% if pageno > 5 %}
{% set pstart = pageno - 4 %}
{% set pend = pageno + 6 %}
{% endif %}
<div class="numbered_pagination"> <div class="numbered_pagination">
{% for x in range(pstart, pend) %} {% for x in range(pstart, pend) %}
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="page_number"> <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="page_number">
<input type="hidden" name="q" value="{{ q|e }}" > <input type="hidden" name="q" value="{{ q|e }}">
{% for category in selected_categories %} {% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1" > <input type="hidden" name="category_{{ category }}" value="1">
{% endfor %} {% endfor %}
<input type="hidden" name="pageno" value="{{ x }}" > <input type="hidden" name="pageno" value="{{ x }}">
<input type="hidden" name="language" value="{{ current_language }}" > <input type="hidden" name="language" value="{{ current_language }}">
<input type="hidden" name="time_range" value="{{ time_range }}" > <input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}" > <input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}" > <input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
{{- engine_data_form(engine_data) -}} %}
{% if pageno == x %} {{- engine_data_form(engine_data) -}}
<input role="link" class="page_number_current" type="button" value="{{ x }}"> {% if pageno == x %}
{% else %} <input role="link" class="page_number_current" type="button" value="{{ x }}">
<input role="link" class="page_number" type="submit" value="{{ x }}"> {% else %}
{% endif %} <input role="link" class="page_number" type="submit" value="{{ x }}">
</form> {% endif %}
{% endfor %} </form>
</div> {% endfor %}
</nav> </div>
{% endif %} </nav>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,24 +1,30 @@
<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search"> <form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search">
<div id="search_header"> <div id="search_header">
<a id="search_logo" href="{{ url_for('index') }}" tabindex="0" title="{{ _('Display the front page') }}"> <a id="search_logo" href="{{ url_for('index') }}" tabindex="0" title="{{ _('Display the front page') }}">
<span hidden>SearXNG</span> <span hidden>SearXNG</span>
{% include 'simple/searxng-wordmark.min.svg' without context %} {% include 'kvanDark/searxng-wordmark.min.svg' without context %}
</a> </a>
<div id="search_view"> <div id="search_view">
<div class="search_box"> <div class="search_box">
<input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" autocapitalize="none" spellcheck="false" autocorrect="off" dir="auto" value="{{ q or '' }}"> <input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1"
<button id="clear_search" type="reset" aria-label="{{ _('clear') }}" class="hide_if_nojs"><span>{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> autocomplete="off" autocapitalize="none" spellcheck="false" autocorrect="off" dir="auto"
<button id="send_search" type="submit" {%- if search_on_category_select -%}name="category_{{ selected_categories[0]|replace(' ', '_') }}"{%- endif -%} aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> value="{{ q or '' }}">
</div> <button id="clear_search" type="reset" aria-label="{{ _('clear') }}" class="hide_if_nojs"><span>{{
</div> icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button>
{% set display_tooltip = true %} <button id="send_search" type="submit" {%- if search_on_category_select
{% include 'simple/categories.html' %} -%}name="category_{{ selected_categories[0]|replace(' ', '_') }}" {%- endif -%}
</div> aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline')
<div class="search_filters"> }}</span><span class="show_if_nojs">{{ _('search') }}</span></button>
{% include 'simple/filters/languages.html' %} </div>
{% include 'simple/filters/time_range.html' %} </div>
{% include 'simple/filters/safesearch.html' %} {% set display_tooltip = true %}
</div> {% include 'kvanDark/categories.html' %}
<input type="hidden" name="theme" value="{{ theme }}" > </div>
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} <div class="search_filters">
{% include 'kvanDark/filters/languages.html' %}
{% include 'kvanDark/filters/time_range.html' %}
{% include 'kvanDark/filters/safesearch.html' %}
</div>
<input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif %}
</form> </form>

View file

@ -1,148 +1,169 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
{% from 'simple/new_issue.html' import new_issue with context %} {% from 'kvanDark/new_issue.html' import new_issue with context %}
{% extends "simple/page_with_header.html" %} {% extends "kvanDark/page_with_header.html" %}
{%- macro th_sort(column_order, column_name) -%} {%- macro th_sort(column_order, column_name) -%}
{% if selected_engine_name %} {% if selected_engine_name %}
{{ column_name }} {{ column_name }}
{% elif column_order==sort_order %} {% elif column_order==sort_order %}
{{ column_name }} {{ icon_big('arrow-dropdown') }} {{ column_name }} {{ icon_big('arrow-dropdown') }}
{% else %} {% else %}
<a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}</a> <a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}</a>
{% endif %} {% endif %}
{%- endmacro -%} {%- endmacro -%}
{% block head %} {% endblock %} {% block head %} {% endblock %}
{% block content %} {% block content %}
<h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1> <h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if
selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1>
{% if not engine_stats.get('time') %} {% if not engine_stats.get('time') %}
{{ _('There is currently no data available. ') }} {{ _('There is currently no data available. ') }}
{% else %} {% else %}
<table class="engine-stats"> <table class="engine-stats">
<tr> <tr>
<th scope="col" class="engine-name">{{ th_sort('name', _("Engine name")) }}</th> <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="engine-score">{{ th_sort('score', _('Scores')) }}</th>
<th scope="col" class="result-count">{{ th_sort('result_count', _('Result count')) }}</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="response-time">{{ th_sort('time', _('Response time')) }}</th>
<th scope="col" class="engine-reliability">{{ th_sort('reliability', _('Reliability')) }}</th> <th scope="col" class="engine-reliability">{{ th_sort('reliability', _('Reliability')) }}</th>
</tr> </tr>
{% for engine_stat in engine_stats.get('time', []) %} {% for engine_stat in engine_stats.get('time', []) %}
<tr> <tr>
<td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a></td> <td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a>
<td class="engine-score"> </td>
{% if engine_stat.score %} <td class="engine-score">
<span>{{ engine_stat.score_per_result|round(1) }}</span> {% if engine_stat.score %}
{% endif %} <span>{{ engine_stat.score_per_result|round(1) }}</span>
</td> {% endif %}
<td class="engine-result-count"> </td>
{%- if engine_stat.result_count -%} <td class="engine-result-count">
{%- if engine_stat.result_count -%}
<div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}} <div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}}
<div class="bar-chart-graph" aria-hidden="true"> <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
</div> class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}">
{%- endif -%} </div>{{- "" -}}
</td> </div>
<td class="response-time"> {%- endif -%}
{%- if engine_stat.total is not none -%} </td>
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}} <td class="response-time">
<div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true"> {%- if engine_stat.total is not none -%}
{% 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 -%} <div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
{% 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 class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">
</div> {% if engine_stat.http is not none and engine_stats.max_time %}<div
<div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}} class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{%-
<table> endif -%}
<tr> {% if engine_stat.processing is not none and engine_stats.max_time %}<div
<th scope="col"></th> class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}">
<th scope="col">{{ _('Total') }}</th> </div>{%- endif -%}
<th scope="col">{{ _('HTTP') }}</th> </div>
<th scope="col">{{ _('Processing') }}</th> <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
</tr> <table>
<tr> <tr>
<th scope="col">{{ _('Median') }}</th> <th scope="col"></th>
<td>{{ engine_stat.total }}</td> <th scope="col">{{ _('Total') }}</th>
<td>{{ engine_stat.http or ''}}</td> <th scope="col">{{ _('HTTP') }}</th>
<td>{{ engine_stat.processing }}</td> <th scope="col">{{ _('Processing') }}</th>
</tr> </tr>
<tr> <tr>
<th scope="col">{{ _('P80') }}</th> <th scope="col">{{ _('Median') }}</th>
<td>{{ engine_stat.total_p80 }}</td> <td>{{ engine_stat.total }}</td>
<td>{{ engine_stat.http_p80 or '' }}</td> <td>{{ engine_stat.http or ''}}</td>
<td>{{ engine_stat.processing_p80 }}</td> <td>{{ engine_stat.processing }}</td>
</tr> </tr>
<tr> <tr>
<th scope="col">{{ _('P95') }}</th> <th scope="col">{{ _('P80') }}</th>
<td>{{ engine_stat.total_p95 }}</td> <td>{{ engine_stat.total_p80 }}</td>
<td>{{ engine_stat.http_p95 or '' }}</td> <td>{{ engine_stat.http_p80 or '' }}</td>
<td>{{ engine_stat.processing_p95 }}</td> <td>{{ engine_stat.processing_p80 }}</td>
</tr> </tr>
</table> <tr>
</div> <th scope="col">{{ _('P95') }}</th>
{%- endif -%} <td>{{ engine_stat.total_p95 }}</td>
</td> <td>{{ engine_stat.http_p95 or '' }}</td>
<td class="engine-reliability"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliability') }}</td> <td>{{ engine_stat.processing_p95 }}</td>
</tr> </tr>
{% endfor %} </table>
</div>
{%- endif -%}
</td>
<td class="engine-reliability"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliability') }}</td>
</tr>
{% endfor %}
</table> </table>
{% endif %} {% endif %}
{% if selected_engine_name %} {% if selected_engine_name %}
<div class="engine-errors"> <div class="engine-errors">
{% for secondary in [False, True] %} {% for secondary in [False, True] %}
{% set ns = namespace(first=true) %} {% set ns = namespace(first=true) %}
{% for error in engine_reliabilities[selected_engine_name].errors %} {% for error in engine_reliabilities[selected_engine_name].errors %}
{% if secondary == error.secondary %} {% if secondary == error.secondary %}
{% if ns.first %} {% if ns.first %}
{% set ns.first = false %} {% set ns.first = false %}
<h2>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h2> <h2>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h2>
{% endif %} {% endif %}
<table class="engine-error"> <table class="engine-error">
<tbody> <tbody>
<tr> <tr>
{%- if error.exception_classname -%} {%- if error.exception_classname -%}
<th scope="row" class="engine-error-type">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td> <th scope="row" class="engine-error-type">{{ _('Exception') }}</th>
{%- elif error.log_message -%} <td>{{ error.exception_classname }}</td>
<th scope="row" class="engine-error-type">{{ _('Message') }}</th><td>{{ error.log_message }}</td> {%- elif error.log_message -%}
{%- endif -%} <th scope="row" class="engine-error-type">{{ _('Message') }}</th>
<th scope="row" class="engine-error-type">{{ _('Percentage') }}</th><td class="engine-error-type">{{ error.percentage }}</td> <td>{{ error.log_message }}</td>
</tr> {%- endif -%}
{% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}} <th scope="row" class="engine-error-type">{{ _('Percentage') }}</th>
<td colspan="3"> <td class="engine-error-type">{{ error.percentage }}</td>
{%- for param in error.log_parameters -%} </tr>
<span class="log_parameters">{{ param }}</span> {% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr>
{%- endfor -%} <th scope="row">{{ _('Parameter') }}</th>{{- '' -}}
</td> <td colspan="3">
</tr> {%- for param in error.log_parameters -%}
{% endif %} <span class="log_parameters">{{ param }}</span>
<tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr> {%- endfor -%}
<tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr> </td>
<tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr> </tr>
</tbody> {% endif %}
</table> <tr>
{% endif %} <th scope="row">{{ _('Filename') }}</th>
{% endfor %} <td colspan="3">{{ error.filename }}:{{ error.line_no }}</td>
{% endfor %} </tr>
{% if engine_reliabilities[selected_engine_name].checker %} <tr>
<h3>{{ _('Checker') }}</h3> <th scope="row">{{ _('Function') }}</th>
<table> <td colspan="3">{{ error.function }}</td>
<tr> </tr>
<th scope="col" class="failed-test">{{ _('Failed test') }}</th> <tr>
<th scope="col">{{ _('Comment(s)') }}</th> <th scope="row">{{ _('Code') }}</th>
</tr> <td colspan="3">{{ error.code }}</td>
{% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %} </tr>
<tr> </tbody>
<td>{{ test_name }}</td> </table>
<td> {% endif %}
{% for r in results %}<p>{{ r }}</p>{% endfor %} {% endfor %}
</td> {% endfor %}
</tr> {% if engine_reliabilities[selected_engine_name].checker %}
{% endfor %} <h3>{{ _('Checker') }}</h3>
</table> <table>
{% endif %} <tr>
{{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }} <th scope="col" class="failed-test">{{ _('Failed test') }}</th>
</div> <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]) }}
</div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -44,6 +44,7 @@ node.clean() {
build_msg CLEAN "themes -- locally installed npm dependencies" build_msg CLEAN "themes -- locally installed npm dependencies"
( set -e ( set -e
npm --prefix searx/static/themes/simple run clean npm --prefix searx/static/themes/simple run clean
npm --prefix searx/static/themes/kvanDark run clean
) )
build_msg CLEAN "locally installed developer and CI tools" build_msg CLEAN "locally installed developer and CI tools"
( set -e ( set -e

View file

@ -15,6 +15,7 @@ themes.:
kvanDark.: kvanDark.:
build : build kvanDark theme build : build kvanDark theme
test : test kvanDark theme test : test kvanDark theme
stylelint : stylelint
EOF EOF
} }
@ -33,6 +34,9 @@ themes.live() {
case "${LIVE_THEME}" in case "${LIVE_THEME}" in
simple) simple)
theme="searx/static/themes/${LIVE_THEME}" theme="searx/static/themes/${LIVE_THEME}"
;;
kvanDark)
theme="searx/static/themes/${LIVE_THEME}"
;; ;;
'') '')
die_caller 42 "missing theme argument" die_caller 42 "missing theme argument"
@ -77,9 +81,14 @@ themes.kvanDark() {
} }
themes.kvanDark.test() { themes.kvanDark.test() {
build_msg TEST "theme: cystom" build_msg TEST "theme: kvanDark"
nodejs.ensure nodejs.ensure
npm --prefix searx/static/themes/kvanDark install npm --prefix searx/static/themes/kvanDark install
npm --prefix searx/static/themes/kvanDark run test npm --prefix searx/static/themes/kvanDark run test
dump_return $? dump_return $?
} }
themes.kvanDark.stylelint() {
npm --prefix searx/static/themes/kvanDark run stylelint
dump_return $?
}