From 566dfe33307e33e4cb54dc6eae17fb373a09684e Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Sat, 13 Nov 2021 10:42:07 +0100 Subject: [simple theme] update to ion icons 5 and drop webfont * update from ionicons-npm to ionicons ver.5 * drop the webfont built by grunt for icons * built icons.html template for inlining icons with jinja2 into html * update icon to use mostly the outline version * add icons to categories and do not display them on mobile to save space * remove all legacy ion icon font files from simple theme * icons.html is added in this commit since make statc.build.restore requires git to know the file already * cleanup error-dialog --- searx/templates/simple/categories.html | 20 +++++++++++- searx/templates/simple/icons.html | 36 ++++++++++++++++++++++ searx/templates/simple/index.html | 4 +-- searx/templates/simple/macros.html | 11 +------ searx/templates/simple/messages/no_results.html | 22 +++++++------ searx/templates/simple/preferences.html | 9 +++--- .../templates/simple/result_templates/images.html | 4 +-- searx/templates/simple/result_templates/map.html | 5 +-- .../templates/simple/result_templates/torrent.html | 10 +++--- searx/templates/simple/results.html | 23 ++++++++------ searx/templates/simple/search.html | 4 +-- searx/templates/simple/simple_search.html | 4 +-- searx/templates/simple/stats.html | 4 +-- 13 files changed, 104 insertions(+), 52 deletions(-) create mode 100644 searx/templates/simple/icons.html (limited to 'searx/templates/simple') diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 0c121eaed..71fdca90a 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -1,7 +1,25 @@ +{% 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', +} -%}
{{- '' -}}
{%- for category in categories -%} -
+
+ +
{%- endfor -%} {%- if display_tooltip %}
{{ _('Click on the magnifier to perform search') }}
{% endif -%}
{{- '' -}} diff --git a/searx/templates/simple/icons.html b/searx/templates/simple/icons.html new file mode 100644 index 000000000..ffd5041ca --- /dev/null +++ b/searx/templates/simple/icons.html @@ -0,0 +1,36 @@ +{# 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':'', + +} +-%} + +{% macro icon(action, alt) -%} + {{ icons[action] | replace("ionicon", "ion-icon") | safe }} +{%- endmacro %} + +{% macro icon_small(action) -%} + {{ icons[action] | replace("ionicon", "ion-icon-small") | safe }} +{%- endmacro %} + +{% macro icon_big(action, alt) -%} + {{ icons[action] | replace("ionicon", "ion-icon-big") | safe }} +{%- endmacro %} diff --git a/searx/templates/simple/index.html b/searx/templates/simple/index.html index 8a017694e..1e4ea0c48 100644 --- a/searx/templates/simple/index.html +++ b/searx/templates/simple/index.html @@ -1,10 +1,10 @@ {% extends "simple/base.html" %} -{% from 'simple/macros.html' import icon %} +{% from 'simple/icons.html' import icon_big %} {% block meta %} {% endblock %} {% block content %} - +

SearXNG

{% include 'simple/simple_search.html' %} diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 92c6c9ef2..26aa71891 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -1,12 +1,3 @@ - -{% macro icon(action, alt) -%} - -{%- endmacro %} - -{% macro icon_small(action) -%} - -{%- endmacro %} - {% macro draw_favicon(favicon) -%} {{ favicon }} @@ -43,7 +34,7 @@ {%- macro result_sub_footer(result, proxify) -%}
{% for engine in result.engines %}{{ engine }}{% endfor %} - {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %} + {{ result_link("https://web.archive.org/web/" + result.url, icon_small('ellipsis-vertical-outline') + _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %}
{{- '' -}}
{{- '' -}} {%- endmacro -%} diff --git a/searx/templates/simple/messages/no_results.html b/searx/templates/simple/messages/no_results.html index a3ab97758..b98f834e6 100644 --- a/searx/templates/simple/messages/no_results.html +++ b/searx/templates/simple/messages/no_results.html @@ -1,17 +1,19 @@ -{% from 'simple/macros.html' import icon %} +{% from 'simple/icons.html' import icon_big %} {% if unresponsive_engines %} {% else %}