logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

macros.html (3578B)


  1. <!-- Draw favicon -->
  2. <!-- TODO: using url_for methode -->
  3. {% macro draw_favicon(favicon) -%}
  4. <img width="14" height="14" class="favicon" src="static/themes/lanodan/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
  5. {%- endmacro %}
  6. {% macro result_open_link(url, classes='') -%}
  7. <a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>
  8. {%- endmacro %}
  9. {%- macro result_close_link() -%}
  10. </a>
  11. {%- endmacro %}
  12. {%- macro result_link(url, title, classes='') -%}
  13. {{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }}
  14. {%- endmacro -%}
  15. <!-- Draw result header -->
  16. {% macro result_header(result, favicons, image_proxify) -%}
  17. <article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}">
  18. {%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="image" />{{ result_close_link() }}{% endif -%}
  19. {%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/>{{ result_close_link() }}{% endif -%}
  20. <h3>{{ result_link(result.url, result.title|safe) }}</h3>
  21. {%- endmacro -%}
  22. <!-- Draw result sub header -->
  23. {%- macro result_sub_header(result) -%}
  24. {% if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
  25. {%- endmacro -%}
  26. <!-- Draw result sub footer -->
  27. {%- macro result_sub_footer(result, proxify) -%}
  28. <div class="engines">{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}</div>{{- '' -}}
  29. <p class="url"><span class="url">{{ result.pretty_url }}</span>{{ result_link("https://web.archive.org/web/" + result.url, "🔗" + _('cached'), "cache_link") }}&lrm; {% if proxify %} {{ result_link(proxify(result.url), "🔗" + _('proxied'), "proxyfied_link") }} {% endif %}</p>{{- '' -}}
  30. <div class="break"></div>{{- '' -}}
  31. {%- endmacro -%}
  32. <!-- Draw result footer -->
  33. {%- macro result_footer(result) -%}
  34. </article>
  35. {%- endmacro -%}
  36. <!-- -->
  37. {%- macro tabs_open() -%}
  38. <div class="tabs" role="tablist">
  39. {%- endmacro -%}
  40. {%- macro tab_header(name, id, label) -%}
  41. <input type="radio" name="{{ name }}" id="tab_{{ id }}"/>
  42. <label for="tab_{{ id }}" role="tab"
  43. aria-controls="panel{{ id }}">{{ label }}</label>
  44. <section id="tab-content{{ id }}" role="tabpanel"
  45. aria-labelledby="{{ label }}" aria-hidden="false">
  46. {%- endmacro -%}
  47. {%- macro tab_footer() -%}
  48. </section>
  49. {%- endmacro -%}
  50. {%- macro tabs_close() -%}
  51. </div>
  52. {%- endmacro -%}
  53. {%- macro checkbox_onoff(name, checked) -%}
  54. <div class="checkbox-onoff">{{- '' -}}
  55. <input type="checkbox" value="None" id="{{ name }}" name="{{ name }}" {% if checked %}checked{% endif %}/>{{- '' -}}
  56. <label for="{{ name }}"></label>{{- '' -}}
  57. </div>
  58. {%- endmacro -%}
  59. {%- macro checkbox(name, checked, readonly, disabled) -%}
  60. <div class="checkbox">{{- '' -}}
  61. <input type="checkbox" value="None" id="{{ name }}" name="{{ name }}" {% if checked %}checked{% endif %}{% if readonly %} readonly="readonly" {% endif %}{% if disabled %} disabled="disabled" {% endif %}/>{{- '' -}}
  62. <label for="{{ name }}"></label>{{- '' -}}
  63. </div>
  64. {%- endmacro -%}