From 189dd0155df60c98b5d7de73b873c8ad444ff931 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2025 15:59:02 +0100 Subject: [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names This patch implements the template generation of the template: searx/templates/simple/icons.html by the way the icon set (the icon names) has been normalized: film-outline --> film magnet-outline --> magnet .. warning --> alert Some missing (categorie) icons had been added. Some of the ionicons are not suitable for a dark theme, we fixed the svg manually in src/svg/ionicons: - https://github.com/searxng/searxng/pull/4284#issuecomment-2680550342 Signed-off-by: Markus Heiser --- searx/templates/simple/base.html | 6 +- searx/templates/simple/categories.html | 28 +++++---- searx/templates/simple/icons.html | 73 +++++++++++++--------- searx/templates/simple/macros.html | 2 +- searx/templates/simple/preferences.html | 4 +- searx/templates/simple/preferences/engines.html | 2 +- searx/templates/simple/result_templates/files.html | 4 +- .../templates/simple/result_templates/images.html | 4 +- searx/templates/simple/result_templates/map.html | 2 +- .../templates/simple/result_templates/torrent.html | 26 +++++--- .../templates/simple/result_templates/videos.html | 2 +- searx/templates/simple/results.html | 6 +- searx/templates/simple/search.html | 2 +- searx/templates/simple/simple_search.html | 2 +- searx/templates/simple/stats.html | 2 +- 15 files changed, 96 insertions(+), 69 deletions(-) (limited to 'searx') diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 93249fbf8..2eebde676 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -46,15 +46,15 @@ {% block header %} diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 10eaf97db..d3cd0b542 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -1,15 +1,19 @@ {% from 'simple/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', + 'apps': 'appstore', + 'dictionaries': 'book', + 'files': 'file-tray-full', + 'general': 'search', + 'images': 'image', + 'it': 'layers', + 'map': 'location', + 'music': 'musical-notes', + 'news': 'newspaper', + 'radio': 'radio', + 'science': 'school', + 'social media': 'people', + 'TV': 'tv', + 'videos': 'play', } -%}
{{- '' -}}
@@ -18,7 +22,7 @@
{{- '' -}}
@@ -27,7 +31,7 @@ {%- else -%} {%- for category in categories -%}{{- '\n' -}} {{- '' -}} {%- endfor -%} diff --git a/searx/templates/simple/icons.html b/searx/templates/simple/icons.html index 6cbec3ee9..c6022de09 100644 --- a/searx/templates/simple/icons.html +++ b/searx/templates/simple/icons.html @@ -1,38 +1,55 @@ -{# this file was generated by searx/static/themes/simple/gruntfile.js #} -{%- set icons = { - 'warning':'', - 'close':'', - 'chevron-up-outline':'', - 'chevron-right':'', - 'chevron-left':'', - 'menu-outline':'', - 'ellipsis-vertical-outline':'', - 'magnet-outline':'', - 'globe-outline':'', - 'search-outline':'', - 'image-outline':'', - 'play-outline':'', - 'newspaper-outline':'', - 'location-outline':'', - 'musical-notes-outline':'', - 'layers-outline':'', - 'school-outline':'', - 'file-tray-full-outline':'', - 'people-outline':'', - 'heart-outline':'', - 'information-circle-outline':'', +{# +Catalog of SVG symbols that can be inserted into the HTML output of a Jinja +template. This file from: + client/simple/tools/icon_catalog.edge.html +#} + +{%- +set catalog = { + 'alert' : '', + 'appstore' : '', + 'book' : '', + 'close' : '', + 'download' : '', + 'ellipsis-vertical' : '', + 'file-tray-full' : '', + 'film' : '', + 'globe' : '', + 'heart' : '', + 'image' : '', + 'layers' : '', + 'leecher' : '', + 'location' : '', + 'magnet' : '', + 'musical-notes' : '', + 'navigate-down' : '', + 'navigate-left' : '', + 'navigate-right' : '', + 'navigate-up' : '', + 'people' : '', + 'play' : '', + 'radio' : '', + 'save' : '', + 'school' : '', + 'search' : '', + 'seeder' : '', + 'settings' : '', + 'tv' : '', + 'information-circle' : '', + 'newspaper' : '', } -%} + {% macro icon(action, alt) -%} - {{ icons[action] | replace("ionicon", "ion-icon") | safe }} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon") | safe }} {%- endmacro %} -{% macro icon_small(action) -%} - {{ icons[action] | replace("ionicon", "ion-icon-small") | safe }} +{% macro icon_small(action, alt) -%} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon-small") | safe }} {%- endmacro %} {% macro icon_big(action, alt) -%} - {{ icons[action] | replace("ionicon", "ion-icon-big") | safe }} -{%- endmacro %} + {{ catalog[action] | replace("__jinja_class_placeholder__", "ion-icon-big") | safe }} +{%- endmacro %} \ No newline at end of file diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 7f537b033..6010a5a3d 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -47,7 +47,7 @@ {%- macro result_sub_footer(result, proxify) -%}
{% for engine in result.engines %}{{ engine }}{% endfor %} - {{ icon_small('ellipsis-vertical-outline') + result_link(cache_url + result.url, _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %} + {{ icon_small('ellipsis-vertical') + result_link(cache_url + result.url, _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %}
{{- '' -}}
{{- '' -}} {%- endmacro -%} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index d68e90e4a..e86e926cc 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -21,7 +21,7 @@ {%- macro checkbox(name, checked, disabled) -%} {%- if checked == '?' -%} - {{- icon_small('warning') -}} + {{- icon_small('alert') -}} {%- else -%} {%- endif -%} @@ -128,7 +128,7 @@ {{- '' -}} {{- '' -}} - {{- icon_big('warning', 'The engine is not reliabled') }} {{ r -}} + {{- icon_big('alert', 'The engine is not reliabled') }} {{ r -}} {{- '' -}} {{- '' -}} {% endif %} @@ -110,7 +110,7 @@ {% if timeout_limit %}{% endif %} {{- engine_data_form(engine_data) -}} - +
{%- endif -%} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 360873c76..b26e27821 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -8,7 +8,7 @@
{% set display_tooltip = true %} diff --git a/searx/templates/simple/simple_search.html b/searx/templates/simple/simple_search.html index 30a6c2add..f69ba6142 100644 --- a/searx/templates/simple/simple_search.html +++ b/searx/templates/simple/simple_search.html @@ -4,7 +4,7 @@ diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html index 9e177143c..575f6adb1 100644 --- a/searx/templates/simple/stats.html +++ b/searx/templates/simple/stats.html @@ -7,7 +7,7 @@ {% if selected_engine_name %} {{ column_name }} {% elif column_order==sort_order %} - {{ column_name }} {{ icon_big('arrow-dropdown') }} + {{ icon_big('navigate-down') }} {{ column_name }} {% else %} {{ column_name }} {% endif %} -- cgit v1.2.3