2014-12-22 15:07:02 +00:00
|
|
|
<!-- Draw glyphicon icon from bootstrap-theme -->
|
2014-09-27 08:23:05 +00:00
|
|
|
{% macro icon(action) -%}
|
|
|
|
<span class="glyphicon glyphicon-{{ action }}"></span>
|
|
|
|
{%- endmacro %}
|
2014-12-22 15:07:02 +00:00
|
|
|
|
|
|
|
<!-- Draw favicon -->
|
|
|
|
<!-- TODO: using url_for methode -->
|
|
|
|
{% macro draw_favicon(favicon) -%}
|
2015-01-09 20:25:13 +00:00
|
|
|
<img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
|
2014-12-22 15:07:02 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw result header -->
|
2015-01-09 20:25:13 +00:00
|
|
|
{% macro result_header(result, favicons) -%}
|
2015-04-26 13:32:26 +00:00
|
|
|
<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}" rel="noreferrer">{{ result.title|safe }}</a></h4>
|
2014-12-22 15:07:02 +00: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 %}
|
2015-04-26 13:32:26 +00:00
|
|
|
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
|
2015-01-21 17:03:11 +00:00
|
|
|
{% if result.magnetlink %}<small> • <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a></small>{% endif %}
|
2015-04-26 13:32:26 +00:00
|
|
|
{% if result.torrentfile %}<small> • <a href="{{ result.torrentfile }}" class="torrentfile" rel="noreferrer">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
|
2014-12-22 15:07:02 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
<!-- Draw result footer -->
|
|
|
|
{% macro result_footer(result) -%}
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<span class="label label-default pull-right">{{ result.engine }}</span>
|
|
|
|
<p class="text-muted">{{ result.pretty_url }}</p>
|
|
|
|
{%- endmacro %}
|
2015-02-10 14:23:56 +00:00
|
|
|
|
|
|
|
<!-- Draw result footer -->
|
|
|
|
{% macro result_footer_rtl(result) -%}
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<span class="label label-default pull-left">{{ result.engine }}</span>
|
2015-02-13 00:03:18 +00:00
|
|
|
<p class="text-muted">{{ result.pretty_url }}‎</p>
|
2015-02-10 14:23:56 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2015-02-11 19:53:06 +00:00
|
|
|
{% macro preferences_item_header(info, label, rtl) -%}
|
2015-02-11 19:08:04 +00:00
|
|
|
{% if rtl %}
|
2015-02-10 14:23:56 +00:00
|
|
|
<div class="row form-group">
|
2015-02-13 00:03:18 +00:00
|
|
|
<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>
|
2015-02-10 14:23:56 +00:00
|
|
|
<div class="col-sm-4 col-md-4">
|
|
|
|
{% else %}
|
|
|
|
<div class="row form-group">
|
2015-02-11 19:53:06 +00:00
|
|
|
<label class="col-sm-3 col-md-2">{{ label }}</label>
|
2015-02-10 14:23:56 +00:00
|
|
|
<div class="col-sm-4 col-md-4">
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2015-02-11 19:53:06 +00:00
|
|
|
{% macro preferences_item_footer(info, label, rtl) -%}
|
2015-02-11 19:08:04 +00:00
|
|
|
{% if rtl %}
|
2015-02-10 14:23:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
</div>
|
2015-02-11 19:53:06 +00:00
|
|
|
<span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
|
2015-02-10 14:23:56 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro %}
|
2015-03-10 22:03:06 +00:00
|
|
|
|
|
|
|
{% macro checkbox_toggle(id, blocked) -%}
|
|
|
|
<div class="checkbox">
|
|
|
|
<input class="hidden" type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} />
|
|
|
|
<label class="btn btn-success label_hide_if_checked" for="{{ id }}">{{ _('Block') }}</label>
|
|
|
|
<label class="btn btn-danger label_hide_if_not_checked" for="{{ id }}">{{ _('Allow') }}</label>
|
|
|
|
</div>
|
|
|
|
{%- endmacro %}
|