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": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"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 += format.python
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 += 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']
},
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/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',
'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);
}
}
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 = {
<% 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;
}
#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-right(inherit);
}

View file

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

View file

@ -15,7 +15,8 @@ table {
}
}
#main_preferences {
#main_preferences,
#main_kvanDark\/preferences {
form {
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) {
#main_index,
#main_results {
#main_kvanDark\/index,
#main_kvanDark\/results {
#categories_container {
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);
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).
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.
*/
@media screen and (min-width: @phone) {
.center-aligment-yes #main_results {
.center-aligment-yes #main_kvanDark\/results {
--center-page-width: 48rem;
}
}
@media screen and (min-width: 62rem) {
.center-aligment-yes #main_results {
.center-aligment-yes #main_kvanDark\/results {
--center-page-width: 60rem;
}
}
@media screen and (min-width: @tablet) {
.center-aligment-yes #main_results {
.center-aligment-yes #main_kvanDark\/results {
--center-page-width: 73rem;
}
}
@media screen and (min-width: @phone) and (max-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 {
grid-template-columns: 60% calc(40% - @results-gap);
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) {
.center-aligment-yes #main_results {
.center-aligment-yes #main_kvanDark\/results {
display: flex;
flex-direction: column;
align-items: center;
@ -86,7 +86,7 @@ on the /search URL and when the "center alignment" preference is enabled.
&.image-detail-open {
// * 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
// * #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: flex-start;
}

View file

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

View file

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

View file

@ -1,9 +1,10 @@
{% extends "simple/base.html" %}
{% extends "kvanDark/base.html" %}
{% block content %}
<div class="center">
<h1>{{ _('Page not found') }}</h1>
{% autoescape false %}
<p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}</p>
{% endautoescape %}
<h1>{{ _('Page not found') }}</h1>
{% autoescape false %}
<p>{{ _('Go to %(search_page)s.', search_page='<a href="{}">{}</a>'.format(url_for('index'), _('search page'))) }}
</p>
{% endautoescape %}
</div>
{% endblock %}
{% endblock %}

View file

@ -1,86 +1,100 @@
<!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 %}>
<head>
<meta charset="UTF-8" />
<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 %}
<html
class="no-js theme-{{ preferences.get_value('kvanDark_style') or 'dark' }} center-aligment-{{ preferences.get_value('center_alignment') and 'yes' or 'no' }}"
lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl" {% endif %}>
<nav id="links_on_top">
{%- from 'simple/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]-->
<head>
<meta charset="UTF-8" />
<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(" kvanDark/", "" )|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">
{%- 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>
</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 = {
'general': 'search-outline',
'images': 'image-outline',
'videos': 'play-outline',
'news': 'newspaper-outline',
'map': 'location-outline',
'music': 'musical-notes-outline',
'it': 'layers-outline',
'science': 'school-outline',
'files': 'file-tray-full-outline',
'social media': 'people-outline',
} -%}
'general': 'search-outline',
'images': 'image-outline',
'videos': 'play-outline',
'news': 'newspaper-outline',
'map': 'location-outline',
'music': 'musical-notes-outline',
'it': 'layers-outline',
'science': 'school-outline',
'files': 'file-tray-full-outline',
'social media': 'people-outline',
} -%}
<div id="categories" class="search_categories">{{- '' -}}
<div id="categories_container">
{%- if not search_on_category_select or not display_tooltip -%}
{%- for category in categories_as_tabs -%}
<div class="category category_checkbox">{{- '' -}}
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/>
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div>
</label>
</div>
{%- endfor -%}
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
{%- else -%}
{%- for category in categories_as_tabs -%}{{- '\n' -}}
<button type="submit" name="category_{{ category }}" class="category category_button {% if category in selected_categories %}selected{% endif %}">
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div>{{- '' -}}
</button>{{- '' -}}
{%- endfor -%}
{{- '\n' -}}
{%- endif -%}
</div>{{- '' -}}
</div>
<div id="categories_container">
{%- if not search_on_category_select or not display_tooltip -%}
{%- for category in categories_as_tabs -%}
<div class="category category_checkbox">{{- '' -}}
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if
category in selected_categories %} checked="checked" {% endif %} />
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div>
</label>
</div>
{%- endfor -%}
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
{%- else -%}
{%- for category in categories_as_tabs -%}{{- '\n' -}}
<button type="submit" name="category_{{ category }}"
class="category category_button {% if category in selected_categories %}selected{% endif %}">
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div>{{- '' -}}
</button>{{- '' -}}
{%- endfor -%}
{{- '\n' -}}
{%- endif -%}
</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 = {
'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>',

View file

@ -1,8 +1,10 @@
{% extends "simple/base.html" %}
{% from 'simple/icons.html' import icon_big %}
{% extends "kvanDark/base.html" %}
{% from 'kvanDark/icons.html' import icon_big %}
{% block content %}
<div class="index">
<div class="title"><h1>SearXNG</h1></div>
{% include 'simple/simple_search.html' %}
<div class="title">
<h1>SearXNG</h1>
</div>
{% include 'kvanDark/kvanDark_search.html' %}
</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 linkto_about %}{% endblock %}
{% block linkto_donate %}{% endblock %}
{% block content %}
<ul class="tabs">
{% for pagename, locale, page in all_pages %}
<li>
<a href="{{ url_for('info', pagename=pagename, locale=locale) }}" {% if pagename == active_pagename %}class="active"{% endif %}>{{page.title}}</a>
</li>
{% endfor %}
{% for pagename, locale, page in all_pages %}
<li>
<a href="{{ url_for('info', pagename=pagename, locale=locale) }}" {% if pagename==active_pagename
%}class="active" {% endif %}>{{page.title}}</a>
</li>
{% endfor %}
</ul>
<div class="info-page {{pagename}}">
{{- active_page.html | safe -}}
{{- active_page.html | safe -}}
</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 -->
{% 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 %}
{% 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 %}>
{%- endmacro %}
<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank"
rel="noopener noreferrer" {% else %}rel="noreferrer" {% endif %}>
{%- endmacro %}
{%- macro result_close_link() -%}
</a>
{%- macro result_close_link() -%}
</a>
{%- endmacro %}
{%- 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 -%}
<!-- Draw result header -->
{% macro result_header(result, favicons, image_proxify) -%}
<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}">
{{- result_open_link(result.url, "url_wrapper") -}}
{%- for part in get_pretty_url(result.parsed_url) -%}
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
{%- endfor %}
{{- result_close_link() -}}
{%- 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 -%}
{%- 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 -%}
<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 %}">
{{- result_open_link(result.url, "url_wrapper") -}}
{%- for part in get_pretty_url(result.parsed_url) -%}
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
{%- endfor %}
{{- result_close_link() -}}
{%- 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 -%}
{%- 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 -->
{%- macro result_sub_header(result) -%}
{%- if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%}
{%- if result.length %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%}
{%- if result.author %}<div class="result_author">{{ _('Author') }}: {{ result.author }}</div>{% endif -%}
{%- if result.metadata %}<div class="highlight">{{ result.metadata|safe }}</div>{% endif -%}
{%- endmacro -%}
<!-- Draw result sub header -->
{%- macro result_sub_header(result) -%}
{%- if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}">{{ result.publishedDate
}}</time>{% endif -%}
{%- if result.length %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%}
{%- if result.author %}<div class="result_author">{{ _('Author') }}: {{ result.author }}</div>{% endif -%}
{%- if result.metadata %}<div class="highlight">{{ result.metadata|safe }}</div>{% endif -%}
{%- endmacro -%}
<!-- Draw result sub footer -->
{%- macro result_sub_footer(result, proxify) -%}
<div class="engines">
{% 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 %}
</div>{{- '' -}}
<div class="break"></div>{{- '' -}}
{%- endmacro -%}
<!-- Draw result sub footer -->
{%- macro result_sub_footer(result, proxify) -%}
<div class="engines">
{% 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 %}
</div>{{- '' -}}
<div class="break"></div>{{- '' -}}
{%- endmacro -%}
<!-- Draw result footer -->
{%- macro result_footer(result) -%}
<!-- Draw result footer -->
{%- macro result_footer(result) -%}
</article>
{%- endmacro -%}
<!-- input checkbox, on/off slider user can tap-->
{%- macro checkbox_onoff(name, checked) -%}
<input type="checkbox" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}}
id="{{ name }}" {{- ' ' -}}
aria-labelledby="pref_{{ name }}"{{- ' ' -}}
class="checkbox-onoff"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%}
<input type="checkbox" {{- ' ' -}} name="{{ name }}" {{- ' ' -}} id="{{ name }}" {{- ' ' -}}
aria-labelledby="pref_{{ name }}" {{- ' ' -}} class="checkbox-onoff" {{- ' ' -}} {%- if checked -%} checked{%- endif
-%} />
{%- 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">
<strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong>
{{ _('currently, there are no cookies defined.') }}
</div>
<strong class="lead">{{ icon('info-sign') }} {{ _('Information!') }}</strong>
{{ _('currently, there are no cookies defined.') }}
</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">
<p><strong>{{ _('Sorry!') }}</strong></p>
<p>{{ _("No results were found. You can try to:") }}</p>
<ul>
<li>{{ _("Refresh the page.") }}</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>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li>
</ul>
</div>
<p><strong>{{ _('Sorry!') }}</strong></p>
<p>{{ _("No results were found. You can try to:") }}</p>
<ul>
<li>{{ _("Refresh the page.") }}</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>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li>
</ul>
</div>

View file

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

View file

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

View file

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

View file

@ -14,12 +14,12 @@
</div>{{- '' -}}
</fieldset>{{- '' -}}
<fieldset>{{- '' -}}
<legend id="pref_simple_style">{{- _('Theme style') -}}</legend>{{- '' -}}
<!-- <fieldset>{{- '' -}}
<legend id="pref_kvanDark_style">{{- _('Theme style') -}}</legend>{{- '' -}}
<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'] -%}
<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 -%}>
{{- _(name) -}}
</option>
@ -29,6 +29,6 @@
<div class="description">
{{- _('Choose auto to follow your browser settings') -}}
</div>{{- '' -}}
</fieldset>{{- '' -}}
</fieldset>{{- '' -}} -->
{%- include 'simple/preferences/center_alignment.html' -%}
{%- include 'kvanDark/preferences/center_alignment.html' -%}

