2017-09-08 20:33:14 +02:00
|
|
|
<!-- Draw glyphicon icon from bootstrap-theme -->
|
2020-12-09 17:33:18 +01:00
|
|
|
{% macro icon(action, alt) -%}
|
|
|
|
<span title="{{ alt }}" class="glyphicon glyphicon-{{ action }}"></span>
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw favicon -->
|
|
|
|
{% macro draw_favicon(favicon) -%}
|
2017-10-19 05:44:11 +02:00
|
|
|
<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" />
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2020-06-28 20:40:48 +02:00
|
|
|
{%- macro result_link(url, title, classes='', id='') -%}
|
|
|
|
<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}{% if id %} aria-labelledby="result-{{id}}"{%endif%}>{{ title }}</a>
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
<!-- Draw result header -->
|
2020-06-28 20:40:48 +02:00
|
|
|
{% macro result_header(result, favicons, id) -%}
|
2020-12-28 09:04:39 +01:00
|
|
|
<h4 class="result_header" id="result-{{id}}">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }}{% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe, id=id) }}{% else %}{{ result.title|safe}}{% endif %}</h4>
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw result sub header -->
|
2020-06-28 20:40:48 +02:00
|
|
|
{% macro result_sub_header(result, id) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%}
|
|
|
|
{%- if result.magnetlink %}<small> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif -%}
|
|
|
|
{%- if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif -%}
|
2021-03-25 21:44:07 +01:00
|
|
|
{%- if result.metadata %} <div class="highlight">{{ result.metadata|safe }}</div>{% endif -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw result footer -->
|
2020-06-28 20:40:48 +02:00
|
|
|
{% macro result_footer(result, id) -%}
|
2019-08-06 11:41:16 +02:00
|
|
|
<div class="clearfix"></div>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="pull-right">
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- for engine in result.engines -%}
|
|
|
|
<span class="label label-default">{{ engine }}</span>
|
|
|
|
{%- endfor -%}
|
|
|
|
{%- if result.url -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if result.cached_url -%}
|
2016-05-19 07:38:43 +02:00
|
|
|
<small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- elif not result.is_onion -%}
|
2016-05-19 07:38:43 +02:00
|
|
|
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- endif -%}
|
|
|
|
{%- if proxify -%}
|
2020-06-28 20:40:48 +02:00
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- endif -%}
|
|
|
|
</div>
|
|
|
|
{%- if result.pretty_url -%}
|
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
|
|
|
{%- endif -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2020-11-30 08:35:15 +01:00
|
|
|
<!-- Draw result footer without cache link -->
|
|
|
|
{% macro result_footer_nocache(result) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
<div class="clearfix"></div>{{- "" -}}
|
2020-11-30 08:35:15 +01:00
|
|
|
<div class="pull-right">
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- for engine in result.engines -%}
|
2020-11-30 08:35:15 +01:00
|
|
|
<span class="label label-default">{{ engine }}</span>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endfor -%}
|
|
|
|
{%- if proxify -%}
|
2020-11-30 08:35:15 +01:00
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
|
|
|
</div>{{- "" -}}
|
2020-11-30 08:35:15 +01:00
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2017-09-08 20:33:14 +02:00
|
|
|
<!-- Draw result footer -->
|
2020-06-28 20:40:48 +02:00
|
|
|
{% macro result_footer_rtl(result, id) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
<div class="clearfix"></div>
|
|
|
|
{%- for engine in result.engines -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
<span class="label label-default">{{ engine }}</span>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endfor -%}
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- if result.url -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if result.cached_url -%}
|
2016-05-19 07:38:43 +02:00
|
|
|
<small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- elif not result.is_onion -%}
|
2016-05-19 07:38:43 +02:00
|
|
|
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- endif -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if proxify -%}
|
2020-06-28 20:40:48 +02:00
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2019-08-06 11:41:16 +02:00
|
|
|
{%- if result.pretty_url -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2020-11-30 08:35:15 +01:00
|
|
|
<!-- Draw result footer without cache link -->
|
|
|
|
{% macro result_footer_nocache_rtl(result) -%}
|
|
|
|
<div class="clearfix"></div>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- for engine in result.engines -%}
|
2020-11-30 08:35:15 +01:00
|
|
|
<span class="label label-default">{{ engine }}</span>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endfor -%}
|
|
|
|
{%- if proxify -%}
|
2020-11-30 08:35:15 +01:00
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2020-11-30 08:35:15 +01:00
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2020-06-25 17:32:05 +02:00
|
|
|
{% macro preferences_item_header(info, label, rtl, id) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if rtl -%}
|
|
|
|
<div class="row form-group">{{- "" -}}
|
|
|
|
<label class="col-sm-3 col-md-2 pull-right"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}}
|
|
|
|
<span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="col-sm-4 col-md-4">
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- else -%}
|
|
|
|
<div class="row form-group">{{- "" -}}
|
|
|
|
<label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="col-sm-4 col-md-4">
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% macro preferences_item_footer(info, label, rtl) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- if rtl -%}
|
|
|
|
</div>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
</div>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- else -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
</div>
|
2021-03-17 09:22:05 +01:00
|
|
|
<span class="col-sm-5 col-md-6 help-block">{{ info }}</span>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
</div>
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2020-08-27 21:55:47 +02:00
|
|
|
{% macro custom_select_class(rtl) -%}
|
|
|
|
custom-select{% if rtl %}-rtl{% endif %}
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2017-09-08 20:33:14 +02:00
|
|
|
{% macro checkbox_toggle(id, blocked) -%}
|
2021-03-17 09:22:05 +01:00
|
|
|
<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>{{- "" -}}
|
|
|
|
<label class="visually-hidden" for="{{ id }}">{{ _('Allow') }}</label>{{- "" -}}
|
|
|
|
</div>{{- "" -}}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
2017-10-06 21:50:59 +02:00
|
|
|
|
|
|
|
{% macro support_toggle(supports) -%}
|
2021-04-14 18:11:35 +02:00
|
|
|
{%- if supports == '?' -%}
|
|
|
|
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" title="{{- _('broken') -}}"></span>{{- "" -}}
|
|
|
|
{%- elif supports -%}
|
|
|
|
<span class="glyphicon glyphicon-ok" aria-hidden="true" title="{{- _('supported') -}}"></span>{{- "" -}}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- else -%}
|
2021-04-14 18:11:35 +02:00
|
|
|
<span aria-hidden="true" title="{{- _('not supported') -}}"></span>{{- "" -}}
|
2021-03-17 09:22:05 +01:00
|
|
|
{%- endif -%}
|
2017-10-06 21:50:59 +02:00
|
|
|
{%- endmacro %}
|