diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2025-02-04 15:59:02 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-02-28 12:27:41 +0100 |
| commit | 189dd0155df60c98b5d7de73b873c8ad444ff931 (patch) | |
| tree | b35944ba5102b05635eb3f0bc4c43d6e76b88733 /searx/templates/simple/result_templates | |
| parent | 30ee34d3ea5fc6cb25a96c5e30cdb952253ec697 (diff) | |
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/templates/simple/result_templates')
5 files changed, 22 insertions, 16 deletions
diff --git a/searx/templates/simple/result_templates/files.html b/searx/templates/simple/result_templates/files.html index 01dfc3535..13a425f31 100644 --- a/searx/templates/simple/result_templates/files.html +++ b/searx/templates/simple/result_templates/files.html @@ -6,8 +6,8 @@ {%- if result.embedded -%} <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}"> - {%- if result.mtype == 'audio' %}{{ icon_small('musical-notes-outline') -}} - {%- elif result.mtype == 'video' %} {{ icon_small('play-outline') -}} + {%- if result.mtype == 'audio' %}{{ icon_small('musical-notes') -}} + {%- elif result.mtype == 'video' %} {{ icon_small('play') -}} {%- endif %} {{ _('show media') }}</a></small> {%- endif -%} diff --git a/searx/templates/simple/result_templates/images.html b/searx/templates/simple/result_templates/images.html index 617834705..12c2e8194 100644 --- a/searx/templates/simple/result_templates/images.html +++ b/searx/templates/simple/result_templates/images.html @@ -7,8 +7,8 @@ </a>{{- "" -}} <div class="detail swipe-horizontal">{{- "" -}} <a class="result-detail-close" href="#">{{ icon('close') }}</a>{{- "" -}} - <a class="result-detail-previous" href="#">{{ icon('chevron-left') }}</a>{{- "" -}} - <a class="result-detail-next" href="#">{{ icon('chevron-right') }}</a>{{- "" -}} + <a class="result-detail-previous" href="#">{{ icon('navigate-left') }}</a>{{- "" -}} + <a class="result-detail-next" href="#">{{ icon('navigate-right') }}</a>{{- "" -}} <a class="result-images-source" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} href="{{ result.img_src }}"> <img src="" data-src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}">{{- "" -}} </a>{{- "" -}} diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html index d123137cb..dc1f06dce 100644 --- a/searx/templates/simple/result_templates/map.html +++ b/searx/templates/simple/result_templates/map.html @@ -40,7 +40,7 @@ </table> {%- 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') }} {{ _('show map') }}</a></small> {%- endif -%} {{- result_sub_footer(result, proxify) -}} diff --git a/searx/templates/simple/result_templates/torrent.html b/searx/templates/simple/result_templates/torrent.html index befad2c89..0c870ae11 100644 --- a/searx/templates/simple/result_templates/torrent.html +++ b/searx/templates/simple/result_templates/torrent.html @@ -3,15 +3,21 @@ {{ result_header(result, favicons, image_proxify) -}} {{- result_sub_header(result) -}} -{% if result.magnetlink %}<p class="altlink"> • {{ result_link(result.magnetlink, icon_big('magnet-outline') + _('magnet link'), "magnetlink") }}</p>{% endif %} -{% if result.torrentfile %}<p class="altlink"> • {{ result_link(result.torrentfile, icon_big('download-alt') + _('torrent file'), "torrentfile") }}</p>{% endif %} +<p class="altlink"> + {%- if result.magnetlink %}{{ result_link(result.magnetlink, icon_big('magnet') + _('magnet link'), "magnetlink") }}{%- endif -%} + {%- if result.torrentfile %}{{ result_link(result.torrentfile, icon_big('download-alt') + _('torrent file'), "torrentfile") }}{%- endif -%} +</p> -{% if result.seed is defined %}<p class="stat"> • {{ icon_big('arrow-swap') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>{% endif %} - -{%- if result.filesize %}<p class="stat">{{ icon_big('floppy-disk') }} {{ _('Filesize') }}<span class="badge">{{ result.filesize }}</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 -%} +<p class="stat"> + {%- if result.seed is defined %} + {{ icon_big('seeder') }} <span class="badge">{{ result.seed }} {{ _('Seeder') }} </span> + {{ icon_big('leecher') }} <span class="badge">{{ result.leech }} {{ _('Leecher') }}</span> + {% endif %} +</p> +<p class="stat"> + {%- if result.filesize %}{{ icon_big('save') }} <span class="badge">{{ result.filesize }} {{ _('Filesize') }}</span>{%- endif -%} + {%- if result.files %}{{ icon_big('file') }} <span class="badge">{{ result.files }} {{ _('Number of Files') }}</span>{%- endif -%} +</p> +{%- if result.content %}<p class="content">{{ result.content|safe }}</p>{%- endif -%} {{- result_sub_footer(result, proxify) -}} -{{- result_footer(result) }} +{{- result_footer(result) -}} diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html index 969f87a4d..40a05698f 100644 --- a/searx/templates/simple/result_templates/videos.html +++ b/searx/templates/simple/result_templates/videos.html @@ -3,7 +3,7 @@ {{ result_header(result, favicons, image_proxify) }} {{ result_sub_header(result) }} {% 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') }} {{ _('show video') }}</a></p> {%- endif %} {%- if result.content %} <p class="content"> |