logo

searx

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

macros.html (3975B)


  1. <!-- Draw glyphicon icon from bootstrap-theme -->
  2. {% macro icon(action) -%}
  3. <span class="glyphicon glyphicon-{{ action }}"></span>
  4. {%- endmacro %}
  5. <!-- Draw favicon -->
  6. {% macro draw_favicon(favicon) -%}
  7. <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" />
  8. {%- endmacro %}
  9. {%- macro result_link(url, title, classes='') -%}
  10. <a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a>
  11. {%- endmacro -%}
  12. <!-- Draw result header -->
  13. {% macro result_header(result, favicons) -%}
  14. <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result_link(result.url, result.title|safe) }}</h4>
  15. {%- endmacro %}
  16. <!-- Draw result sub header -->
  17. {% macro result_sub_header(result) -%}
  18. {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
  19. {% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
  20. {% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
  21. {%- endmacro %}
  22. <!-- Draw result footer -->
  23. {% macro result_footer(result) -%}
  24. <div class="clearfix"></div>
  25. <div class="pull-right">
  26. {% for engine in result.engines %}
  27. <span class="label label-default">{{ engine }}</span>
  28. {% endfor %}
  29. <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
  30. {% if proxify %}
  31. <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
  32. {% endif %}
  33. </div>
  34. <div class="external-link">{{ result.pretty_url }}</div>
  35. {%- endmacro %}
  36. <!-- Draw result footer -->
  37. {% macro result_footer_rtl(result) -%}
  38. <div class="clearfix"></div>
  39. {% for engine in result.engines %}
  40. <span class="label label-default">{{ engine }}</span>
  41. {% endfor %}
  42. <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
  43. {% if proxify %}
  44. <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
  45. {% endif %}
  46. <div class="external-link">{{ result.pretty_url }}</div>
  47. {%- endmacro %}
  48. {% macro preferences_item_header(info, label, rtl) -%}
  49. {% if rtl %}
  50. <div class="row form-group">
  51. <label class="col-sm-3 col-md-2 pull-right">{{ label }}</label>
  52. <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>
  53. <div class="col-sm-4 col-md-4">
  54. {% else %}
  55. <div class="row form-group">
  56. <label class="col-sm-3 col-md-2">{{ label }}</label>
  57. <div class="col-sm-4 col-md-4">
  58. {% endif %}
  59. {%- endmacro %}
  60. {% macro preferences_item_footer(info, label, rtl) -%}
  61. {% if rtl %}
  62. </div>
  63. </div>
  64. {% else %}
  65. </div>
  66. <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
  67. </div>
  68. {% endif %}
  69. {%- endmacro %}
  70. {% macro checkbox_toggle(id, blocked) -%}
  71. <div class="onoffswitch">
  72. <input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox">
  73. <label class="onoffswitch-label" for="{{ id }}">
  74. <span class="onoffswitch-inner"></span>
  75. <span class="onoffswitch-switch"></span>
  76. </label>
  77. </div>
  78. {%- endmacro %}
  79. {% macro support_toggle(supports) -%}
  80. {% if supports %}
  81. <span class="label label-success">
  82. {{ _("supported") }}
  83. </span>
  84. {% else %}
  85. <span class="label label-danger">
  86. {{ _("not supported") }}
  87. </span>
  88. {% endif %}
  89. {%- endmacro %}