searxng/searx/templates/oscar/macros.html

89 lines
3.7 KiB
HTML
Raw Normal View History

<!-- Draw glyphicon icon from bootstrap-theme -->
{% macro icon(action) -%}
<span class="glyphicon glyphicon-{{ action }}"></span>
{%- endmacro %}
<!-- Draw favicon -->
<!-- TODO: using url_for methode -->
{% macro draw_favicon(favicon) -%}
<img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
{%- endmacro %}
{%- macro result_link(url, title, classes='') -%}
2017-01-26 20:18:10 +00:00
<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a>
{%- endmacro -%}
<!-- Draw result header -->
{% macro result_header(result, favicons) -%}
<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4>
{%- endmacro %}
<!-- Draw result sub header -->
{% macro result_sub_header(result) -%}
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
{% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
{% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
{%- endmacro %}
<!-- Draw result footer -->
{% macro result_footer(result) -%}
<div class="clearfix"></div>
2015-10-03 15:46:12 +00:00
<div class="pull-right">
{% for engine in result.engines %}
<span class="label label-default">{{ engine }}</span>
{% endfor %}
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
2016-10-16 22:22:41 +00:00
{% if proxify %}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
{% endif %}
2015-10-03 15:46:12 +00:00
</div>
2016-06-26 12:13:03 +00:00
<div class="text-muted"><small>{{ result.pretty_url }}</small></div>
{%- endmacro %}
<!-- Draw result footer -->
{% macro result_footer_rtl(result) -%}
<div class="clearfix"></div>
{% for engine in result.engines %}
<span class="label label-default">{{ engine }}</span>
{% endfor %}
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
2016-10-16 22:22:41 +00:00
{% if proxify %}
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
{% endif %}
2016-06-27 21:52:24 +00:00
<div class="text-muted"><small>{{ result.pretty_url }}</small></div>
{%- endmacro %}
{% macro preferences_item_header(info, label, rtl) -%}
2015-02-11 19:08:04 +00:00
{% if rtl %}
<div class="row form-group">
<label class="col-sm-3 col-md-2 pull-right">{{ label }}</label>
<span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>
<div class="col-sm-4 col-md-4">
{% else %}
<div class="row form-group">
<label class="col-sm-3 col-md-2">{{ label }}</label>
<div class="col-sm-4 col-md-4">
{% endif %}
{%- endmacro %}
{% macro preferences_item_footer(info, label, rtl) -%}
2015-02-11 19:08:04 +00:00
{% if rtl %}
</div>
</div>
{% else %}
</div>
<span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
</div>
{% endif %}
{%- endmacro %}
2015-03-10 22:03:06 +00:00
{% macro checkbox_toggle(id, blocked) -%}
<div class="onoffswitch">
<input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox">
<label class="onoffswitch-label" for="{{ id }}">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
2015-03-10 22:03:06 +00:00
</div>
{%- endmacro %}