2017-09-08 20:33:14 +02:00
|
|
|
<!-- Draw glyphicon icon from bootstrap-theme -->
|
|
|
|
{% macro icon(action) -%}
|
|
|
|
<span class="glyphicon glyphicon-{{ action }}"></span>
|
|
|
|
{%- 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 %}
|
|
|
|
|
|
|
|
{%- macro result_link(url, title, classes='') -%}
|
|
|
|
<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) -%}
|
2019-09-23 17:14:32 +02:00
|
|
|
<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe) }}{% else %}{{ result.title|safe}}{% endif %}</h4>
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- 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> • {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
|
|
|
|
{% if result.torrentfile %}<small> • {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw result footer -->
|
|
|
|
{% macro result_footer(result) -%}
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div class="pull-right">
|
|
|
|
{% for engine in result.engines %}
|
|
|
|
<span class="label label-default">{{ engine }}</span>
|
|
|
|
{% endfor %}
|
2019-09-23 17:14:32 +02:00
|
|
|
{% if result.url %}
|
2017-09-08 20:33:14 +02:00
|
|
|
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
|
2019-09-23 17:14:32 +02:00
|
|
|
{% endif %}
|
2017-09-08 20:33:14 +02:00
|
|
|
{% if proxify %}
|
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2019-09-23 17:14:32 +02:00
|
|
|
{% if result.pretty_url %}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
2019-09-23 17:14:32 +02:00
|
|
|
{% endif %}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- 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 %}
|
2019-09-23 17:14:32 +02:00
|
|
|
{% if result.url %}
|
2017-09-08 20:33:14 +02:00
|
|
|
<small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
|
2019-09-23 17:14:32 +02:00
|
|
|
{% endif %}
|
2017-09-08 20:33:14 +02:00
|
|
|
{% if proxify %}
|
|
|
|
<small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
|
|
|
|
{% endif %}
|
2019-09-23 17:14:32 +02:00
|
|
|
{% if result.pretty_url %}
|
2017-09-08 20:33:14 +02:00
|
|
|
<div class="external-link">{{ result.pretty_url }}</div>
|
2019-09-23 17:14:32 +02:00
|
|
|
{% endif %}
|
2017-09-08 20:33:14 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% macro preferences_item_header(info, label, rtl) -%}
|
|
|
|
{% 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) -%}
|
|
|
|
{% if rtl %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
</div>
|
|
|
|
<span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% 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>
|
|
|
|
</div>
|
|
|
|
{%- endmacro %}
|
2017-10-06 21:50:59 +02:00
|
|
|
|
|
|
|
{% macro support_toggle(supports) -%}
|
|
|
|
{% if supports %}
|
|
|
|
<span class="label label-success">
|
|
|
|
{{ _("supported") }}
|
|
|
|
</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="label label-danger">
|
|
|
|
{{ _("not supported") }}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro %}
|