mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
[enh] remove repeating codeparts inside the oscar template
This commit is contained in:
parent
7b44fd47a7
commit
d810763107
9 changed files with 54 additions and 48 deletions
|
@ -1,3 +1,28 @@
|
|||
<!-- 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/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
|
||||
{%- endmacro %}
|
||||
|
||||
<!-- Draw result header -->
|
||||
{% macro result_header(result) -%}
|
||||
<h4 class="result_header">{% if result.favicon %}{{ draw_favicon(result.favicon) }} {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></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 %}
|
||||
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
|
||||
{%- 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 %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue