mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
upd
This commit is contained in:
parent
fd843a169a
commit
3747a01486
35 changed files with 1624 additions and 0 deletions
18
searx/templates/oscar/result_templates/code.html
Normal file
18
searx/templates/oscar/result_templates/code.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context%}
|
||||
|
||||
{{ result_header(result, favicons) }}
|
||||
{{ result_sub_header(result) }}
|
||||
|
||||
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
|
||||
|
||||
{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} aria-labelledby="result-{{loop.index}}">{{ result.repository }}</a></p>{% endif %}
|
||||
|
||||
<div dir="ltr">
|
||||
{{ result.codelines|code_highlighter(result.code_language)|safe }}
|
||||
</div>
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
31
searx/templates/oscar/result_templates/default.html
Normal file
31
searx/templates/oscar/result_templates/default.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
|
||||
|
||||
{{- result_header(result, favicons, loop.index) -}}
|
||||
{{- result_sub_header(result, loop.index) -}}
|
||||
|
||||
{%- 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') }}" aria-labelledby="result-{{loop.index}}">{{ icon('music') }} {{ _('show media') }}</a></small>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if result.embedded -%}
|
||||
<div id="result-media-{{ index }}" class="collapse">
|
||||
{{- result.embedded|safe -}}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if result.img_src or result.thumbnail -%}
|
||||
<div class="container-fluid">{{- "" -}}
|
||||
<div class="row">{{- "" -}}
|
||||
<img src="{{ image_proxify(result.img_src or result.thumbnail) }}" 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 -%}
|
||||
|
||||
{%- if rtl -%}
|
||||
{{ result_footer_rtl(result, loop.index) }}
|
||||
{%- else -%}
|
||||
{{ result_footer(result, loop.index) }}
|
||||
{%- endif -%}
|
||||
55
searx/templates/oscar/result_templates/files.html
Normal file
55
searx/templates/oscar/result_templates/files.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer_nocache, result_footer_nocache_rtl, icon with context %}
|
||||
|
||||
{{- result_header(result, favicons) -}}
|
||||
{{- result_sub_header(result) -}}
|
||||
|
||||
{%- 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('music') -}}
|
||||
{%- elif result.mtype == 'video' %} {{ icon('film') -}}
|
||||
{%- 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_footer_nocache_rtl(result) }}
|
||||
{%- else -%}
|
||||
{{ result_footer_nocache(result) }}
|
||||
{%- endif -%}
|
||||
36
searx/templates/oscar/result_templates/images.html
Normal file
36
searx/templates/oscar/result_templates/images.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{%- from 'oscar/macros.html' import draw_favicon with context -%}
|
||||
|
||||
<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}" id="result-{{loop.index}}">{{- "" -}}
|
||||
<img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">{{- "" -}}
|
||||
</a>
|
||||
<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">{{- "" -}}
|
||||
<div class="modal-dialog">{{- "" -}}
|
||||
<div class="modal-wrapper">{{- "" -}}
|
||||
<div class="modal-header">{{- "" -}}
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>{{- "" -}}
|
||||
<h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
<div class="modal-body">{{- "" -}}
|
||||
<img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}">
|
||||
{%- if result.author %}<span class="photo-author">{{ result.author }}</span><br />{% endif -%}
|
||||
{%- if result.content %}<p class="result-content">{{ result.content|striptags }}</p>{% endif -%}
|
||||
{%- if result.img_format %}<p class="result-format">{{ result.img_format }}</p>{% endif -%}
|
||||
{%- if result.source %}<p class="result-source">{{ result.source }}</p>{% endif -%}
|
||||
</div>{{- "" -}}
|
||||
<div class="modal-footer">{{- "" -}}
|
||||
<div class="clearfix"></div>{{- "" -}}
|
||||
<span class="label label-default pull-right">{{ result.engine }}</span>{{- "" -}}
|
||||
<p class="text-muted pull-left">{{ result.pretty_url }}</p>{{- "" -}}
|
||||
<div class="clearfix"></div>{{- "" -}}
|
||||
<div class="row">{{- "" -}}
|
||||
<div class="col-md-6">{{- "" -}}
|
||||
<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('Get image') }}</a>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
<div class="col-md-6">{{- "" -}}
|
||||
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('View source') }}</a>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
19
searx/templates/oscar/result_templates/key-value.html
Normal file
19
searx/templates/oscar/result_templates/key-value.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{% from 'oscar/macros.html' import result_footer, result_footer_rtl with context %}
|
||||
<div class="result result-default">
|
||||
<table class="table table-responsive table-bordered table-condensed">
|
||||
{% for key, value in result.items() %}
|
||||
{% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions', 'pretty_url', 'parsed_url'] %}
|
||||
{% continue %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><b>{{ key|upper }}</b>: {{ value|truncate }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
76
searx/templates/oscar/result_templates/map.html
Normal file
76
searx/templates/oscar/result_templates/map.html
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
|
||||
|
||||
{{- result_header(result, favicons, loop.index) -}}
|
||||
{{- result_sub_header(result, loop.index) -}}
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
{%- if result.img_src -%}<img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" class="img-thumbnail">{%- endif -%}
|
||||
|
||||
{%- if result.type_icon or result.type -%}
|
||||
<p class="result-content">
|
||||
{%- if result.type_icon -%}
|
||||
<img src="{{ image_proxify(result.type_icon) }}" title="{{ result.type|striptags }}" class="img-type">
|
||||
{%- endif -%}
|
||||
{{ result.type if result.type is not none else '' }}
|
||||
</p>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%}
|
||||
|
||||
<table class="result-content result-map-details">
|
||||
{%- if result.address -%}
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{{ result.address_label or _('address') }}
|
||||
</th>
|
||||
<td class="result-content result-adress" itemscope itemtype="http://schema.org/PostalAddress">
|
||||
{%- if result.address.name -%}
|
||||
<strong itemprop="name" class="hidden">{{ result.address.name }}</strong>
|
||||
{%- endif -%}
|
||||
{%- if result.address.road -%}
|
||||
<span itemprop="streetAddress">
|
||||
{%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%}
|
||||
{{- result.address.road -}}
|
||||
</span><br/>
|
||||
{%- endif -%}
|
||||
{%- if result.address.locality -%}
|
||||
<span itemprop="addressLocality">{{ result.address.locality }}</span>
|
||||
{%- if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif -%}
|
||||
<br/>
|
||||
{%- endif -%}
|
||||
{%- if result.address.country -%}
|
||||
<span itemprop="addressCountry">{{ result.address.country }}</span>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
</tr>
|
||||
{%- endif %}
|
||||
{%- for info in result.data -%}
|
||||
<tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr>
|
||||
{%- endfor -%}
|
||||
{%- for link in result.links -%}
|
||||
<tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr>
|
||||
{%- endfor -%}
|
||||
</table>
|
||||
|
||||
<p class="result-content">
|
||||
{%- if (result.latitude and result.longitude) or result.boundingbox -%}
|
||||
<span><a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" 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 %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></span>
|
||||
{%- endif -%}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
{%- if (result.latitude and result.longitude) or result.boundingbox -%}
|
||||
<div class="collapse" id="result-map-{{ index }}">
|
||||
<div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
</div>
|
||||
{%- if rtl -%}
|
||||
{{- result_footer_rtl(result, loop.index) -}}
|
||||
{% else %}
|
||||
{{- result_footer(result, loop.index) -}}
|
||||
{%- endif -%}
|
||||
23
searx/templates/oscar/result_templates/products.html
Normal file
23
searx/templates/oscar/result_templates/products.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{% from 'oscar/macros.html' import draw_favicon, icon, result_header, result_sub_header, result_footer_rtl, result_footer %}
|
||||
|
||||
{{ result_header(result, favicons) }}
|
||||
{{ result_sub_header(result) }}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-3 col-md-3 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
|
||||
<p class="col-xs-12 col-sm-9 col-md-9 result-content">
|
||||
{% if result.price %}<big>{{ result.price|safe }}</big></br>{% endif %}
|
||||
{% if result.shipping %}<small>{{ result.shipping|safe }}</small></br>{% endif %}
|
||||
{% if result.source_country %}<small>{{ result.source_country|safe }}</small></br>{% endif %}
|
||||
{% if result.content %}{{ result.content|safe }}{% endif %}
|
||||
{% if result.has_stock is defined %}<br>{% if result.has_stock %}{{ icon('check', _('Has stock')) }}{% else %}{{ icon('alert', _('Out of stock')) }}{% endif %}{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
25
searx/templates/oscar/result_templates/torrent.html
Normal file
25
searx/templates/oscar/result_templates/torrent.html
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
|
||||
|
||||
{{- result_header(result, favicons, loop.index) -}}
|
||||
{{- result_sub_header(result, loop.index) -}}
|
||||
|
||||
{%- if result.seed is defined %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif -%}
|
||||
{%- if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') -}}
|
||||
<span class="badge">
|
||||
{%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') -}}
|
||||
{%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') -}}
|
||||
{%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') -}}
|
||||
{%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') -}}
|
||||
{%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%}
|
||||
</span>{% endif -%}
|
||||
{%- if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif -%}
|
||||
|
||||
{%- if result.content %}<br />{{ result.content|safe }}{% endif -%}
|
||||
|
||||
</p>
|
||||
|
||||
{%- if rtl -%}
|
||||
{{ result_footer_rtl(result, loop.index) }}
|
||||
{%- else -%}
|
||||
{{ result_footer(result, loop.index) }}
|
||||
{%- endif -%}
|
||||
29
searx/templates/oscar/result_templates/videos.html
Normal file
29
searx/templates/oscar/result_templates/videos.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
|
||||
|
||||
{{- result_header(result, favicons, loop.index) -}}
|
||||
{{- result_sub_header(result, loop.index) -}}
|
||||
|
||||
{%- if result.embedded -%}
|
||||
<small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if result.embedded -%}
|
||||
<div id="result-video-{{ index }}" class="collapse">
|
||||
{{- result.embedded|safe -}}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
<div class="container-fluid">{{- "" -}}
|
||||
<div class="row">{{- "" -}}
|
||||
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" aria-labelledby="result-{{loop.index}}" /></a>
|
||||
{%- if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif -%}
|
||||
{%- if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif -%}
|
||||
{%- if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif -%}
|
||||
</div>{{- "" -}}
|
||||
</div>
|
||||
|
||||
{%- if rtl -%}
|
||||
{{ result_footer_rtl(result, loop.index) }}
|
||||
{%- else -%}
|
||||
{{ result_footer(result, loop.index) }}
|
||||
{%- endif -%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue