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

View file

@ -8,4 +8,8 @@
], ],
"python.testing.pytestEnabled": false, "python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true, "python.testing.unittestEnabled": true,
"[less]": {
"editor.tabSize": 2,
"editor.insertSpaces": true
}
} }

View file

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="no-js theme-{{ preferences.get_value('simple_style') or 'auto' }} center-aligment-{{ preferences.get_value('center_alignment') and 'yes' or 'no' }}" lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl"{% endif %}> <html
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 %}>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="description" content="SearXNG — a privacy-respecting, open metasearch engine"> <meta name="description" content="SearXNG — a privacy-respecting, open metasearch engine">
@ -13,25 +16,31 @@
<title>{% block title %}{% endblock %}{{ instance_name }}</title> <title>{% block title %}{% endblock %}{{ instance_name }}</title>
{% block meta %}{% endblock %} {% block meta %}{% endblock %}
{% if rtl %} {% if rtl %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-rtl.min.css') }}" type="text/css" media="screen" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-rtl.min.css') }}" type="text/css"
media="screen" />
{% else %} {% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css" media="screen" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css"
media="screen" />
{% endif %} {% endif %}
{% if get_setting('server.limiter') %} {% if get_setting('server.limiter') %}
<link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css" /> <link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css" />
{% endif %} {% endif %}
{% block styles %}{% endblock %} {% block styles %}{% endblock %}
<!--[if gte IE 9]>--> <!--[if gte IE 9]>-->
<script src="{{ url_for('static', filename='js/searxng.head.min.js') }}" client_settings="{{ client_settings }}"></script> <script src="{{ url_for('static', filename='js/searxng.head.min.js') }}"
client_settings="{{ client_settings }}"></script>
<!--<![endif]--> <!--<![endif]-->
{% block head %} {% block head %}
<link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/> <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search"
href="{{ opensearch_url }}" />
{% endblock %} {% endblock %}
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}" sizes="any"> <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"> <link rel="icon" href="{{ url_for('static', filename='img/favicon.svg') }}" type="image/svg+xml">
</head> </head>
<body class="{{ endpoint }}_endpoint"> <body class="{{ endpoint }}_endpoint">
<main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}" class="{{body_class}}"> <main id="main_{{ self._TemplateReference__context.name|replace(" kvanDark/", "" )|replace(".html", "" ) }}"
class="{{body_class}}">
{% if errors %} {% if errors %}
<div class="dialog-error" role="alert"> <div class="dialog-error" role="alert">
<a href="#" class="close" aria-label="close" title="close">×</a> <a href="#" class="close" aria-label="close" title="close">×</a>
@ -44,17 +53,20 @@
{% endif %} {% endif %}
<nav id="links_on_top"> <nav id="links_on_top">
{%- from 'simple/icons.html' import icon_big -%} {%- from 'kvanDark/icons.html' import icon_big -%}
{%- block linkto_about -%} {%- block linkto_about -%}
<a href="{{ url_for('info', pagename='about') }}" class="link_on_top_about">{{ icon_big('information-circle-outline') }}<span>{{ _('About') }}</span></a> <a href="{{ url_for('info', pagename='about') }}" class="link_on_top_about">{{
icon_big('information-circle-outline') }}<span>{{ _('About') }}</span></a>
{%- endblock -%} {%- endblock -%}
{%- block linkto_donate -%} {%- block linkto_donate -%}
{%- if donation_url -%} {%- if donation_url -%}
<a href="{{ donation_url }}" class="link_on_top_donate">{{ icon_big('heart-outline') }}<span>{{ _('Donate') }}</span></a> <a href="{{ donation_url }}" class="link_on_top_donate">{{ icon_big('heart-outline') }}<span>{{ _('Donate')
}}</span></a>
{%- endif -%} {%- endif -%}
{%- endblock -%} {%- endblock -%}
{%- block linkto_preferences -%} {%- block linkto_preferences -%}
<a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('menu-outline') }}<span>{{ _('Preferences') }}</span></a> <a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('menu-outline')
}}<span>{{ _('Preferences') }}</span></a>
{%- endblock -%} {%- endblock -%}
</nav> </nav>
{% block header %} {% block header %}
@ -64,7 +76,8 @@
</main> </main>
<footer> <footer>
<p> <p>
{{ _('Powered by') }} <a href="{{ url_for('info', pagename='about') }}">searxng</a> - {{ searx_version }} — {{ _('a privacy-respecting, open metasearch engine') }}<br/> {{ _('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="{{ searx_git_url }}">{{ _('Source code') }}</a>
| <a href="{{ get_setting('brand.issue_url') }}">{{ _('Issue tracker') }}</a> | <a href="{{ get_setting('brand.issue_url') }}">{{ _('Issue tracker') }}</a>
{% if enable_metrics %}| <a href="{{ url_for('stats') }}">{{ _('Engine stats') }}</a>{% endif %} {% if enable_metrics %}| <a href="{{ url_for('stats') }}">{{ _('Engine stats') }}</a>{% endif %}
@ -83,4 +96,5 @@
<script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script> <script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script>
<!--<![endif]--> <!--<![endif]-->
</body> </body>
</html> </html>

View file

@ -1,4 +1,4 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
{%- set category_icons = { {%- set category_icons = {
'general': 'search-outline', 'general': 'search-outline',
'images': 'image-outline', 'images': 'image-outline',
@ -16,7 +16,8 @@
{%- if not search_on_category_select or not display_tooltip -%} {%- if not search_on_category_select or not display_tooltip -%}
{%- for category in categories_as_tabs -%} {%- for category in categories_as_tabs -%}
<div class="category category_checkbox">{{- '' -}} <div class="category category_checkbox">{{- '' -}}
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/> <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if
category in selected_categories %} checked="checked" {% endif %} />
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips"> <label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}} {{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div> <div class="category_name">{{- _(category) -}}</div>
@ -26,7 +27,8 @@
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%} {%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
{%- else -%} {%- else -%}
{%- for category in categories_as_tabs -%}{{- '\n' -}} {%- for category in categories_as_tabs -%}{{- '\n' -}}
<button type="submit" name="category_{{ category }}" class="category category_button {% if category in selected_categories %}selected{% endif %}"> <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') -}} {{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
<div class="category_name">{{- _(category) -}}</div>{{- '' -}} <div class="category_name">{{- _(category) -}}</div>{{- '' -}}
</button>{{- '' -}} </button>{{- '' -}}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
<div class="dialog-error-block" role="alert"> <div class="dialog-error-block" role="alert">
<p><strong>{{ _('Sorry!') }}</strong></p> <p><strong>{{ _('Sorry!') }}</strong></p>
<p>{{ _("No results were found. You can try to:") }}</p> <p>{{ _("No results were found. You can try to:") }}</p>

View file

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

View file

@ -1,13 +1,15 @@
{%- from 'simple/icons.html' import icon_small, icon_big -%} {%- from 'kvanDark/icons.html' import icon_small, icon_big -%}
{%- extends "simple/page_with_header.html" -%} {%- extends "kvanDark/page_with_header.html" -%}
{%- macro tabs_open() -%} {%- macro tabs_open() -%}
<div class="tabs" role="tablist"> <div class="tabs" role="tablist">
{%- endmacro -%} {%- endmacro -%}
{%- macro tab_header(name, id, label, checked) -%} {%- macro tab_header(name, id, label, checked) -%}
<input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked"{% endif %} /> <input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked" {% endif
<label id="tab-label-{{ id }}" for="tab-{{ id }}" role="tab" aria-controls="tab-content-{{ id }}">{{ label }}</label> %} />
<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"> <section id="tab-content-{{ id }}" role="tabpanel" aria-labelledby="tab-label-{{ id }}" aria-hidden="false">
{%- endmacro -%} {%- endmacro -%}
@ -23,17 +25,15 @@
{%- if checked == '?' -%} {%- if checked == '?' -%}
{{- icon_small('warning') -}} {{- icon_small('warning') -}}
{%- else -%} {%- else -%}
<input type="checkbox" {%- if name %} name="{{ name }}" {%- endif %} value="None" {%- if checked %} checked {%- endif -%}{%- if disabled %} disabled {%- endif -%}/> <input type="checkbox" {%- if name %} name="{{ name }}" {%- endif %} value="None" {%- if checked %} checked {%- endif
-%}{%- if disabled %} disabled {%- endif -%} />
{%- endif -%} {%- endif -%}
{%- endmacro -%} {%- endmacro -%}
{%- macro checkbox_onoff_reversed(name, checked) -%} {%- macro checkbox_onoff_reversed(name, checked) -%}
<input type="checkbox" {{- ' ' -}} <input type="checkbox" {{- ' ' -}} name="{{ name }}" {{- ' ' -}} id="{{ name }}" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}} aria-labelledby="pref_{{ name }}" {{- ' ' -}} class="checkbox-onoff reversed-checkbox" {{- ' ' -}} {%- if checked
id="{{ name }}" {{- ' ' -}} -%} checked{%- endif -%} />
aria-labelledby="pref_{{ name }}"{{- ' ' -}}
class="checkbox-onoff reversed-checkbox"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%} {%- endmacro -%}
{%- macro plugin_preferences(section) -%} {%- macro plugin_preferences(section) -%}
@ -59,7 +59,8 @@
<p class="engine-description"></p>{{- '' -}} <p class="engine-description"></p>{{- '' -}}
<p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>{{- '' -}} <p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>{{- '' -}}
{%- if about.wikidata_id -%} {%- if about.wikidata_id -%}
<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p> <p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}"
rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>
{%- endif -%} {%- endif -%}
{%- if search_engine.enable_http -%} {%- if search_engine.enable_http -%}
<p>{{- icon_big('exclamation-sign', 'No HTTPS') -}}{{- _('No HTTPS')-}}</p> <p>{{- icon_big('exclamation-sign', 'No HTTPS') -}}{{- _('No HTTPS')-}}</p>
@ -92,9 +93,14 @@
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- '' -}} <span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- '' -}}
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true"> <span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
{%- if max_rate95 is not none and max_rate95 > 0 -%} {%- if max_rate95 is not none and max_rate95 > 0 -%}
<div class="stacked-bar-chart-median bar{{ (100 * (stats[engine_name].time / max_rate95))|round }}"></div>{{- '' -}} <div class="stacked-bar-chart-median bar{{ (100 * (stats[engine_name].time / max_rate95))|round }}"></div>{{- ''
<div class="stacked-bar-chart-rate80 bar{{ (100 * ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95))|round }}"></div>{{- '' -}} -}}
<div class="stacked-bar-chart-rate95 bar{{ (100 * ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95))|round }}"></div>{{- '' -}} <div
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> <span class="stacked-bar-chart-rate100"></span>
{%- endif -%} {%- endif -%}
</span>{{- '' -}} </span>{{- '' -}}
@ -112,20 +118,9 @@
{%- set checker_result = reliabilities.get(engine_name, {}).get('checker', []) -%} {%- set checker_result = reliabilities.get(engine_name, {}).get('checker', []) -%}
{%- set errors = reliabilities.get(engine_name, {}).get('errors', []) -%} {%- set errors = reliabilities.get(engine_name, {}).get('errors', []) -%}
{%- if r != None -%} {%- if r != None -%}
{%- if r <= 50 -%} {%- if r <= 50 -%} {% set label='danger' -%} {%- elif r < 80 -%} {%- set label='warning' -%} {%- elif r < 90 %} {%- set
{% set label = 'danger' -%} label='' -%} {%- else -%} {%- set label='success' -%} {%- endif -%} {% else %} {%- set r='' -%} {%- endif -%} {%- if
{%- elif r < 80 -%} checker_result or errors -%} <td class="{{ label }} column-reliability">{{- '' -}}
{%- set label = 'warning' -%}
{%- 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) }}">{{- '' -}} <a href="{{ url_for('stats', engine=engine_name|e) }}">{{- '' -}}
<span aria-labelledby="{{engine_name}}_reliability"> <span aria-labelledby="{{engine_name}}_reliability">
{{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}} {{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}}
@ -164,56 +159,56 @@
<fieldset> <fieldset>
<legend>{{- _('Default categories') -}}</legend> <legend>{{- _('Default categories') -}}</legend>
{% set display_tooltip = false %} {% set display_tooltip = false %}
{% include 'simple/categories.html' %} {% include 'kvanDark/categories.html' %}
</fieldset> </fieldset>
{%- endif -%} {%- endif -%}
{%- if 'language' not in locked_preferences -%} {%- if 'language' not in locked_preferences -%}
{%- include 'simple/preferences/language.html' -%} {%- include 'kvanDark/preferences/language.html' -%}
{% endif %} {% endif %}
{%- if 'autocomplete' not in locked_preferences -%} {%- if 'autocomplete' not in locked_preferences -%}
{%- include 'simple/preferences/autocomplete.html' -%} {%- include 'kvanDark/preferences/autocomplete.html' -%}
{%- endif -%} {%- endif -%}
{% if 'safesearch' not in locked_preferences %} {% if 'safesearch' not in locked_preferences %}
{%- include 'simple/preferences/safesearch.html' -%} {%- include 'kvanDark/preferences/safesearch.html' -%}
{%- endif -%} {%- endif -%}
{{- plugin_preferences('general') -}} {{- plugin_preferences('general') -}}
{%- if 'doi_resolver' not in locked_preferences %} {%- if 'doi_resolver' not in locked_preferences %}
{%- include 'simple/preferences/doi_resolver.html' -%} {%- include 'kvanDark/preferences/doi_resolver.html' -%}
{%- endif -%} {%- endif -%}
{%- include 'simple/preferences/tokens.html' -%} {%- include 'kvanDark/preferences/tokens.html' -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'ui', _('User interface')) -}} {{- tab_header('maintab', 'ui', _('User interface')) -}}
{%- if 'locale' not in locked_preferences -%} {%- if 'locale' not in locked_preferences -%}
{%- include 'simple/preferences/ui_locale.html' -%} {%- include 'kvanDark/preferences/ui_locale.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'theme' not in locked_preferences -%} {%- if 'theme' not in locked_preferences -%}
{%- include 'simple/preferences/theme.html' -%} {%- include 'kvanDark/preferences/theme.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'results_on_new_tab' not in locked_preferences -%} {%- if 'results_on_new_tab' not in locked_preferences -%}
{%- include 'simple/preferences/results_on_new_tab.html' -%} {%- include 'kvanDark/preferences/results_on_new_tab.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'infinite_scroll' not in locked_preferences -%} {%- if 'infinite_scroll' not in locked_preferences -%}
{%- include 'simple/preferences/infinite_scroll.html' -%} {%- include 'kvanDark/preferences/infinite_scroll.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'search_on_category_select' not in locked_preferences -%} {%- if 'search_on_category_select' not in locked_preferences -%}
{%- include 'simple/preferences/search_on_category_select.html' -%} {%- include 'kvanDark/preferences/search_on_category_select.html' -%}
{%- endif -%} {%- endif -%}
{%- include 'simple/preferences/hotkeys.html' -%} {%- include 'kvanDark/preferences/hotkeys.html' -%}
{{- plugin_preferences('ui') -}} {{- plugin_preferences('ui') -}}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'privacy', _('Privacy')) -}} {{- tab_header('maintab', 'privacy', _('Privacy')) -}}
{%- if 'method' not in locked_preferences -%} {%- if 'method' not in locked_preferences -%}
{%- include 'simple/preferences/method.html' -%} {%- include 'kvanDark/preferences/method.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'image_proxy' not in locked_preferences -%} {%- if 'image_proxy' not in locked_preferences -%}
{%- include 'simple/preferences/image_proxy.html' -%} {%- include 'kvanDark/preferences/image_proxy.html' -%}
{%- endif -%} {%- endif -%}
{%- if 'query_in_title' not in locked_preferences -%} {%- if 'query_in_title' not in locked_preferences -%}
{%- include 'simple/preferences/query_in_title.html' -%} {%- include 'kvanDark/preferences/query_in_title.html' -%}
{%- endif -%} {%- endif -%}
{{- plugin_preferences('privacy') -}} {{- plugin_preferences('privacy') -}}
{{- tab_footer() -}} {{- tab_footer() -}}
@ -223,23 +218,23 @@
{{- _('Currently used search engines') -}} {{- _('Currently used search engines') -}}
</p> </p>
{{- tabs_open() -}} {{- tabs_open() -}}
{%- include 'simple/preferences/engines.html' -%} {%- include 'kvanDark/preferences/engines.html' -%}
{{- tabs_close() -}} {{- tabs_close() -}}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'query', _('Special Queries')) -}} {{- tab_header('maintab', 'query', _('Special Queries')) -}}
{%- if answerers -%} {%- if answerers -%}
{%- include 'simple/preferences/answerers.html' -%} {%- include 'kvanDark/preferences/answerers.html' -%}
{%- endif -%} {%- endif -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tab_header('maintab', 'cookies', _('Cookies')) -}} {{- tab_header('maintab', 'cookies', _('Cookies')) -}}
{%- include 'simple/preferences/cookies.html' -%} {%- include 'kvanDark/preferences/cookies.html' -%}
{{- tab_footer() -}} {{- tab_footer() -}}
{{- tabs_close() -}} {{- tabs_close() -}}
{%- include 'simple/preferences/footer.html' -%} {%- include 'kvanDark/preferences/footer.html' -%}
</form>{{- '' -}} </form>{{- '' -}}
{%- endblock -%} {%- endblock -%}

