summaryrefslogtreecommitdiff
path: root/searx/templates/simple/result_templates/files.html
diff options
context:
space:
mode:
authorHermógenes Oliveira <OliveiraHermogenes@users.noreply.github.com>2023-04-06 15:41:25 -0300
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-01-31 20:03:10 +0100
commitfa7fef7d873b49c763b93406735f62ca38efba68 (patch)
treea10ce5e75e90ea8ed51fdce5de618e8b8458de31 /searx/templates/simple/result_templates/files.html
parentab8e5383fb6021afd690060c7b718dc505e7d30c (diff)
downloadsearxng-fa7fef7d873b49c763b93406735f62ca38efba68.tar.gz
searxng-fa7fef7d873b49c763b93406735f62ca38efba68.zip
Provide template for results in file category
This is used, for instance, by the recoll engine.
Diffstat (limited to 'searx/templates/simple/result_templates/files.html')
-rw-r--r--searx/templates/simple/result_templates/files.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/searx/templates/simple/result_templates/files.html b/searx/templates/simple/result_templates/files.html
new file mode 100644
index 000000000..4b0147ec7
--- /dev/null
+++ b/searx/templates/simple/result_templates/files.html
@@ -0,0 +1,56 @@
+{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link with context %}
+{% from 'simple/icons.html' import icon_small %}
+
+{{- result_header(result, favicons, image_proxify) -}}
+{{- result_sub_header(result) -}}
+
+{%- if result.embedded -%}
+ <small> &bull; <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') -}}
+ {%- endif %} {{ _('show media') }}</a></small>
+{%- endif -%}
+
+{%- if result.embedded -%}
+<div id="result-media-{{ index }}" class="collapse">
+ {{- result.embedded|safe -}}
+</div>
+{%- endif -%}
+
+{%- if result.abstract %}<p class="result-content result-abstract">{{ result.abstract|safe }}</p>{% endif -%}
+
+{%- if result.img_src -%}
+<div class="container-fluid">
+ <div class="row">
+<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
+{%- if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%}
+ </div>
+</div>
+{%- else -%}
+{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%}
+{%- endif -%}
+
+<table class="result-metadata result-content">
+{%- if result.author %}<tr><td>{{ _('Author') }}</td><td>{{ result.author|safe }}</td></tr>{% endif -%}
+
+{%- if result.filename %}<tr><td>{{ _('Filename') }}</td><td>{{ result.filename|safe }}</td></tr>{% endif -%}
+
+{%- if result.size %}<tr><td>{{ _('Filesize') }}</td><td>
+ {%- if result.size < 1024 %}{{ result.size }} {{ _('Bytes') -}}
+ {%- elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') -}}
+ {%- elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') -}}
+ {%- elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') -}}
+ {%- else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
+ </td></tr>
+{%- endif -%}
+
+{%- if result.time %}<tr><td>{{ _('Date') }}</td><td>{{ result.time|safe }}</td></tr>{% endif -%}
+
+{%- if result.mtype %}<tr><td>{{ _('Type') }}</td><td>{{ result.mtype|safe }}/{{ result.subtype|safe }}</td></tr>{% endif -%}
+</table>
+
+{%- if rtl -%}
+{{ result_sub_footer(result) }}
+{%- else -%}
+{{ result_footer(result) }}
+{%- endif -%}