From 881659ca9d29dbce5b19c5a69f03b2d1022d3615 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 18:28:25 +0200 Subject: [PATCH] [mod] oscar theme: /preferences : HTML detail order match visual tabs First details about the general tab, then detail about UI tab, etc... No functionnal change --- searx/plugins/__init__.py | 5 + searx/templates/oscar/preferences.html | 192 ++++++++++++------------- 2 files changed, 101 insertions(+), 96 deletions(-) diff --git a/searx/plugins/__init__.py b/searx/plugins/__init__.py index f9fb3aa58..45b210662 100644 --- a/searx/plugins/__init__.py +++ b/searx/plugins/__init__.py @@ -72,6 +72,11 @@ class PluginStore(): plugin.id = plugin.name.replace(' ', '_') if not hasattr(plugin, 'preference_section'): plugin.preference_section = 'general' + if plugin.preference_section == 'query': + for plugin_attr in ('query_keywords', 'query_examples'): + if not hasattr(plugin, plugin_attr): + logger.critical('missing attribute "{0}", cannot load plugin: {1}'.format(plugin_attr, plugin)) + exit(3) self.plugins.append(plugin) def call(self, ordered_plugin_list, plugin_type, request, *args, **kwargs): diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 46b4fdb69..c47675562 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -187,102 +187,6 @@ -
- - - - - - -
- -
-

- - -

-
- - {% for categ in all_categories %} - -
-
-
-
- - - {% if not rtl %} - - - - - - - - - - {% else %} - - - - - - - - - - {% endif %} - - {% for search_engine in engines_by_category[categ] %} - {% if not search_engine.private %} - - {% if not rtl %} - - - - - - - {{ engine_time(search_engine.name, 'text-right') }} - - {{ engine_reliability(search_engine.name, 'text-right ') }} - {% else %} - {{ engine_reliability(search_engine.name, 'text-left') }} - - {{ engine_time(search_engine.name, 'text-left') }} - - - - - - - {% endif %} - - {% endif %} - {% endfor %} -
{{ _("Allow") }}{{ _("Engine name") }}{{ _("Shortcut") }}{{ _("Selected language") }}{{ _("SafeSearch") }}{{ _("Time range") }}{{ _("Response time") }}{{ _("Max time") }}{{ _("Reliablity") }}{{ _("Reliablity") }}{{ _("Max time") }}{{ _("Response time") }}{{ _("Time range") }}{{ _("SafeSearch") }}{{ _("Selected language") }}{{ _("Shortcut") }}{{ _("Engine name") }}{{ _("Allow") }}
- {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}} - - {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%} - {{- search_engine.name -}} - {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}} - {{ shortcuts[search_engine.name] }}{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}{{ support_toggle(supports[search_engine.name]['safesearch']) }}{{ support_toggle(supports[search_engine.name]['time_range_support']) }}{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}{{ support_toggle(supports[search_engine.name]['time_range_support']) }}{{ support_toggle(supports[search_engine.name]['safesearch']) }}{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}{{ shortcuts[search_engine.name] }}{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}{{ engine_about(search_engine) }} - {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} -
-
-
-
-
- {% endfor %} -
-
+
+ + + + + + +
+ +
+

+ + +

+
+ + {% for categ in all_categories %} + +
+
+
+
+ + + {% if not rtl %} + + + + + + + + + + {% else %} + + + + + + + + + + {% endif %} + + {% for search_engine in engines_by_category[categ] %} + {% if not search_engine.private %} + + {% if not rtl %} + + + + + + + {{ engine_time(search_engine.name, 'text-right') }} + + {{ engine_reliability(search_engine.name, 'text-right ') }} + {% else %} + {{ engine_reliability(search_engine.name, 'text-left') }} + + {{ engine_time(search_engine.name, 'text-left') }} + + + + + + + {% endif %} + + {% endif %} + {% endfor %} +
{{ _("Allow") }}{{ _("Engine name") }}{{ _("Shortcut") }}{{ _("Selected language") }}{{ _("SafeSearch") }}{{ _("Time range") }}{{ _("Response time") }}{{ _("Max time") }}{{ _("Reliablity") }}{{ _("Reliablity") }}{{ _("Max time") }}{{ _("Response time") }}{{ _("Time range") }}{{ _("SafeSearch") }}{{ _("Selected language") }}{{ _("Shortcut") }}{{ _("Engine name") }}{{ _("Allow") }}
+ {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}} + + {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%} + {{- search_engine.name -}} + {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}} + {{ shortcuts[search_engine.name] }}{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}{{ support_toggle(supports[search_engine.name]['safesearch']) }}{{ support_toggle(supports[search_engine.name]['time_range_support']) }}{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}{{ support_toggle(supports[search_engine.name]['time_range_support']) }}{{ support_toggle(supports[search_engine.name]['safesearch']) }}{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}{{ shortcuts[search_engine.name] }}{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}{{ engine_about(search_engine) }} + {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }} +
+
+
+
+
+ {% endfor %} +
+