View file

@ -17,7 +17,7 @@
{%- endfor -%} {%- endfor -%}
</table> </table>
{%- else -%} {%- else -%}
{% include 'simple/messages/no_cookies.html' %} {% include 'kvanDark/messages/no_cookies.html' %}
{% endif %} {% endif %}
<h4> <h4>
{{- _('Search URL of the currently saved preferences') -}}:{{- '' -}} {{- _('Search URL of the currently saved preferences') -}}:{{- '' -}}
@ -29,7 +29,8 @@
</pre>{{- '' -}} </pre>{{- '' -}}
</div>{{- '' -}} </div>{{- '' -}}
<p class="small_font"> <p class="small_font">
{{- _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') -}} {{- _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result
sites.') -}}
</p> </p>
<h4> <h4>
{{- _('URL to restore your preferences in another browser') -}}:{{- '' -}} {{- _('URL to restore your preferences in another browser') -}}:{{- '' -}}

View file

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

View file

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

View file

@ -1,9 +1,11 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<p class="altlink"><a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p> <p class="altlink"><a class="btn-collapse collapsed media-loader disabled_if_nojs"
data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}"
data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p>
{%- endif %} {%- endif %}
{%- if result.content %} {%- if result.content %}
<p class="content"> <p class="content">
@ -22,7 +24,9 @@
{%- endif %} {%- endif %}
{% if result.audio_src -%} {% if result.audio_src -%}
<div id="result-media-{{ index }}" class="audio-control"> <div id="result-media-{{ index }}" class="audio-control">
<audio controls><source src="{{result.audio_src}}"></audio> <audio controls>
<source src="{{result.audio_src}}">
</audio>
</div> </div>
{%- endif %} {%- endif %}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

@ -1,5 +1,5 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{% from 'simple/icons.html' import icon_small %} {% from 'kvanDark/icons.html' import icon_small %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}
@ -22,7 +22,8 @@
{%- endif %} {%- endif %}
{%- if result.address.locality -%} {%- if result.address.locality -%}
<span itemprop="addressLocality">{{- result.address.locality -}}</span> <span itemprop="addressLocality">{{- result.address.locality -}}</span>
{%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %} {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{%
endif %}
<br /> <br />
{%- endif -%} {%- endif -%}
{%- if result.address.country -%} {%- if result.address.country -%}
@ -32,21 +33,35 @@
</tr> </tr>
{%- endif %} {%- endif %}
{%- for info in result.data -%} {%- for info in result.data -%}
<tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr> <tr>
<th scope="row">{{ info.label }}</th>
<td>{{ info.value|safe }}</td>
</tr>
{%- endfor -%} {%- endfor -%}
{%- for link in result.links -%} {%- 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> <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 -%} {%- endfor -%}
</table> </table>
{%- if (result.latitude and result.longitude) or result.boundingbox -%} {%- if (result.latitude and result.longitude) or result.boundingbox -%}
<small> <a class="btn-collapse collapsed searxng_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon_small( 'globe-outline') }} {{ _('show map') }}</a></small> <small> <a class="btn-collapse collapsed searxng_init_map hide_if_nojs" data-target="#result-map-{{ index }}"
data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}"
data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}"
data-map-lat="{{ result.latitude }}" {% if result.boundingbox
%}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}' {% endif %} {% if result.geojson
%}data-map-geojson='{{ result.geojson|tojson|safe }}' {% endif %}>{{ icon_small( 'globe-outline') }} {{ _('show
map') }}</a></small>
{%- endif -%} {%- endif -%}
{{- result_sub_footer(result, proxify) -}} {{- result_sub_footer(result, proxify) -}}
{% if (result.latitude and result.longitude) or result.boundingbox -%} {% if (result.latitude and result.longitude) or result.boundingbox -%}
<div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" class="osm-map-box"></div></div> <div id="result-map-{{ index }}" class="invisible">
<div id="osm-map-{{ index }}" class="osm-map-box"></div>
</div>
{%- endif %} {%- endif %}
{{- result_footer(result) }} {{- result_footer(result) }}

View file

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

View file

@ -1,4 +1,4 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) -}} {{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}} {{- result_sub_header(result) -}}

View file

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

View file

@ -1,9 +1,11 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} {% from 'kvanDark/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) }} {{ result_header(result, favicons, image_proxify) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if result.iframe_src -%} {% if result.iframe_src -%}
<p class="altlink"> <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p> <p class="altlink"> <a class="btn-collapse collapsed media-loader disabled_if_nojs"
data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}"
data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p>
{%- endif %} {%- endif %}
{%- if result.content %} {%- if result.content %}
<p class="content"> <p class="content">

View file

@ -1,5 +1,5 @@
{% extends "simple/base.html" %} {% extends "kvanDark/base.html" %}
{% from 'simple/icons.html' import icon, icon_big, icon_small %} {% from 'kvanDark/icons.html' import icon, icon_big, icon_small %}
{% macro engine_data_form(engine_data) -%} {% macro engine_data_form(engine_data) -%}
{% for engine_name, kv_data in engine_data.items() %} {% for engine_name, kv_data in engine_data.items() %}
{% for k, v in kv_data.items() %} {% for k, v in kv_data.items() %}
@ -8,9 +8,13 @@
{% endfor %} {% endfor %}
{%- endmacro %} {%- endmacro %}
{% block title %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %} {% block title %}{% if query_in_title %}{{- q|e }} - {% endif %}{% endblock %}
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %} {% block meta %}
<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}"
href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(" ,") |
replace(' ',' +') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language
}}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
{% block content %} {% block content %}
{% include 'simple/search.html' %} {% include 'kvanDark/search.html' %}
{% if results and results|map(attribute='template')|unique|list|count == 1 %} {% if results and results|map(attribute='template')|unique|list|count == 1 %}
{% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %} {% set only_template = 'only_template_' + results[0]['template']|default('default')|replace('.html', '') %}
@ -20,7 +24,8 @@
<div id="results" class="{{ only_template }}"> <div id="results" class="{{ only_template }}">
{% if answers -%} {% if answers -%}
<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4> <div id="answers" role="complementary" aria-labelledby="answers-title">
<h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
{%- for answer in answers.values() -%} {%- for answer in answers.values() -%}
<div class="answer"> <div class="answer">
<span>{{ answer.answer }}</span> <span>{{ answer.answer }}</span>
@ -43,26 +48,26 @@
<details open class="sidebar-collapsable"> <details open class="sidebar-collapsable">
<summary class="title">{{ _('Info') }}</summary> <summary class="title">{{ _('Info') }}</summary>
{%- for infobox in infoboxes -%} {%- for infobox in infoboxes -%}
{%- include 'simple/elements/infobox.html' -%} {%- include 'kvanDark/elements/infobox.html' -%}
{%- endfor -%} {%- endfor -%}
</details> </details>
</div> </div>
{%- endif -%} {%- endif -%}
{%- if suggestions -%} {%- if suggestions -%}
{%- include 'simple/elements/suggestions.html' -%} {%- include 'kvanDark/elements/suggestions.html' -%}
{%- endif -%} {%- endif -%}
{%- if method == 'POST' -%} {%- if method == 'POST' -%}
{%- include 'simple/elements/search_url.html' -%} {%- include 'kvanDark/elements/search_url.html' -%}
{%- endif -%} {%- endif -%}
{%- if unresponsive_engines -%} {%- if unresponsive_engines -%}
{%- include 'simple/elements/engines_msg.html' -%} {%- include 'kvanDark/elements/engines_msg.html' -%}
{%- endif -%} {%- endif -%}
{%- if search_formats -%} {%- if search_formats -%}
{%- include 'simple/elements/apis.html' -%} {%- include 'kvanDark/elements/apis.html' -%}
{%- endif -%} {%- endif -%}
<div id="sidebar-end-collapsable"></div> <div id="sidebar-end-collapsable"></div>
@ -92,13 +97,14 @@
<div id="urls" role="main"> <div id="urls" role="main">
{% for result in results %} {% for result in results %}
{% if result.open_group and not only_template %}<div class="template_group_{{ result['template']|replace('.html', '') }}">{% endif %} {% if result.open_group and not only_template %}<div
class="template_group_{{ result['template']|replace('.html', '') }}">{% endif %}
{% set index = loop.index %} {% set index = loop.index %}
{% include get_result_template('simple', result['template']) %} {% include get_result_template('kvanDark', result['template']) %}
{% if result.close_group and not only_template %}</div>{% endif %} {% if result.close_group and not only_template %}</div>{% endif %}
{% endfor %} {% endfor %}
{% if not results and not answers %} {% if not results and not answers %}
{% include 'simple/messages/no_results.html' %} {% include 'kvanDark/messages/no_results.html' %}
{% endif %} {% endif %}
</div> </div>
<div id="backToTop"> <div id="backToTop">
@ -118,7 +124,8 @@
<input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}"> <input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}"> <input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
%}
{{- engine_data_form(engine_data) -}} {{- engine_data_form(engine_data) -}}
<button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button> <button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button>
</div> </div>
@ -135,7 +142,8 @@
<input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}"> <input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}"> <input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
%}
{{- engine_data_form(engine_data) -}} {{- engine_data_form(engine_data) -}}
<button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button> <button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button>
</div> </div>
@ -159,7 +167,8 @@
<input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="safesearch" value="{{ safesearch }}"> <input type="hidden" name="safesearch" value="{{ safesearch }}">
<input type="hidden" name="theme" value="{{ theme }}"> <input type="hidden" name="theme" value="{{ theme }}">
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}">{% endif
%}
{{- engine_data_form(engine_data) -}} {{- engine_data_form(engine_data) -}}
{% if pageno == x %} {% if pageno == x %}
<input role="link" class="page_number_current" type="button" value="{{ x }}"> <input role="link" class="page_number_current" type="button" value="{{ x }}">