View file

@ -1,32 +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_sub_header(result) -}}
{%- if result.content -%}
<p class="content">
{{- result.content|safe -}}
</p>
<p class="content">
{{- result.content|safe -}}
</p>
{%- endif -%}
{%- if result.repository -%}
<p class="content">{{- '' -}}
{{ _('repo') }}: {{- ' ' -}}
<a href="{{ result.repository|safe }}"{{- ' ' -}}
{% if results_on_new_tab %}
target="_blank" {{- ' ' -}}
rel="noopener noreferrer"
{%- else -%}
rel="noreferrer"
{%- endif -%}
>
{{- result.repository -}}
</a>{{- '' -}}
</p>
<p class="content">{{- '' -}}
{{ _('repo') }}: {{- ' ' -}}
<a href="{{ result.repository|safe }}" {{- ' ' -}} {% if results_on_new_tab %} target="_blank" {{- ' ' -}}
rel="noopener noreferrer" {%- else -%} rel="noreferrer" {%- endif -%}>
{{- result.repository -}}
</a>{{- '' -}}
</p>
{%- endif -%}
<div dir="ltr" class="codelines">
{{- result.codelines|code_highlighter(result.code_language)|safe -}}
{{- result.codelines|code_highlighter(result.code_language)|safe -}}
</div>
{{- result_sub_footer(result, proxify) -}}
{{- result_footer(result) -}}
{{- result_footer(result) -}}

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_sub_header(result) -}}
{% 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 %}
{%- if result.content %}
<p class="content">
{{ result.content|safe }}
</p>
<p class="content">
{{ result.content|safe }}
</p>
{%- else %}
<p class="content empty_element">
{{ _('This site did not provide any description.')|safe }}
</p>
<p class="content empty_element">
{{ _('This site did not provide any description.')|safe }}
</p>
{% endif -%}
{{- result_sub_footer(result, proxify) -}}
{% if result.iframe_src -%}
<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>
{%- endif %}
{% if result.audio_src -%}
<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>
{%- 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 'simple/icons.html' import icon_small %}
{% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{% from 'kvanDark/icons.html' import icon_small %}
{{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}}
@ -7,46 +7,61 @@
{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
<table>
{%- if result.address -%}
<tr>
<th scope="row">{{ result.address_label or _('address') }}</th>
<td itemscope itemtype="http://schema.org/PostalAddress">
{%- if result.address.name -%}
<strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
{%- endif -%}
{% if result.address.road -%}
<span itemprop="streetAddress">
{%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %}
{{- result.address.road -}}
</span><br/>
{%- endif %}
{%- if result.address.locality -%}
<span itemprop="addressLocality">{{- result.address.locality -}}</span>
{%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %}
<br/>
{%- endif -%}
{%- if result.address.country -%}
<span itemprop="addressCountry">{{- result.address.country -}}</span>
{%- endif -%}
</td>
</tr>
{%- endif %}
{%- for info in result.data -%}
<tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr>
{%- endfor -%}
{%- for link in result.links -%}
<tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr>
{%- endfor -%}
{%- if result.address -%}
<tr>
<th scope="row">{{ result.address_label or _('address') }}</th>
<td itemscope itemtype="http://schema.org/PostalAddress">
{%- if result.address.name -%}
<strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
{%- endif -%}
{% if result.address.road -%}
<span itemprop="streetAddress">
{%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %}
{{- result.address.road -}}
</span><br />
{%- endif %}
{%- if result.address.locality -%}
<span itemprop="addressLocality">{{- result.address.locality -}}</span>
{%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{%
endif %}
<br />
{%- endif -%}
{%- if result.address.country -%}
<span itemprop="addressCountry">{{- result.address.country -}}</span>
{%- endif -%}
</td>
</tr>
{%- endif %}
{%- for info in result.data -%}
<tr>
<th scope="row">{{ info.label }}</th>
<td>{{ info.value|safe }}</td>
</tr>
{%- endfor -%}
{%- for link in result.links -%}
<tr>
<th scope="row">{{ link.label }}</th>
<td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td>
</tr>
{%- endfor -%}
</table>
{%- 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 -%}
{{- result_sub_footer(result, proxify) -}}
{% 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 %}
{{- 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) -}}
<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.authors %}<div class="result_authors"><span>{{ _("Author") }}:</span><span>{{ result.authors | join(", ") }}</span></div>{% endif -%}
{%- if result.journal -%}
<div class="result_journal">
<span>{{- _("Journal") }}:</span><span>{{ result.journal -}}
{%- if result.volume -%}
&nbsp;{{- result.volume -}}
{%- if result.number -%}
.{{- result.number -}}
{%- endif -%}
{%- endif -%}
{%- if result.pages -%}
&nbsp;{{- result.pages -}}
{%- endif -%}
</span>
</div>
{%- endif %}
{%- if result.editor %}<div class="result_editor"><span>{{ _("Editor") }}:</span><span>{{ result.editor }}</span></div>{% endif -%}
{%- if result.publisher %}<div class="result_publisher"><span>{{ _("Publisher") }}:</span><span>{{ result.publisher }}</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 -%}
{%- 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.authors %}<div class="result_authors"><span>{{ _("Author") }}:</span><span>{{ result.authors | join(",
") }}</span></div>{% endif -%}
{%- if result.journal -%}
<div class="result_journal">
<span>{{- _("Journal") }}:</span><span>{{ result.journal -}}
{%- if result.volume -%}
&nbsp;{{- result.volume -}}
{%- if result.number -%}
.{{- result.number -}}
{%- endif -%}
{%- endif -%}
{%- if result.pages -%}
&nbsp;{{- result.pages -}}
{%- endif -%}
</span>
</div>
{%- endif %}
{%- if result.editor %}<div class="result_editor"><span>{{ _("Editor") }}:</span><span>{{ result.editor }}</span>
</div>{% endif -%}
{%- if result.publisher %}<div class="result_publisher"><span>{{ _("Publisher") }}:</span><span>{{ result.publisher
}}</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>
{%- if result.content -%}<p class="content">{{- result.content | safe -}}</p>{%- endif -%}
{%- if result.comments -%}<p class="comments">{{- result.comments -}}</p>{%- endif -%}
<p class="altlink">
{%- if result.pdf_url -%}{{ result_link(result.pdf_url, _('PDF')) }}{%- 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.pdf_url -%}{{ result_link(result.pdf_url, _('PDF')) }}{%- 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
-%}
</p>
{{- 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_sub_header(result) -}}
@ -6,9 +6,9 @@
{% 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.content %}
<p class="content">
{{ result.content }}
</p>
<p class="content">
{{ result.content }}
</p>
{% endif -%}
{{- result_sub_footer(result, proxify) -}}
{{- result_footer(result) }}
{{- result_footer(result) }}

View file

@ -1,24 +1,30 @@
{% 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_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.torrentfile %}<p class="altlink"> &bull; {{ result_link(result.torrentfile, icon_big('download-alt') + _('torrent file'), "torrentfile") }}</p>{% endif %}
{% if result.magnetlink %}<p class="altlink"> &bull; {{ result_link(result.magnetlink, icon_big('magnet-outline') +
_('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 < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
{%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
{%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
{%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
{%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
</span></p>
{%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} {%- elif result.filesize < 1024*1024
%}{{ '{0:0.2f}' .format(result.filesize/1024) }} {{ _('kiB') }} {%- elif result.filesize < 1024*1024*1024
%}{{ '{0:0.2f}' .format(result.filesize/1024/1024) }} {{ _('MiB') }} {%- elif result.filesize <
1024*1024*1024*1024 %}{{ '{0:0.2f}' .format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} {%- else
%}{{ '{0:0.2f}' .format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} </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.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 -%}
{{- result_sub_footer(result, proxify) -}}
{{- result_footer(result) }}
{{- result_footer(result) }}

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_sub_header(result) }}
{% 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 %}
{%- if result.content %}
<p class="content">
{{ result.content|safe }}
</p>
<p class="content">
{{ result.content|safe }}
</p>
{%- else %}
<p class="content empty_element">
{{ _('This site did not provide any description.')|safe }}
</p>
<p class="content empty_element">
{{ _('This site did not provide any description.')|safe }}
</p>
{% endif -%}
</p>
{{- result_sub_footer(result, proxify) -}}
{% if result.iframe_src -%}
<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>
{%- endif %}
{{ result_footer(result) }}
{{ result_footer(result) }}

View file

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

View file

@ -1,24 +1,30 @@
<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search">
<div id="search_header">
<a id="search_logo" href="{{ url_for('index') }}" tabindex="0" title="{{ _('Display the front page') }}">
<span hidden>SearXNG</span>
{% include 'simple/searxng-wordmark.min.svg' without context %}
</a>
<div id="search_view">
<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 '' }}">
<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>
<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>
</div>
</div>
{% set display_tooltip = true %}
{% include 'simple/categories.html' %}
</div>
<div class="search_filters">
{% include 'simple/filters/languages.html' %}
{% include 'simple/filters/time_range.html' %}
{% include 'simple/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>
<div id="search_header">
<a id="search_logo" href="{{ url_for('index') }}" tabindex="0" title="{{ _('Display the front page') }}">
<span hidden>SearXNG</span>
{% include 'kvanDark/searxng-wordmark.min.svg' without context %}
</a>
<div id="search_view">
<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 '' }}">
<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>
<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>
</div>
</div>
{% set display_tooltip = true %}
{% include 'kvanDark/categories.html' %}
</div>
<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>

View file

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

View file

@ -44,6 +44,7 @@ node.clean() {
build_msg CLEAN "themes -- locally installed npm dependencies"
( set -e
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"
( set -e

View file

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