From 4f8703aae234df07da58f033c2a2d221b081d742 Mon Sep 17 00:00:00 2001 From: meaz Date: Sun, 17 Sep 2023 11:03:23 +0200 Subject: [PATCH] update templates --- beetroot_template/macros.html | 35 ++++--------------- beetroot_template/preferences.html | 2 +- beetroot_template/preferences/answerers.html | 22 ++++++------ .../preferences/center_alignment.html | 12 ++++--- beetroot_template/preferences/engines.html | 10 +++--- .../preferences/image_proxy.html | 14 +++++--- .../preferences/infinite_scroll.html | 12 ++++--- .../preferences/query_in_title.html | 14 +++++--- .../preferences/results_on_new_tab.html | 12 ++++--- beetroot_template/result_templates/code.html | 29 ++++++++++++--- beetroot_template/results.html | 9 +++-- 11 files changed, 96 insertions(+), 75 deletions(-) diff --git a/beetroot_template/macros.html b/beetroot_template/macros.html index 59ae83e..e4381bc 100644 --- a/beetroot_template/macros.html +++ b/beetroot_template/macros.html @@ -52,33 +52,12 @@ {%- endmacro -%} - -{%- macro tabs_open() -%} -
-{%- endmacro -%} - -{%- macro tab_header(name, id, label, checked) -%} - - -
-{%- endmacro -%} - -{%- macro tab_footer() -%} -
-{%- endmacro -%} - -{%- macro tabs_close() -%} -
-{%- endmacro -%} - + {%- macro checkbox_onoff(name, checked) -%} - -{%- endmacro -%} - -{%- macro checkbox(name, checked, disabled) -%} -{%- if checked == '?' -%} - {{- icon_small('warning') -}} -{%- else -%} - -{%- endif -%} + {%- endmacro -%} diff --git a/beetroot_template/preferences.html b/beetroot_template/preferences.html index e3c22b2..e170451 100644 --- a/beetroot_template/preferences.html +++ b/beetroot_template/preferences.html @@ -1,4 +1,4 @@ -{%- from 'beetroot/icons.html' import icon_big -%} +{%- from 'beetroot/icons.html' import icon_small, icon_big -%} {%- extends "beetroot/page_with_header.html" -%} {%- macro tabs_open() -%} diff --git a/beetroot_template/preferences/answerers.html b/beetroot_template/preferences/answerers.html index b2770c2..98ae618 100644 --- a/beetroot_template/preferences/answerers.html +++ b/beetroot_template/preferences/answerers.html @@ -8,14 +8,15 @@ {{ _('Examples') }}{{- '' -}} {{- '' -}} - {{- '' -}} - - {{- _("This is the list of SearXNG's instant answering modules.") -}} - + {{- '' -}} + + {{- _("This is the list of SearXNG's instant answering modules.") -}} + {{- '' -}} + {%- for answerer in answerers -%} {{- '' -}} - {{- '' -}} + {{- '' -}} {{ answerer.keywords|join(', ') }}{{- '' -}} {{ answerer.info.name }}{{- '' -}} {{ answerer.info.description }}{{- '' -}} @@ -23,15 +24,16 @@ {%- endfor -%} - {{- '' -}} - - {{- _('This is the list of plugins.') -}} - {{- '' -}} + {{- '' -}} + + {{- _('This is the list of plugins.') -}} + {{- '' -}} + {%- for plugin in plugins -%} {%- if plugin.preference_section == 'query' -%} {{- '' -}} - {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}{{- '' -}} + {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}{{- '' -}} {{ plugin.query_keywords|join(', ') }}{{- '' -}} {{ _(plugin.name) }}{{- '' -}} {{ _(plugin.description) }}{{- '' -}} diff --git a/beetroot_template/preferences/center_alignment.html b/beetroot_template/preferences/center_alignment.html index 983a395..80508a1 100644 --- a/beetroot_template/preferences/center_alignment.html +++ b/beetroot_template/preferences/center_alignment.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Center Alignment') }}{{- '' -}}

{{- '' -}} - {{- '' -}} + {{- '' -}}