View file

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

View file

@ -1,7 +1,7 @@
{% from 'simple/icons.html' import icon_big %} {% from 'kvanDark/icons.html' import icon_big %}
{% from 'simple/new_issue.html' import new_issue with context %} {% from 'kvanDark/new_issue.html' import new_issue with context %}
{% extends "simple/page_with_header.html" %} {% extends "kvanDark/page_with_header.html" %}
{%- macro th_sort(column_order, column_name) -%} {%- macro th_sort(column_order, column_name) -%}
{% if selected_engine_name %} {% if selected_engine_name %}
@ -15,7 +15,8 @@
{% block head %} {% endblock %} {% block head %} {% endblock %}
{% block content %} {% block content %}
<h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1> <h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if
selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1>
{% if not engine_stats.get('time') %} {% if not engine_stats.get('time') %}
{{ _('There is currently no data available. ') }} {{ _('There is currently no data available. ') }}
@ -30,7 +31,8 @@
</tr> </tr>
{% for engine_stat in engine_stats.get('time', []) %} {% for engine_stat in engine_stats.get('time', []) %}
<tr> <tr>
<td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a></td> <td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a>
</td>
<td class="engine-score"> <td class="engine-score">
{% if engine_stat.score %} {% if engine_stat.score %}
<span>{{ engine_stat.score_per_result|round(1) }}</span> <span>{{ engine_stat.score_per_result|round(1) }}</span>
@ -41,7 +43,9 @@
<div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}} <div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}}
<div class="bar-chart-graph" aria-hidden="true"> <div class="bar-chart-graph" aria-hidden="true">
<div class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}"></div>{{- "" -}} <div
class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}">
</div>{{- "" -}}
</div> </div>
{%- endif -%} {%- endif -%}
</td> </td>
@ -49,8 +53,12 @@
{%- if engine_stat.total is not none -%} {%- if engine_stat.total is not none -%}
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}} <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"> <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.http is not none and engine_stats.max_time %}<div
{% if engine_stat.processing is not none and engine_stats.max_time %}<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{%- endif -%} 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>
<div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}} <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
<table> <table>
@ -102,13 +110,17 @@
<tbody> <tbody>
<tr> <tr>
{%- if error.exception_classname -%} {%- if error.exception_classname -%}
<th scope="row" class="engine-error-type">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td> <th scope="row" class="engine-error-type">{{ _('Exception') }}</th>
<td>{{ error.exception_classname }}</td>
{%- elif error.log_message -%} {%- elif error.log_message -%}
<th scope="row" class="engine-error-type">{{ _('Message') }}</th><td>{{ error.log_message }}</td> <th scope="row" class="engine-error-type">{{ _('Message') }}</th>
<td>{{ error.log_message }}</td>
{%- endif -%} {%- endif -%}
<th scope="row" class="engine-error-type">{{ _('Percentage') }}</th><td class="engine-error-type">{{ error.percentage }}</td> <th scope="row" class="engine-error-type">{{ _('Percentage') }}</th>
<td class="engine-error-type">{{ error.percentage }}</td>
</tr> </tr>
{% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}} {% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr>
<th scope="row">{{ _('Parameter') }}</th>{{- '' -}}
<td colspan="3"> <td colspan="3">
{%- for param in error.log_parameters -%} {%- for param in error.log_parameters -%}
<span class="log_parameters">{{ param }}</span> <span class="log_parameters">{{ param }}</span>
@ -116,9 +128,18 @@
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
<tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr> <tr>
<tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr> <th scope="row">{{ _('Filename') }}</th>
<tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr> <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> </tbody>
</table> </table>
{% endif %} {% endif %}

View file

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

View file

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