2022-01-25 20:12:11 +01:00
{% from 'simple/icons.html' import icon_small %}
2017-02-12 15:06:01 +01:00
<!-- Draw favicon -->
{% macro draw_favicon(favicon) -%}
2021-11-25 12:04:39 +01:00
< img width = "14" height = "14" class = "favicon" src = "{{ url_for('static', filename='themes/simple/img/icons/' + favicon + '.png') }}" alt = "{{ favicon }}" >
2017-02-12 15:06:01 +01:00
{%- endmacro %}
{% macro result_open_link(url, classes='') -%}
< a href = "{{ url }}" {% if classes %} class = "{{ classes }}" {% endif %}{% if results_on_new_tab %} target = "_blank" rel = "noopener noreferrer" {% else %} rel = "noreferrer" {% endif %} >
{%- endmacro %}
{%- macro result_close_link() -%}
</ a >
{%- endmacro %}
{%- macro result_link(url, title, classes='') -%}
{{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }}
{%- endmacro -%}
<!-- Draw result header -->
{% macro result_header(result, favicons, image_proxify) -%}
2020-06-09 00:31:52 +02:00
< article class = "result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}" >
2021-11-21 21:38:00 +01:00
{{- result_open_link(result.url, "url_wrapper") -}}
{%- for part in get_pretty_url(result.parsed_url) -%}
< span class = "url_o{{loop.index}}" >< span class = "url_i{{loop.index}}" > {{- part -}}</ span ></ span >
{%- endfor %}
{{- result_close_link() -}}
2021-12-01 18:05:25 +01:00
{%- if result.img_src %}{{ result_open_link(result.url) }}< img class = "image" src = "{{ image_proxify(result.img_src) }}" title = "{{ result.title|striptags }}" loading = "lazy" width = "200" height = "200" > {{ result_close_link() }}{% endif -%}
{%- if result.thumbnail %}{{ result_open_link(result.url) }}< img class = "thumbnail" src = "{{ image_proxify(result.thumbnail) }}" title = "{{ result.title|striptags }}" loading = "lazy" width = "200" height = "200" > {{ result_close_link() }}{% endif -%}
2017-02-12 15:06:01 +01:00
< h3 > {{ result_link(result.url, result.title|safe) }}</ h3 >
{%- endmacro -%}
<!-- Draw result sub header -->
{%- macro result_sub_header(result) -%}
2022-04-19 09:32:51 +02:00
{%- if result.publishedDate %}< time class = "published_date" datetime = "{{ result.pubdate }}" > {{ result.publishedDate }}</ time > {% endif -%}
{%- if result.length %}< div class = "result_length" > {{ _('Length') }}: {{ result.length }}</ div > {% endif -%}
{%- if result.author %}< div class = "result_author" > {{ _('Author') }}: {{ result.author }}</ div > {% endif -%}
{%- if result.metadata %}< div class = "highlight" > {{ result.metadata|safe }}</ div > {% endif -%}
2017-02-12 15:06:01 +01:00
{%- endmacro -%}
<!-- Draw result sub footer -->
{%- macro result_sub_footer(result, proxify) -%}
2021-10-07 23:48:52 +02:00
< div class = "engines" >
{% for engine in result.engines %}< span > {{ engine }}</ span > {% endfor %}
2021-11-13 10:42:07 +01:00
{{ result_link("https://web.archive.org/web/" + result.url, icon_small('ellipsis-vertical-outline') + _('cached'), "cache_link") }}‎ {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %}
2021-10-07 23:48:52 +02:00
</ div > {{- '' -}}
2017-02-12 15:06:01 +01:00
< div class = "break" ></ div > {{- '' -}}
{%- endmacro -%}
<!-- Draw result footer -->
{%- macro result_footer(result) -%}
</ article >
{%- endmacro -%}
<!-- -->
{%- macro tabs_open() -%}
< div class = "tabs" role = "tablist" >
{%- endmacro -%}
2022-03-19 19:55:54 +01:00
{%- macro tab_header(name, id, label, checked) -%}
< input type = "radio" name = "{{ name }}" id = "tab-{{ id }}" {% if checked is sameas true %} checked = "checked" {% endif %} />
2022-02-05 08:56:42 +01:00
< label id = "tab-label-{{ label }}" for = "tab-{{ id }}" role = "tab" aria-controls = "tab-content-{{ id }}" > {{ label }}</ label >
< section id = "tab-content-{{ id }}" role = "tabpanel" aria-labelledby = "tab-label-{{ label }}" aria-hidden = "false" >
2017-02-12 15:06:01 +01:00
{%- endmacro -%}
{%- macro tab_footer() -%}
</ section >
{%- endmacro -%}
{%- macro tabs_close() -%}
</ div >
{%- endmacro -%}
{%- macro checkbox_onoff(name, checked) -%}
2022-02-25 15:46:18 +01:00
< input type = "checkbox" name = "{{ name }}" id = "{{ name }}" value = "None" class = "checkbox-onoff" {% if checked %} checked {% endif %} />
2017-02-12 15:06:01 +01:00
{%- endmacro -%}
2022-02-25 15:46:18 +01:00
{%- macro checkbox(name, checked, disabled) -%}
{%- if checked == '?' -%}
{{- icon_small('warning') -}}
{%- else -%}
< input type = "checkbox" {% if name %} name = "{{ name }}" {% endif %} value = "None" {% if checked %} checked {% endif %}{% if disabled %} disabled {% endif %} />
{%- endif -%}
2017-02-12 15:06:01 +01:00
{%- endmacro -%}