{{- '' -}}
{{- _('Displays results in the center of the page (Oscar layout).') -}} diff --git a/beetroot_template/preferences/engines.html b/beetroot_template/preferences/engines.html index 6661002..ae71e1c 100644 --- a/beetroot_template/preferences/engines.html +++ b/beetroot_template/preferences/engines.html @@ -14,12 +14,13 @@ {{- '' -}} {{- '' -}} - {{- '' -}} + {{- '' -}} {{- '' -}} {{- '' -}} {{- '' -}} {{- '' -}} {{- '' -}} + {%- if enable_metrics -%} {%- endif -%} @@ -32,9 +33,9 @@ {%- for group, group_bang, engines in engines_by_category[categ] | group_engines_in_tab -%} {%- if loop.length > 1 -%} - {{- '' -}} - {{- '' -}} - {{- '' -}} + {{- '' -}} + {{- '' -}} @@ -72,6 +73,7 @@ {{- '' -}} + {{- '' -}} {%- if enable_metrics -%} {{- engine_time(search_engine.name) -}} {%- endif -%} diff --git a/beetroot_template/preferences/image_proxy.html b/beetroot_template/preferences/image_proxy.html index c636a31..afb3465 100644 --- a/beetroot_template/preferences/image_proxy.html +++ b/beetroot_template/preferences/image_proxy.html @@ -1,11 +1,15 @@
{{- '' -}} {{ _('Image proxy') }}{{- '' -}}

{{- '' -}} - {{- '' -}} -

+ {{- '' -}} +

{{- '' -}}
{{- _('Proxying image results through SearXNG') -}}
{{- '' -}} diff --git a/beetroot_template/preferences/infinite_scroll.html b/beetroot_template/preferences/infinite_scroll.html index df91b5f..1a734ae 100644 --- a/beetroot_template/preferences/infinite_scroll.html +++ b/beetroot_template/preferences/infinite_scroll.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Infinite scroll') }}{{- '' -}}

{{- '' -}} - {{- '' -}} + {{- '' -}}

{{- '' -}}
{{- _('Automatically load next page when scrolling to bottom of current page') -}} diff --git a/beetroot_template/preferences/query_in_title.html b/beetroot_template/preferences/query_in_title.html index 12d0e55..924d6cc 100644 --- a/beetroot_template/preferences/query_in_title.html +++ b/beetroot_template/preferences/query_in_title.html @@ -1,10 +1,14 @@
{{- '' -}} - {{ _("Query in the page's title") }} + {{ _("Query in the page's title") }}{{- '' -}}

{{- '' -}} - {{- '' -}} + {{- '' -}}

{{- '' -}}
{{- _("When enabled, the result page's title contains your query. Your browser can record this title") -}} diff --git a/beetroot_template/preferences/results_on_new_tab.html b/beetroot_template/preferences/results_on_new_tab.html index c0d6c51..972485d 100644 --- a/beetroot_template/preferences/results_on_new_tab.html +++ b/beetroot_template/preferences/results_on_new_tab.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Results on new tabs') }}{{- '' -}}

{{- '' -}} - {{- '' -}} + {{- ' ' -}}

{{- '' -}}
{{- _('Open result links on new browser tabs') -}} diff --git a/beetroot_template/result_templates/code.html b/beetroot_template/result_templates/code.html index e3e2a20..1e72cec 100644 --- a/beetroot_template/result_templates/code.html +++ b/beetroot_template/result_templates/code.html @@ -2,12 +2,31 @@ {{ result_header(result, favicons, image_proxify) -}} {{- result_sub_header(result) -}} -{%- if result.content %}{{ result.content|safe }}{% endif %}

-{%- if result.repository -%} -

{{ result.repository }}

+ +{%- if result.content -%} +

+ {{- result.content|safe -}} +

{%- endif -%} +{%- if result.repository -%} +

{{- '' -}} + {{ _('repo') }}: {{- ' ' -}} + + {{- result.repository -}} + {{- '' -}} +

+{%- endif -%} +
{{- result.codelines|code_highlighter(result.code_language)|safe -}} -
{{- '' -}} +
+ {{- result_sub_footer(result, proxify) -}} -{{ result_footer(result) }} +{{- result_footer(result) -}} diff --git a/beetroot_template/results.html b/beetroot_template/results.html index fddf36e..b59ab40 100644 --- a/beetroot_template/results.html +++ b/beetroot_template/results.html @@ -23,11 +23,10 @@
{{- _("Allow") -}}{{- _("Allow") -}}{{- _("Engine name") -}}{{ _("!bang") -}}{{- _("Supports selected language") -}}{{- _("SafeSearch") -}}{{- _("Time range") -}}{{- _("Weight") }}{{- _("Response time") -}}
{{- _(group) -}} +
{{- _(group) -}} {%- if group_bang -%} {{- group_bang -}} {%- endif -%} {{- checkbox(None, supports[search_engine.name]['time_range_support'], true) -}} {{- search_engine.weight or '1.0' -}}